Skip to content

Commit

Permalink
docs(recipes): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanrahic committed Aug 21, 2024
1 parent 71a7053 commit 9438f92
Show file tree
Hide file tree
Showing 23 changed files with 301 additions and 423 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: running-python-app-with-opentelemetry-collector-and-tracetest
title: Python with OpenTelemetry manual instrumention
description: Quick start how to configure a Python app to use OpenTelemetry instrumentation with traces, and Tracetest for enhancing your e2e and integration tests with trace-based testing.
hide_table_of_contents: true
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
Expand Down Expand Up @@ -124,14 +124,6 @@ trace.set_tracer_provider(provider)
tracer = trace.get_tracer(__name__)
```

## Running the Python App

To start the full setup, run the following command:

```bash
docker compose up -d
```

There are 3 endpoints in the Flask app. To see manual instrumentation, trigger the `"/manual"` endpoint. To see the automatic instrumentation, trigger the `"/automatic"` endpoint respectively.

```python
Expand All @@ -154,7 +146,7 @@ def home():
return "App works."
```

## Run Tracetest Tests
## Running the Python App and Tracetest

To execute the tests, run this command:

Expand All @@ -163,12 +155,24 @@ docker compose run tracetest-run
```

This will:
1. Start the Node.js app, the OpenTelemetry Collector, and send the traces to the Tracetest Agent.
1. Start the Python app, the OpenTelemetry Collector, and send the traces to the Tracetest Agent.
2. Start the Tracetest Agent.
3. Configure the tracing backend and create tests in your environment.
4. Run the tests.

Here's a sample of a failed test run, which happens if you use this selector and assertion pair.
The output of the test will look similar to this:

```bash
Configuring Tracetest
SUCCESS Successfully configured Tracetest CLI
Running Trace-Based Tests...
✔ RunGroup: #E1qhw_jIg (https://app.tracetest.io/organizations/xxx/environments/xxx/run/E1qhw_jIg)
Summary: 1 passed, 0 failed, 0 pending
✔ Python API (https://app.tracetest.io/organizations/xxx/environments/xxx/test/W656Q0c4g/run/2/test) - trace id: c0eaebfe3ab66360a98d5cd443760a3c
✔ It should return status 200.
```

Here's what that looks like in the WebUI.

Selector:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: running-tracetest-with-aws-x-ray-adot
title: Node.js with AWS X-Ray (Node.js SDK) and AWS Distro for OpenTelemetry
description: Quick start on how to configure a Node.js app with OpenTelemetry traces, AWS X-Ray as a trace data store, including AWS Distro for OpenTelemetry, and Tracetest for enhancing your E2E and integration tests with trace-based testing.
hide_table_of_contents: true
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
Expand Down Expand Up @@ -101,9 +101,7 @@ The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main

The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-amazon-x-ray-adot/docker-compose.yaml) also contains the Tracetest Agent and ADOT.

### Run Tracetest Tests

To execute the tests, run this command:
To run everything including Tracetest tests, run this command:

```bash
docker compose run tracetest-run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: running-tracetest-with-aws-x-ray-pokeshop
title: Pokeshop API with AWS X-Ray (Node.js SDK) and AWS Distro for OpenTelemetry
description: Quick start on how to configure the Pokeshop API Demo with OpenTelemetry traces, AWS X-Ray as a trace data store, and Tracetest for enhancing your E2E and integration tests with trace-based testing.
hide_table_of_contents: true
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
Expand Down Expand Up @@ -105,9 +105,7 @@ The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main

The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-amazon-x-ray-pokeshop/docker-compose.yaml) also contains the Tracetest Agent and ADOT.

### Run Tracetest Tests

To execute the tests, run this command:
To run everything including Tracetest tests, run this command:

```bash
docker compose run tracetest-run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: running-tracetest-with-aws-x-ray
title: Node.js and AWS X-Ray (Node.js SDK)
description: Quick start on how to configure a Node.js app with OpenTelemetry traces, AWS X-Ray as a trace data store, and Tracetest for enhancing your E2E and integration tests with trace-based testing.
hide_table_of_contents: true
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
Expand Down Expand Up @@ -97,9 +97,7 @@ The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main

The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-amazon-x-ray/docker-compose.yaml) also contains the Tracetest Agent and X-Ray Daemon.

### Run Tracetest Tests

To execute the tests, run this command:
To run everything including Tracetest tests, run this command:

```bash
docker compose run tracetest-run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: running-tracetest-with-azure-app-insights-collector
title: Node.js and Azure Application Insights with OpenTelemetry Collector
description: Quick start on how to configure a Node.js app with OpenTelemetry traces, Azure Application Insights as a trace data store, including the OpenTelemetry Collector, and Tracetest for enhancing your E2E and integration tests with trace-based testing.
hide_table_of_contents: true
hide_table_of_contents: false
keywords:
- tracetest
- trace-based testing
Expand Down Expand Up @@ -81,7 +81,7 @@ The `docker-compose.yaml` file in the root directory of the quick start runs the

## Configuring the Node.js App

The Node.js app is a simple Express app, contained in [the `app.js` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-azure-app-insights/src/app.js).
The Node.js app is a simple Express app, contained in [the `app.js` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-azure-app-insights-collector/src/app.js).

Configure the `.env` like shown below.

Expand Down Expand Up @@ -124,6 +124,20 @@ APP_INSIGHTS_INSTRUMENTATION_STRING="InstrumentationKey=14f0532a-aad4-4cb1-9bdb-

## Running the Tests

The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-azure-app-insights-collector/docker-compose.yaml) in the root directory contains the Node.js app, OpenTelemetry Collector and Tracetest Agent.

To run everything including Tracetest tests, run this command:

```bash
docker compose run tracetest-run
```

This will:
1. Start the Node.js app and send the traces to Azure App Insights.
2. Start the Tracetest Agent.
3. Configure the Azure App Insights tracing backend and create tests in your environment.
4. Run the tests.

### The Test File

Check out the `resources/test.yaml` file.
Expand All @@ -150,19 +164,6 @@ spec:
- attr:tracetest.span.duration < 500ms
```
To run the test, run this command in the terminal:
```bash
docker compose run tracetest-run
```

This will:

1. Start the Node.js app, the OpenTelemetry Collector and send the traces to both Azure App Insights and the Tracetest Agent.
2. Start the Tracetest Agent.
3. Configure the tracing backend and create tests in your environment.
4. Run the tests.

## Learn More
Please visit our [examples in GitHub](https://github.com/kubeshop/tracetest/tree/main/examples) and join our [Slack Community](https://dub.sh/tracetest-community) for more info!
Loading

0 comments on commit 9438f92

Please sign in to comment.