diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-datadog.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-datadog.mdx
index 52d2ce84cd..00e69865be 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-datadog.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-datadog.mdx
@@ -26,7 +26,33 @@ This is a simple sample app on how to configure the [OpenTelemetry Demo `v1.3.0`
## Prerequisites
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this sample app! Additionally, you will need a Datadog account and an API. Sign up to Datadog on their [homepage](https://www.datadoghq.com/) by clicking on `Get Started Free`.
+**Tracetest Account**:
+
+- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
+
+**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
+
+## Run This Quckstart Example
+
+The example below is provided as part of the Tracetest project. You can download and run the example by following these steps:
+
+Clone the Tracetest project and go to the example folder:
+
+```bash
+git clone https://github.com/kubeshop/tracetest
+cd tracetest/examples/tracetest-datadog
+```
+
+Follow these instructions to run the quick start:
+
+1. Copy the `.env.template` file to `.env`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Fill out the [DATADOG_API_KEY](https://www.datadoghq.com/) details by editing your `.env` file.
+4. Run `docker compose run tracetest-run`.
+5. Follow the links in the output to view the test results.
+
+Follow the sections below for a detailed breakdown of what the example you just ran did and how it works.
## Project Structure
@@ -36,16 +62,9 @@ The project is built with Docker Compose. It contains two distinct `docker-compo
The `docker-compose.yaml` file and `.env` file in the root directory are for the OpenTelemetry Demo.
-### 2. Tracetest
-
-The `docker-compose.yaml` file, `collector.config.yaml`, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the `tracetest` directory are for setting up Tracetest and the OpenTelemetry Collector.
-
-The `tracetest` directory is self-contained and will run all the prerequisites for enabling OpenTelemetry traces and trace-based testing with Tracetest, as well as routing all traces the OpenTelemetry Demo generates to Datadog.
-
### Docker Compose Network
-All `services` in the `docker-compose.yaml` are on the same network, defined by the `networks` section on each file, and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `collector.config.yaml` will map to the `tracetest` service, where port `4317` is the port where Tracetest accepts traces.
-
+All `services` in the `docker-compose.yaml` are on the same network, defined by the `networks` section on each file, and will be reachable by hostname from within other services. E.g. `tracetest-agent:4317` in the `collector.config.yaml` will map to the `tracetest-agent` service, where port `4317` is the port where Tracetest Agent accepts traces.
## OpenTelemetry Demo
@@ -63,153 +82,11 @@ docker compose up
This will start the OpenTelemetry Demo. Open up `http://localhost:8084` to make sure it's working. But, you're not sending the traces anywhere.
-Let's fix this by configuring Tracetest and the OpenTelemetry Collector to forward trace data to both Lightstep and Tracetest.
-
-## Tracetest
-
-The `docker-compose.yaml` in the `tracetest` directory is configured with three services.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running trace-based tests.
-- [**OpenTelemetry Collector**](https://opentelemetry.io/docs/collector/) - A vendor-agnostic implementation of how to receive, process and export telemetry data. To support sending traces to Datadog, we are using the [`contrib` version](https://github.com/open-telemetry/opentelemetry-collector-contrib), which contains vendor-related code.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3.9"
-
-networks:
- default:
- name: opentelemetry-demo
- driver: bridge
-
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- container_name: tracetest
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest-provision.yaml
- target: /app/provisioning.yaml
- command: --provisioning-file /app/provisioning.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- tt-postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- tt-postgres:
- image: postgres:14
- container_name: tt-postgres
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- container_name: otel-collector
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
-
-```
-
-Tracetest depends on both Postgres and the OpenTelemetry Collector. Both Tracetest and the OpenTelemetry Collector require config files to be loaded via a volume. The volumes are mapped from the root directory into the `tracetest` directory and the respective config files.
-
-To start both the OpenTelemetry Demo and Tracetest we will run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance and telemetry exporter. The exporter is set to the OpenTelemetry Collector.
-
-```yaml
-# tracetest-config.yaml
-
----
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
-```
-
-The `tracetest-provision.yaml` file contains the setup of the demo APIs that Tracetest can use as an example for tests, the polling profiles that say how Tracetest should fetch traces from the data store and the configuration for the data store, in our case, Datadog.
-
-```yaml
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://frontend:8084
- productCatalogEndpoint: productcatalogservice:3550
- cartEndpoint: cartservice:7070
- checkoutEndpoint: checkoutservice:5050
-
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 180s
-
----
-type: DataStore
-spec:
- name: datadog
- type: datadog
-
-```
+Let's fix this by configuring Tracetest and the OpenTelemetry Collector to forward trace data to both Datadog and Tracetest.
**Sending Traces to Tracetest and Datadog**
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's OTLP endpoint `tracetest:4317` in one pipeline, and to Datadog in another.
+The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's Agent OTLP endpoint `tracetest-agent:4317` in one pipeline, and to Datadog in another.
Make sure to add your Datadog API Key to the `datadog` exporter.
@@ -219,6 +96,35 @@ receivers:
protocols:
http:
grpc:
+ # The hostmetrics receiver is required to get correct infrastructure metrics in Datadog.
+ hostmetrics:
+ collection_interval: 10s
+ scrapers:
+ paging:
+ metrics:
+ system.paging.utilization:
+ enabled: true
+ cpu:
+ metrics:
+ system.cpu.utilization:
+ enabled: true
+ disk:
+ filesystem:
+ metrics:
+ system.filesystem.utilization:
+ enabled: true
+ load:
+ memory:
+ network:
+ processes:
+ # The prometheus receiver scrapes metrics needed for the OpenTelemetry Collector Dashboard.
+ prometheus:
+ config:
+ scrape_configs:
+ - job_name: 'otelcol'
+ scrape_interval: 10s
+ static_configs:
+ - targets: ['0.0.0.0:8888']
processors:
batch: # this configuration is needed to guarantee that the data is sent correctly to Datadog
@@ -229,18 +135,16 @@ processors:
exporters:
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317
- # Send traces to Tracetest.
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# Datadog exporter
+ # One example on how to set up a collector configuration for Datadog can be seen here:
+ # https://docs.datadoghq.com/opentelemetry/otel_collector_datadog_exporter/?tab=onahost
datadog:
api:
site: datadoghq.com
- key: ${DATADOG_API_KEY} # Add here you API key for Datadog
- # One example on how to set up a collector configuration for Datadog can be seen here:
- # https://docs.datadoghq.com/opentelemetry/otel_collector_datadog_exporter/?tab=onahost
+ key: ${env:DATADOG_API_KEY} # Add here you API key for Datadog
service:
pipelines:
@@ -252,52 +156,20 @@ service:
receivers: [otlp]
processors: [batch]
exporters: [datadog]
+ metrics:
+ receivers: [hostmetrics, otlp]
+ processors: [batch]
+ exporters: [datadog]
```
-## Run Both the OpenTelemetry Demo App and Tracetest
-
-To start both OpenTelemetry and Tracetest, run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up
-```
-
-This will start your Tracetest instance on `http://localhost:11633/`.
-
-Open the URL and [start creating tests in the Web UI](https://docs.tracetest.io/web-ui/creating-tests)! Make sure to use the endpoints within your Docker network like `http://frontend:8084/` when creating tests.
-
-This is because your OpenTelemetry Demo and Tracetest are in the same network.
-
-> Note: View the `demo` section in the `tracetest.config.yaml` to see which endpoints from the OpenTelemetry Demo are available for running tests.
-
-Here's a sample of a failed test run, which happens if you add this assertion:
-
-```css
-attr:tracetest.span.duration < 10ms
-```
-
-![](../img/datadog-recipe-failed-test.png)
-
-Increasing the duration to a more reasonable `500ms` will make the test pass.
-
-![](../img/datadog-recipe-successful-test.png)
+## Running the Tests
-## Run Tracetest Tests with the Tracetest CLI
+### The Test File
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
-
-```bash
-tracetest configure --server-url http://localhost:11633
-```
-
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `http-test.yaml` file.
+Check out the `resources/test.yaml` file.
```yaml
-# http-test.yaml
-
+# resources/test.yaml
type: Test
spec:
id: JBYAfKJ4R
@@ -325,32 +197,28 @@ spec:
- attr:rpc.grpc.status_code = 0
```
-This file defines a test the same way you would through the Web UI.
-
To run the test, run this command in the terminal:
```bash
-tracetest run test -f ./http-test.yaml
+docker compose run tracetest-run
```
-This test will fail just like the sample above due to the `attr:tracetest.span.duration < 10ms` assertion.
+This test will fail just like the sample above due to the `attr:tracetest.span.duration < 50ms` assertion.
```bash
-✘ OpenTelemetry Shop - List Products (http://localhost:11633/test/JBYAfKJ4R/run/3/test)
- ✘ span[tracetest.span.type="general" name="Tracetest trigger"]
- ✘ #2d1b0dcbd75b3a42
- ✔ attr:tracetest.response.status = 200 (200)
- ✘ attr:tracetest.span.duration < 10ms (24ms) (http://localhost:11633/test/JBYAfKJ4R/run/3/test?selectedAssertion=0&selectedSpan=2d1b0dcbd75b3a42)
- ✔ span[tracetest.span.type="rpc" name="grpc.hipstershop.ProductCatalogService/ListProducts"]
- ✔ #90aeab1e9db4617b
- ✔ attr:rpc.grpc.status_code = 0 (http://localhost:11633/test/JBYAfKJ4R/run/3/test?selectedAssertion=1)
- ✔ span[tracetest.span.type="rpc" name="hipstershop.ProductCatalogService/ListProducts" rpc.system="grpc" rpc.method="ListProducts" rpc.service="hipstershop.ProductCatalogService"]
- ✔ #44b836b092b4d708
- ✔ attr:rpc.grpc.status_code = 0 (http://localhost:11633/test/JBYAfKJ4R/run/3/test?selectedAssertion=2)
+✘ Otel - List Products (http://localhost:11633/test/YJmFC7hVg/run/9/test)
+ ✘ span[tracetest.span.type="http" name="API HTTP GET" http.target="/api/products" http.method="GET"]
+ ✘ #cb68ccf586956db7
+ ✔ attr:http.status_code = 200 (200)
+ ✘ attr:tracetest.span.duration < 50ms (72ms) (http://localhost:11633/test/YJmFC7hVg/run/9/test?selectedAssertion=0&selectedSpan=cb68ccf586956db7)
+ ✔ span[tracetest.span.type="rpc" name="grpc.hipstershop.ProductCatalogService/ListProducts"]
+ ✔ #634f965d1b34c1fd
+ ✔ attr:rpc.grpc.status_code = 0 (0)
+ ✔ span[tracetest.span.type="rpc" name="hipstershop.ProductCatalogService/ListProducts" rpc.system="grpc" rpc.method="ListProducts" rpc.service="hipstershop.ProductCatalogService"]
+ ✔ #33a58e95448d8b22
+ ✔ attr:rpc.grpc.status_code = 0 (0)
```
-If you edit the duration as in the Web UI example above, the test will pass!
-
## View Trace Spans Over Time in Datadog
To access a historical overview of all the trace spans the OpenTelemetry Demo generates, jump over to your Datadog account on `APM > Traces` area.
diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-dynatrace.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-dynatrace.mdx
index b482d3c7ac..f2d05d7379 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-dynatrace.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-dynatrace.mdx
@@ -26,7 +26,33 @@ This is a simple sample app on how to configure the [OpenTelemetry Demo `v1.3.0`
## Prerequisites
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this sample app! Additionally, you will need a Dynatrace account and an API token. Sign up for a [free Dynatrace trial](https://www.dynatrace.com/trial).
+**Tracetest Account**:
+
+- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
+
+**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
+
+## Run This Quckstart Example
+
+The example below is provided as part of the Tracetest project. You can download and run the example by following these steps:
+
+Clone the Tracetest project and go to the example folder:
+
+```bash
+git clone https://github.com/kubeshop/tracetest
+cd tracetest/examples/tracetest-dynatrace
+```
+
+Follow these instructions to run the quick start:
+
+1. Copy the `.env.template` file to `.env`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Fill out the [DYNATRACE_SECRET](https://www.dynatrace.com/) details by editing your `.env` file.
+4. Run `docker compose run tracetest-run`.
+5. Follow the links in the output to view the test results.
+
+Follow the sections below for a detailed breakdown of what the example you just ran did and how it works.
## Project Structure
@@ -40,11 +66,9 @@ The `docker-compose.yaml` file and `.env` file in the root directory are for the
The `docker-compose.yaml` file, `collector.config.yaml`, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the `tracetest` directory are for setting up Tracetest and the OpenTelemetry Collector.
-The `tracetest` directory is self-contained and will run all the prerequisites for enabling OpenTelemetry traces and trace-based testing with Tracetest, as well as routing all traces the OpenTelemetry Demo generates to Dynatrace.
-
### Docker Compose Network
-All `services` in the `docker-compose.yaml` are on the same network, defined by the `networks` section on each file, and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `collector.config.yaml` will map to the `tracetest` service, where port `4317` is the port where Tracetest accepts traces.
+All `services` in the `docker-compose.yaml` are on the same network, defined by the `networks` section on each file, and will be reachable by hostname from within other services. E.g. `tracetest-agent:4317` in the `collector.config.yaml` will map to the `tracetest-agent` service, where port `4317` is the port where Tracetest Agent accepts traces.
## OpenTelemetry Demo
@@ -64,159 +88,9 @@ This will start the OpenTelemetry Demo. Open up `http://localhost:8084` to make
Let's fix this by configuring Tracetest and the OpenTelemetry Collector to forward trace data to both Dynatrace and Tracetest.
-## Tracetest
-
-The `docker-compose.yaml` in the `tracetest` directory is configured with three services.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running trace-based tests.
-- [**OpenTelemetry Collector**](https://opentelemetry.io/docs/collector/) - A vendor-agnostic implementation of how to receive, process and export telemetry data. To support sending traces to Dynatrace, we are using the [`contrib` version](https://github.com/open-telemetry/opentelemetry-collector-contrib), which contains vendor-related code.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3.9"
-
-networks:
- default:
- name: opentelemetry-demo
- driver: bridge
-
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- container_name: tracetest
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provisioning.yaml
- command: --provisioning-file /app/provisioning.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- tt-postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- tt-postgres:
- image: postgres:14
- container_name: tt-postgres
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.82.0
- container_name: otel-collector
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
-```
-
-Tracetest depends on both Postgres and the OpenTelemetry Collector. Both Tracetest and the OpenTelemetry Collector require config files to be loaded via a volume. The volumes are mapped from the root directory into the `tracetest` directory and the respective config files.
-
-To start both the OpenTelemetry Demo and Tracetest we will run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance and telemetry exporter. The exporter is set to the OpenTelemetry Collector.
-
-```yaml
-# tracetest-config.yaml
-
----
-postgres:
- host: tt-postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
-```
-
-The `tracetest-provision.yaml` file contains the setup of the demo APIs that Tracetest can use as an example for tests, the polling profiles that say how Tracetest should fetch traces from the data store and the configuration for the data store, in our case, Dynatrace.
-
-```yaml
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://frontend:8084
- productCatalogEndpoint: productcatalogservice:3550
- cartEndpoint: cartservice:7070
- checkoutEndpoint: checkoutservice:5050
-
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 10m
-
----
-type: DataStore
-spec:
- name: Dynatrace
- type: dynatrace
-
----
-type: TestRunner
-spec:
- id: current
- name: default
- requiredGates:
- - analyzer-score
- - test-specs
-
-```
-
### Sending Traces to Tracetest and Dynatrace
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's OTLP endpoint `tracetest:4317` in one pipeline, and to Dynatrace in another.
+The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest Agent's OTLP endpoint `tracetest-agent:4317` in one pipeline, and to Dynatrace in another.
Make sure to add your Dynatrace API Key to the `otlp` exporter (needs the `openTelemetryTrace.ingest` permission).
@@ -264,15 +138,14 @@ processors:
exporters:
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest.
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# OTLP for Dynatrace
otlphttp/dynatrace:
endpoint: https://abc12345.live.dynatrace.com/api/v2/otlp
headers:
- Authorization: "Api-Token dt0c01.sample.secret" # Requires "openTelemetryTrace.ingest" permission
+ Authorization: "Api-Token ${DYNATRACE_SECRET}" # Requires "openTelemetryTrace.ingest" permission
service:
pipelines:
@@ -290,54 +163,14 @@ service:
exporters: [otlphttp/dynatrace]
```
-## Run Both the OpenTelemetry Demo App and Tracetest
-
-To start both OpenTelemetry and Tracetest, run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up
-```
-
-:::note Heads up!
-Please note starting the demo for the first time will take a few minutes.
-:::
-
-This will start your Tracetest instance on `http://localhost:11633/`.
-
-Open the URL and [start creating tests in the Web UI](https://docs.tracetest.io/web-ui/creating-tests)! Make sure to use the endpoints within your Docker network like `http://frontend:8084/` when creating tests.
-
-This is because your OpenTelemetry Demo and Tracetest are in the same network.
-
-> Note: View the `demo` section in the `tracetest.config.yaml` to see which endpoints from the OpenTelemetry Demo are available for running tests.
-
-Here's a sample of a failed test run, which happens if you add this assertion:
-
-```css
-attr:tracetest.span.duration < 10ms
-```
-
-![](../img/dynatrace-failed-test.png)
-
-Increasing the duration to a more reasonable `500ms` will make the test pass.
+## Running the Tests
-![](../img/dynatrace-successful-test.png)
+### The Test File
-## Run Tracetest Tests with the Tracetest CLI
-
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
-
-```bash
-tracetest configure --server-url http://localhost:11633
-```
-
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `http-test.yaml` file.
+Check out the `resources/test.yaml` file.
```yaml
-# http-test.yaml
-
+# resources/test.yaml
type: Test
spec:
id: JBYAfKJ4R
@@ -365,12 +198,10 @@ spec:
- attr:rpc.grpc.status_code = 0
```
-This file defines a test the same way you would through the Web UI.
-
To run the test, run this command in the terminal:
```bash
-tracetest run test -f ./http-test.yaml
+docker compose run tracetest-run
```
This test will fail just like the sample above due to the `attr:tracetest.span.duration < 10ms` assertion.
diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-honeycomb.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-honeycomb.mdx
index 27079de3d5..706792ffee 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-honeycomb.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-honeycomb.mdx
@@ -18,10 +18,6 @@ keywords:
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import CodeBlock from '@theme/CodeBlock';
-
:::note
[Check out the source code on GitHub here.](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-honeycomb)
:::
@@ -34,19 +30,12 @@ import CodeBlock from '@theme/CodeBlock';
This is a quick start on how to configure a Node.js app to use OpenTelemetry instrumentation with traces, and Tracetest for enhancing your E2E and integration tests with trace-based testing and Honeycomb as a trace data store.
-```mdx-code-block
-
-
-```
-
## Prerequisites
**Tracetest Account**:
- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
-- Create an [environment](/concepts/environments).
-- Create an [environment token](/concepts/environment-tokens).
-- Have access to the environment's [agent API key](/configuration/agent).
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
@@ -64,11 +53,10 @@ cd tracetest/examples/tracetest-honeycomb
Follow these instructions to run the quick start:
1. Copy the `.env.template` file to `.env`.
-2. Log into the [Tracetest app](https://app.tracetest.io/).
-3. This example is configured to use the Honeycomb Tracing Backend. Ensure the environment you will be utilizing to run this example is also configured to use the Honeycomb Tracing Backend by clicking on Settings, Tracing Backend, Honeycomb, Save.
-4. Fill out the [token](https://docs.tracetest.io/concepts/environment-tokens) and [API key](https://docs.tracetest.io/concepts/agent) details by editing your `.env` file. You can find these values in the Settings area for your environment.
-5. Run `docker compose -f ./docker-compose.agent.yaml up -d`.
-6. Run tests from the Tracetest Web UI by accessing the app with the URL `http://app:8080/`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Fill out the [HONEYCOMB_API_KEY](https://www.honeycomb.io/) details by editing your `.env` file.
+4. Run `docker compose run tracetest-run`.
+5. Follow the links in the output to view the test results.
Follow along with the sections below for a detailed breakdown of what the example you just ran did and how it works.
@@ -85,7 +73,11 @@ The Node.js app is a simple Express app, contained in the `app.js` file.
Configure the `.env` like shown below.
```bash
-TRACETEST_API_KEY=""
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
HONEYCOMB_API_KEY=""
```
@@ -101,380 +93,19 @@ Enabling the tracer is done by preloading the trace file. As seen in the `packag
},
```
-## Configuring Honeycomb
-
-Configure [Honeycomb as a Tracing Backend](/configuration/connecting-to-data-stores/honeycomb) in Tracetest.
-
-```yaml title="tracetest-tracing-backend.yaml"
----
-type: DataStore
-spec:
- name: Honeycomb
- type: honeycomb
- default: true
-```
-
-```bash
-tracetest config -t
-tracetest apply datastore -f ./tracetest-tracing-backend.yaml
-```
-
-## Run the Node.js App, OpenTelemetry Collector, and Tracetest Agent with Docker Compose
-
-To start the full setup, run the following command:
-
-```bash
-docker compose -f ./docker-compose.agent.yaml up -d
-```
-
-## Run Tracetest Tests
+### Run Tracetest Tests
-1. Open [Tracetest](https://app.tracetest.io/).
-2. [Configure Honeycomb as a tracing backend](/configuration/connecting-to-data-stores/honeycomb) if you have not already as explained above.
-3. Start creating tests! Make sure to use the `http://app:8080/` URL in your test creation.
-4. To trigger tests in the CLI, first [install the CLI](/cli/cli-installation-reference), [configure it](/cli/configuring-your-cli), and [run a test](/cli/running-tests). From the root of the quick start directory, run:
+To execute the tests, run this command:
```bash
-tracetest configure -t
-tracetest run test -f ./test-api.yaml
-```
-
-```mdx-code-block
-
-
+docker compose run tracetest-run
```
-## Prerequisites
-
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this sample app! Additionally, you will need a Honeycomb account and api key. Sign up to use Honeycomb [here](https://ui.honeycomb.io/signup).
-
-## Project Structure
-
-The project is built with Docker Compose. It contains two distinct `docker-compose.yaml` files.
-
-### 1. Node.js App
-
-The `docker-compose.yaml` file and `Dockerfile` in the root directory are for the Node.js app.
-
-### 2. Tracetest
-
-The `docker-compose.yaml` file, `collector.config.yaml`, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the root directory are for the setting up Tracetest and the OpenTelemetry Collector.
-
-The `root` directory is self-contained and will run all the prerequisites for enabling OpenTelemetry traces and trace-based testing with Tracetest, as well as routing all traces the Node.js App generates to Honeycomb.
-
-### Docker Compose Network
-
-All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `collector.config.yaml` will map to the `tracetest` service, where the port `4317` is the port where Tracetest accepts traces.
-
-## Node.js App
-
-The Node.js app is a simple Express app contained in the `app.js` file.
-
-The OpenTelemetry tracing is contained in the `tracing.otel.grpc.js` or `tracing.otel.http.js` files.
-Traces will be sent to the OpenTelemetry Collector.
-
-Here's the content of the `tracing.otel.grpc.js` file:
-
-```js
-const opentelemetry = require("@opentelemetry/sdk-node");
-const {
- getNodeAutoInstrumentations,
-} = require("@opentelemetry/auto-instrumentations-node");
-const {
- OTLPTraceExporter,
-} = require("@opentelemetry/exporter-trace-otlp-grpc");
-
-const sdk = new opentelemetry.NodeSDK({
- traceExporter: new OTLPTraceExporter({ url: "http://otel-collector:4317" }),
- instrumentations: [getNodeAutoInstrumentations()],
-});
-sdk.start();
-```
-
-Depending on which of these you choose, traces will be sent to either the `grpc` or `http` endpoint.
-
-The hostnames and ports for these are:
-
-- GRPC: `http://otel-collector:4317`
-- HTTP: `http://otel-collector:4318/v1/traces`
-
-Enabling the tracer is done by preloading the trace file.
-
-```bash
-node -r ./tracing.otel.grpc.js app.js
-```
-
-In the `package.json` you will see two npm scripts for running the respective tracers alongside the `app.js`.
-
-```json
-"scripts": {
- "with-grpc-tracer":"node -r ./tracing.otel.grpc.js app.js",
- "with-http-tracer":"node -r ./tracing.otel.http.js app.js"
-},
-```
-
-To start the server, run this command:
-
-```bash
-npm run with-grpc-tracer
-# or
-npm run with-http-tracer
-```
-
-As you can see the `Dockerfile` uses the command above.
-
-```Dockerfile
-FROM node:slim
-WORKDIR /usr/src/app
-COPY package*.json ./
-RUN npm install
-COPY . .
-EXPOSE 8080
-CMD [ "npm", "run", "with-grpc-tracer" ]
-```
-
-And, the `docker-compose.yaml` contains just one service for the Node.js app.
-
-```yaml
-version: "3"
-services:
- app:
- image: quick-start-nodejs
- build: .
- ports:
- - "8080:8080"
-```
-
-To start it, run this command:
-
-```bash
-docker compose build # optional if you haven't already built the image
-docker compose up
-```
-
-This will start the Node.js app. But, you're not sending the traces anywhere.
-
-Let's fix this by configuring Tracetest and OpenTelemetry Collector.
-
-## Tracetest
-
-The `docker-compose.yaml` in the `tracetest` directory is configured with three services.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running the trace-based tests.
-- [**OpenTelemetry Collector**](https://opentelemetry.io/docs/collector/) - A vendor-agnostic implementation of how to receive, process and export telemetry data.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3.2"
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
-
-```
-
-Tracetest depends on both Postgres and the OpenTelemetry Collector. Both Tracetest and the OpenTelemetry Collector require config files to be loaded via a volume. The volumes are mapped from the root directory into the `tracetest` directory and the respective config files.
-
-To start both the Node.js App and Tracetest, run this command:
-
-```bash
-docker-compose up # add --build if the images are not built already
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance.
-
-```yaml
-# tracetest-config.yaml
-
----
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-```
-
-The `tracetest-provision.yaml` file contains the data store setup. The data store is set to `Honeycomb` meaning the traces will be received by Tracetest OTLP API and stored in Tracetest itself.
-
-```yaml
-# tracetest-provision.yaml
----
-type: DataStore
-spec:
- name: Honeycomb
- type: honeycomb
-```
-
-**How to Send Traces to Tracetest and Honeycomb**
-
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's OTLP endpoint `tracetest:4317` in one pipeline, and to Honeycomb in another.
-
-Make sure to add your Honeycomb access token in the headers of the `otlp/ls` exporter.
-
-```yaml
-receivers:
- otlp:
- protocols:
- grpc:
- http:
-
-processors:
- batch:
- timeout: 100ms
-
-exporters:
- logging:
- logLevel: debug
- # OTLP for Tracetest
- otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
- tls:
- insecure: true
- # OTLP for Honeycomb
- otlp/honeycomb:
- endpoint: "api.honeycomb.io:443"
- headers:
- "x-honeycomb-team":
- # Read more in docs here: https://docs.honeycomb.io/getting-data-in/otel-collector/
-
-service:
- pipelines:
- traces/tracetest:
- receivers: [otlp]
- processors: [batch]
- exporters: [otlp/tracetest]
- traces/honeycomb:
- receivers: [otlp]
- processors: [batch]
- exporters: [logging, otlp/honeycomb]
-```
-
-## Run Both the Node.js App and Tracetest
-
-To start both the Node.js App and Tracetest, run this command:
-
-```bash
-docker-compose up # add --build if the images are not built already
-```
-
-This will start your Tracetest instance on `http://localhost:11633/`.
-
-Open the URL and start creating tests! Make sure to use the `http://app:8080/` URL in your test creation, because your Node.js app and Tracetest are in the same network.
-
-## Run Tracetest Tests with the Tracetest CLI
-
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
-
-```bash
-tracetest configure --server-url http://localhost:11633
-```
-
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `test-api.yaml` file.
-
-```yaml
-# test-api.yaml
-
-type: Test
-spec:
- id: W656Q0c4g
- name: http://app:8080
- description: akadlkasjdf
- trigger:
- type: http
- httpRequest:
- url: http://app:8080
- method: GET
- headers:
- - key: Content-Type
- value: application/json
- specs:
- - selector: span[tracetest.span.type="http" name="GET /" http.target="/" http.method="GET"]
- assertions:
- - attr:http.status_code = 200
- - attr:tracetest.span.duration < 500ms
-
-```
-
-This file defines a test the same way you would through the Web UI.
-
-To run the test, run this command in the terminal:
-
-```bash
-tracetest run test -f ./test-api.yaml
-```
-
-```bash
-✔ http://app:8080 (http://localhost:11633/test/W656Q0c4g/run/2/test)
- ✔ span[tracetest.span.type="http" name="GET /" http.target="/" http.method="GET"]
-```
-
-## View Trace Spans Over Time in Honeycomb
-
-To access a historical overview of all the trace spans the Node.js App generates, jump over to your Honeycomb account.
-
-![Honeycomb trace overview](https://res.cloudinary.com/djwdcmwdz/image/upload/v1683042900/Blogposts/Docs/honeycomb_trace_kbjdl4.png)
-
-You can also drill down into a particular trace.
-
-![Honeycomb trace drilldown](https://res.cloudinary.com/djwdcmwdz/image/upload/v1683042900/Blogposts/Docs/honeycome_dashboard_gyisdg.png)
-
-With Honeycomb and Tracetest, you get the best of both worlds. You can run trace-based tests and automate running E2E and integration tests against real trace data. And, use Honeycomb to get a historical overview of all traces your distributed application generates.
-
-```mdx-code-block
-
-
-```
+This will:
+1. Start the Node.js app, the OpenTelemetry Collector, and send the traces to Honeycomb.
+2. Start the Tracetest Agent.
+3. Configure the tracing backend and create tests in your environment.
+4. Run the tests.
## Learn More
diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-lightstep.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-lightstep.mdx
index 612bf455a8..eea18d3587 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-lightstep.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-lightstep.mdx
@@ -26,7 +26,33 @@ This is a simple sample app on how to configure the [OpenTelemetry Demo `v0.3.4-
## Prerequisites
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this sample app! Additionally, you will need a Lightstep account and access token. Sign up to use Lightstep [here](https://app.lightstep.com/signup/developer).
+**Tracetest Account**:
+
+- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
+
+**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
+
+## Run This Quckstart Example
+
+The example below is provided as part of the Tracetest project. You can download and run the example by following these steps:
+
+Clone the Tracetest project and go to the example folder:
+
+```bash
+git clone https://github.com/kubeshop/tracetest
+cd tracetest/examples/tracetest-lightstep
+```
+
+Follow these instructions to run the quick start:
+
+1. Copy the `.env.template` file to `.env`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Fill out the [LIGHTSTEP_ACCESS_TOKEN](https://docs.lightstep.com/otel/otel-quick-start) details by editing your `.env` file.
+4. Run `docker compose run tracetest-run`.
+5. Follow the links in the output to view the test results.
+
+Follow the sections below for a detailed breakdown of what the example you just ran did and how it works.
## Project Structure
@@ -36,15 +62,9 @@ The project is built with Docker Compose. It contains two distinct `docker-compo
The `docker-compose.yaml` file and `.env` file in the root directory are for the OpenTelemetry Demo.
-### 2. Tracetest
-
-The `docker-compose.yaml` file, `collector.config.yaml`, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the `tracetest` directory are for the setting up Tracetest and the OpenTelemetry Collector.
-
-The `tracetest` directory is self-contained and will run all the prerequisites for enabling OpenTelemetry traces and trace-based testing with Tracetest, as well as routing all traces the OpenTelemetry Demo generates to Lightstep.
-
### Docker Compose Network
-All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `collector.config.yaml` will map to the `tracetest` service, where the port `4317` is the port where Tracetest accepts traces.
+All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest-agent:4317` in the `collector.config.yaml` will map to the `tracetest-agent` service, where the port `4317` is the port where Tracetest accepts traces.
## OpenTelemetry Demo
@@ -65,134 +85,9 @@ This will start the OpenTelemetry Demo. Open up `http://localhost:8084` to make
Let's fix this by configuring Tracetest and OpenTelemetry Collector to forward trace data to both Lightstep and Tracetest.
-## Tracetest
-
-The `docker-compose.yaml` in the `tracetest` directory is configured with three services.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running the trace-based tests.
-- [**OpenTelemetry Collector**](https://opentelemetry.io/docs/collector/) - A vendor-agnostic implementation of how to receive, process and export telemetry data.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3.2"
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
-
-```
-
-Tracetest depends on both Postgres and the OpenTelemetry Collector. Both Tracetest and the OpenTelemetry Collector require config files to be loaded via a volume. The volumes are mapped from the root directory into the `tracetest` directory and the respective config files.
-
-To start both the OpenTelemetry Demo and Tracetest, run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up # add --build if the images are not built already
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance and defining the exporter. The exporter is set to the OpenTelemetry Collector.
-
-```yaml
-# tracetest-config.yaml
-
----
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
-
-```
-
-The `tracetest-provision.yaml` file contains the data store setup. The data store is set to `lightstep` meaning the traces will be received by Tracetest OTLP API and stored in Tracetest itself.
-
-```yaml
-# tracetest-provision.yaml
----
-type: DataStore
-spec:
- name: Lightstep
- type: lightstep
-
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://otel-frontend:8084
- productCatalogEndpoint: otel-productcatalogservice:3550
- cartEndpoint: otel-cartservice:7070
- checkoutEndpoint: otel-checkoutservice:5050
-
-```
-
**How to Send Traces to Tracetest and Lightstep**
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's OTLP endpoint `tracetest:4317` in one pipeline, and to Lightstep in another.
+The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest Agent's OTLP endpoint `tracetest-agent:4317` in one pipeline, and to Lightstep in another.
Make sure to add your Lightstep access token in the headers of the `otlp/lightstep` exporter.
@@ -208,18 +103,16 @@ processors:
timeout: 100ms
exporters:
- logging:
- logLevel: debug
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# OTLP for Lightstep
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
- "lightstep-access-token": "" # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start
+ "lightstep-access-token": ${env:LIGHTSTEP_ACCESS_TOKEN} # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start
service:
pipelines:
@@ -230,52 +123,17 @@ service:
traces/lightstep:
receivers: [otlp]
processors: [batch]
- exporters: [logging, otlp/lightstep]
-```
-
-## Run Both the OpenTelemetry Demo App and Tracetest
-
-To start both the OpenTelemetry and Tracetest, run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up # add --build if the images are not built already
+ exporters: [otlp/lightstep]
```
-This will start your Tracetest instance on `http://localhost:11633/`.
+## Running the Tests
-Open the URL and [start creating tests in the Web UI](https://docs.tracetest.io/web-ui/creating-tests)! Make sure to use the endpoints within your Docker network like `http://otel-frontend:8084/` when creating tests.
+### The Test File
-This is because your OpenTelemetry Demo and Tracetest are in the same network.
-
-> Note: View the `demo` section in the `tracetest.config.yaml` to see which endpoints from the OpenTelemetry Demo are available for running tests.
-
-Here's a sample of a failed test run, which happens if you add this assertion:
-
-```css
-attr:tracetest.span.duration < 50ms
-```
-
-![failing test](https://res.cloudinary.com/djwdcmwdz/image/upload/v1672998179/Blogposts/tracetest-lightstep-partnership/screely-1672998159326_depw45.png)
-
-Increasing the duration to a more reasonable `500ms` will make the test pass.
-
-![passing test](https://res.cloudinary.com/djwdcmwdz/image/upload/v1672998252/Blogposts/tracetest-lightstep-partnership/screely-1672998249450_mngghb.png)
-
-## Run Tracetest Tests with the Tracetest CLI
-
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
-
-```bash
-tracetest configure --server-url http://localhost:11633
-```
-
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `http-test.yaml` file.
+Check out the `resources/test.yaml` file.
```yaml
-# http-test.yaml
+# resources/test.yaml
type: Test
spec:
@@ -307,12 +165,10 @@ spec:
- attr:rpc.grpc.status_code = 0
```
-This file defines the a test the same way you would through the Web UI.
-
To run the test, run this command in the terminal:
```bash
-tracetest run test -f ./http-test.yaml
+docker compose run tracetest-run
```
This test will fail just like the sample above due to the `attr:tracetest.span.duration < 50ms` assertion.
diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-new-relic.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-new-relic.mdx
index 59d7cdb194..3933183635 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-new-relic.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-new-relic.mdx
@@ -26,7 +26,33 @@ This is a simple sample app on how to configure the [OpenTelemetry Demo `v0.3.4-
## Prerequisites
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this sample app! Additionally, you will need a New Relic account and ingest licence key. Sign up to New Relic [here](https://newrelic.com/signup).
+**Tracetest Account**:
+
+- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
+
+**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
+
+## Run This Quckstart Example
+
+The example below is provided as part of the Tracetest project. You can download and run the example by following these steps:
+
+Clone the Tracetest project and go to the example folder:
+
+```bash
+git clone https://github.com/kubeshop/tracetest
+cd tracetest/examples/tracetest-new-relic
+```
+
+Follow these instructions to run the quick start:
+
+1. Copy the `.env.template` file to `.env`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Fill out the [NEW_RELIC_INGEST_LICENSE](https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-setup/#collector-export) details by editing your `.env` file.
+4. Run `docker compose run tracetest-run`.
+5. Follow the links in the output to view the test results.
+
+Follow the sections below for a detailed breakdown of what the example you just ran did and how it works.
## Project Structure
@@ -36,15 +62,9 @@ The project is built with Docker Compose. It contains two distinct `docker-compo
The `docker-compose.yaml` file and `.env` file in the root directory are for the OpenTelemetry Demo.
-### 2. Tracetest
-
-The `docker-compose.yaml` file, `collector.config.yaml`, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the `tracetest` directory are for the setting up Tracetest and the OpenTelemetry Collector.
-
-The `tracetest` directory is self-contained and will run all the prerequisites for enabling OpenTelemetry traces and trace-based testing with Tracetest, as well as routing all traces the OpenTelemetry Demo generates to New Relic.
-
### Docker Compose Network
-All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `collector.config.yaml` will map to the `tracetest` service, where the port `4317` is the port where Tracetest accepts traces.
+All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest-agent:4317` in the `collector.config.yaml` will map to the `tracetest-agent` service, where the port `4317` is the port where Tracetest Agent accepts traces.
## OpenTelemetry Demo
@@ -65,143 +85,10 @@ This will start the OpenTelemetry Demo. Open up `http://localhost:8084` to make
Let's fix this by configuring Tracetest and OpenTelemetry Collector to forward trace data to both New Relic and Tracetest.
-## Tracetest
-
-The `docker-compose.yaml` in the `tracetest` directory is configured with three services.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running the trace-based tests.
-- [**OpenTelemetry Collector**](https://opentelemetry.io/docs/collector/) - A vendor-agnostic implementation of how to receive, process and export telemetry data.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3.2"
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
-```
-
-Tracetest depends on both Postgres and the OpenTelemetry Collector. Both Tracetest and the OpenTelemetry Collector require config files to be loaded via a volume. The volumes are mapped from the root directory into the `tracetest` directory and the respective config files.
-
-To start both the OpenTelemetry Demo and Tracetest, run this command:
-
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up # add --build if the images are not built already
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance, and defining the exporter. The exporter is set to the OpenTelemetry Collector.
-
-```yaml
-# tracetest-config.yaml
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
-```
-
-The `tracetest-provision.yaml` file contains the data store setup. The data store is set to `newrelic` meaning the traces will be received by Tracetest OTLP API and stored in Tracetest itself.
-
-```yaml
-# tracetest-provision.yaml
----
-type: DataStore
-spec:
- name: New Relic
- type: newrelic
- default: true
-
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://otel-frontend:8084
- productCatalogEndpoint: otel-productcatalogservice:3550
- cartEndpoint: otel-cartservice:7070
- checkoutEndpoint: otel-checkoutservice:5050
-```
-
-**How to Send Traces to Tracetest and New Relic**
-
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tracetest's OTLP endpoint `tracetest:4317` in one pipeline, and to New Relic in another.
-
-Make sure to add your New Relic ingest licence key in the headers of the `otlp/newrelic` exporter.
-You access the licence key in your New Relic account settings.
-
-![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1673009509/Blogposts/tracetest-new-relic-partnerships/screely-1673009504630_gko3up.png)
-
-You can find which ingest endpoint to use in the New Relic docs, [here](https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-setup/#review-settings).
-
Here's how to configure the OpenTelemetry Collector.
```yaml
# collector.config.yaml
-
receivers:
otlp:
protocols:
@@ -213,18 +100,16 @@ processors:
timeout: 100ms
exporters:
- logging:
- logLevel: debug
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
tls:
insecure: true
# OTLP for New Relic
otlp/newrelic:
endpoint: otlp.nr-data.net:443
headers:
- "api-key": "" # Send traces to New Relic.
+ api-key: ${NEW_RELIC_INGEST_LICENSE} # Send traces to New Relic.
# Read more in docs here: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-setup/#collector-export
# And here: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/collector/opentelemetry-collector-basic/
@@ -237,55 +122,60 @@ service:
traces/newrelic:
receivers: [otlp]
processors: [batch]
- exporters: [logging, otlp/newrelic]
+ exporters: [otlp/newrelic]
```
-**Important!** Take a closer look at the sampling configs in both the `collector.config.yaml` and `tracetest.config.yaml`. They both set sampling to 100%. This is crucial when running trace-based e2e and integration tests.
+**Important!** Take a closer look at the sampling configs in both the `collector.config.yaml`. It has set sampling to 100%. This is crucial when running trace-based e2e and integration tests.
-## Run both the OpenTelemetry Demo app and Tracetest
+## Running the Tests
-To start both the OpenTelemetry and Tracetest we will run this command:
+### The Test File
-```bash
-docker-compose -f docker-compose.yaml -f tracetest/docker-compose.yaml up # add --build if the images are not built already
-```
-
-This will start your Tracetest instance on `http://localhost:11633/`.
-
-Open the URL and [start creating tests in the Web UI](https://docs.tracetest.io/web-ui/creating-tests)! Make sure to use the endpoints within your Docker network like `http://otel-frontend:8084/` when creating tests.
-
-This is because your OpenTelemetry Demo and Tracetest are in the same network.
-
-> Note: View the `demo` section in the `tracetest.config.yaml` to see which endpoints from the OpenTelemetry Demo are available for running tests.
+Check out the `resources/test.yaml` file.
-Here's a sample of a failed test run, which happens if you add this assertion:
+```yaml
+# resources/test.yaml
+type: Test
+spec:
+ id: YJmFC7hVg
+ name: Otel - List Products
+ description: Otel - List Products
+ trigger:
+ type: http
+ httpRequest:
+ url: http://otel-frontend:8084/api/products
+ method: GET
+ headers:
+ - key: Content-Type
+ value: application/json
+ specs:
+ - selector:
+ span[tracetest.span.type="http" name="API HTTP GET" http.target="/api/products"
+ http.method="GET"]
+ assertions:
+ - attr:http.status_code = 200
+ - attr:tracetest.span.duration < 50ms
+ - selector: span[tracetest.span.type="rpc" name="grpc.hipstershop.ProductCatalogService/ListProducts"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - selector:
+ span[tracetest.span.type="rpc" name="hipstershop.ProductCatalogService/ListProducts"
+ rpc.system="grpc" rpc.method="ListProducts" rpc.service="hipstershop.ProductCatalogService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
```
-attr:tracetest.span.duration < 50ms
-```
-
-![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1672998179/Blogposts/tracetest-lightstep-partnership/screely-1672998159326_depw45.png)
-
-Increasing the duration to a more reasonable `500ms` will make the test pass.
-![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1672998252/Blogposts/tracetest-lightstep-partnership/screely-1672998249450_mngghb.png)
-
-## Run Tracetest Tests with the Tracetest CLI
-
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
+To run the test, run this command in the terminal:
```bash
-tracetest configure --server-url http://localhost:11633
+docker compose run tracetest-run
```
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `http-test.yaml` file.
+Check out the `test.yaml` file.
```yaml
-# http-test.yaml
-
+# resurces/test.yaml
type: Test
spec:
id: YJmFC7hVg
@@ -321,7 +211,7 @@ This file defines the a test the same way you would through the Web UI.
To run the test, run this command in the terminal:
```bash
-tracetest run test -f ./http-test.yaml
+docker compose run tracetest-run
```
This test will fail just like the sample above due to the `attr:tracetest.span.duration < 50ms` assertion.
diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-signoz-pokeshop.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-signoz-pokeshop.mdx
index babca441d2..df229355ef 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-signoz-pokeshop.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-signoz-pokeshop.mdx
@@ -16,10 +16,6 @@ keywords:
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import CodeBlock from '@theme/CodeBlock';
-
:::note
[Check out the source code on GitHub here.](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-signoz-pokeshop)
:::
@@ -34,19 +30,13 @@ import CodeBlock from '@theme/CodeBlock';
This is a simple quick start guide on how to configure a fully instrumented API to be used with Tracetest for enhancing your E2E and integration tests with trace-based testing. The infrastructure will use SigNoz as the trace data store and the Pokeshop API to generate the telemetry data.
-```mdx-code-block
-
-
-```
## Prerequisites
**Tracetest Account**:
- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
-- Create an [environment](/concepts/environments).
-- Create an [environment token](/concepts/environment-tokens).
-- Have access to the environment's [agent API key](/configuration/agent).
+- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).
**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
@@ -64,11 +54,9 @@ cd tracetest/examples/tracetest-signoz-pokeshop
Follow these instructions to run the quick start:
1. Copy the `.env.template` file to `.env`.
-2. Log into the [Tracetest app](https://app.tracetest.io/).
-3. Fill out the [token](https://docs.tracetest.io/concepts/environment-tokens) and [API key](https://docs.tracetest.io/concepts/agent) details by editing your `.env` file. You can find these values in the Settings area for your environment.
-4. Run `docker compose -f ./docker-compose.agent.yaml up -d`.
-5. This example is configured to use the SigNoz Tracing Backend. Ensure the environment you're using to run this example is configured to use the SigNoz Tracing Backend by clicking on Settings, Tracing Backend, SigNoz, Save. Or, use the CLI as explained below.
-6. Run tests from the Tracetest Web UI by accessing the app with the URL `http://demo-api:8081/pokemon/import`.
+2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
+3. Run `docker compose run tracetest-run`.
+4. Follow the links in the output to view the test results.
Follow along with the sections below for an in detail breakdown of what the example you just ran did and how it works.
@@ -89,8 +77,10 @@ This is a [fragment from the main tracing file](https://github.com/kubeshop/poke
Configure the `.env` like shown below.
```bash
-TRACETEST_API_KEY=""
-TRACETEST_API_TOKEN=""
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
```
## Configuring SigNoz
@@ -110,663 +100,19 @@ tracetest config -t
tracetest apply datastore -f ./tracetest/tracetest-tracing-backend.yaml
```
-## Run the Pokeshop Demo App, SigNoz, and Tracetest Agent with Docker Compose
-
-The [`docker-compose.agent.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-signoz-pokeshop/docker-compose.agent.yaml) in the root directory contains the Pokeshop Demo app services.
-
-The [`docker-compose.agent.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/tracetest-signoz-pokeshop/docker-compose.agent.yaml) also contains the Tracetest Agent, OpenTelemetry Collector and all SigNoz services.
-
-To start it, run this command:
-
-```bash
-docker compose -f ./docker-compose.agent.yaml up -d
-```
-
-This will start the Pokeshop Demo app, SigNoz, OpenTelemetry Collector, and Tracetest Agent.
-
-## Run Tracetest Tests
+### Run Tracetest Tests
-1. Open [Tracetest](https://app.tracetest.io/)
-2. [Configure SigNoz as a tracing backend](/configuration/connecting-to-data-stores/signoz) if you have not already as explained above.
-3. Start creating tests! Make sure to use the `http://demo-api:8081/pokemon/import` URL in your test creation.
-4. To trigger tests in the CLI, first [install the CLI](/cli/cli-installation-reference), [configure it](/cli/configuring-your-cli), and [run a test](/cli/running-tests). From the root of the quick start directory, run:
+To execute the tests, run this command:
```bash
-tracetest configure -t
-tracetest run test -f ./tests/test.yaml
-```
-
-```mdx-code-block
-
-
-```
-
-## Prerequisites
-
-You will need [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine to run this quick start app!
-
-## Project Structure
-
-The project is built with Docker Compose.
-
-### 1. Tracetest
-
-The `collector.config.yaml` file, `tracetest-provision.yaml`, and `tracetest-config.yaml` in the `tracetest` directory are for the configuring Tracetest and it's OpenTelemetry Collector.
-
-### 2. SigNoz
-
-The `signoz` directory contains all files required to configure SigNoz.
-
-### Docker Compose Network
-
-All `services` in the `docker-compose.yaml` are on the same network and will be reachable by hostname from within other services. E.g. `tracetest:4317` in the `tracetest/collector.config.yaml` will map to the `tracetest` service, where the port `4317` is the port where Tracetest accepts telemetry data.
-
-## Pokeshop API
-
-The Pokeshop API is a fully instrumented REST API that makes use of different services to mimic a real life scenario.
-
-It is instrumented using the [OpenTelemetry standards for Node.js](https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/), sending the data to the ADOT collector that will be pushing the telemetry information to both the AWS X-Ray service.
-
-This is a fragment from the main tracing file from the [Pokeshop API repo.](https://github.com/kubeshop/pokeshop)
-
-```typescript
-import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
-import * as opentelemetry from '@opentelemetry/api';
-import { api, NodeSDK } from '@opentelemetry/sdk-node';
-import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
-import { Resource } from '@opentelemetry/resources';
-import * as dotenv from 'dotenv';
-import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
-import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
-import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
-import { AmqplibInstrumentation } from '@opentelemetry/instrumentation-amqplib';
-import { SpanStatusCode } from '@opentelemetry/api';
-import { B3Propagator } from '@opentelemetry/propagator-b3';
-
-dotenv.config();
-api.propagation.setGlobalPropagator(new B3Propagator());
-
-const { COLLECTOR_ENDPOINT = '', SERVICE_NAME = 'pokeshop' } = process.env;
-
-let globalTracer: opentelemetry.Tracer | null = null;
-
-async function createTracer(): Promise {
- const collectorExporter = new OTLPTraceExporter({
- url: COLLECTOR_ENDPOINT,
- });
-
- const spanProcessor = new BatchSpanProcessor(collectorExporter);
- const sdk = new NodeSDK({
- traceExporter: collectorExporter,
- // @ts-ignore
- instrumentations: [new IORedisInstrumentation(), new PgInstrumentation(), new AmqplibInstrumentation()],
- });
-
- sdk.configureTracerProvider({}, spanProcessor);
- sdk.addResource(
- new Resource({
- [SemanticResourceAttributes.SERVICE_NAME]: SERVICE_NAME,
- })
- );
-
- await sdk.start();
- process.on('SIGTERM', () => {
- sdk
- .shutdown()
- .then(
- () => console.log('SDK shut down successfully'),
- err => console.log('Error shutting down SDK', err)
- )
- .finally(() => process.exit(0));
- });
-
- const tracer = opentelemetry.trace.getTracer(SERVICE_NAME);
-
- globalTracer = tracer;
-
- return globalTracer;
-}
-```
-
-The `docker-compose.yaml` file includes the definitions for all of the required services by the Pokeshop API, which includes:
-
-- **Postgres** - To save Pokemon information.
-- **Redis** - For in memory strage.
-- **RabbitMQ** - For async processing use cases.
-- **API** - The Pokeshop API main container.
-- **Worker** - The Pokeshop worker instance.
-
-```yaml
-version: "3"
-
-#...
-
-services:
- #...
-
- # Demo
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
- ports:
- - 5432:5432
-
- demo-cache:
- image: redis:6
- restart: unless-stopped
- healthcheck:
- test: ["CMD", "redis-cli", "ping"]
- interval: 1s
- timeout: 3s
- retries: 60
-
- demo-queue:
- image: rabbitmq:3.8-management
- restart: unless-stopped
- healthcheck:
- test: rabbitmq-diagnostics -q check_running
- interval: 1s
- timeout: 5s
- retries: 60
-
- demo-api:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: api
- ports:
- - "8081:8081"
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:8081"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
-
- demo-worker:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: worker
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
-
- demo-rpc:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: rpc
- ports:
- - 8082:8082
- healthcheck:
- test: ["CMD", "lsof", "-i", "8082"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
- # Demo End
-```
-
-## Tracetest
-
-The `docker-compose.yaml` includes two services related to Tracetest. The Tracetest instance also connects to the `postgres` service.
-
-- **Postgres** - Postgres is a prerequisite for Tracetest to work. It stores trace data when running the trace-based tests.
-- [**OpenTelemetry Collector**)](https://opentelemetry.io/docs/collector/getting-started/) - Vendor-agnostic way to receive, process and export telemetry data.
-- [**Tracetest**](https://tracetest.io/) - Trace-based testing that generates end-to-end tests automatically from traces.
-
-```yaml
-version: "3"
-
-# ...
-services:
-
- # ...
-
- # Tracetest
- tracetest:
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- healthcheck:
- test: [ "CMD", "wget", "--spider", "localhost:11633" ]
- interval: 1s
- timeout: 3s
- retries: 60
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- otel-collector:
- image: otel/opentelemetry-collector:0.54.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
- ports:
- - 4317:4317
- depends_on:
- signoz-otel-collector:
- condition: service_started
- signoz-otel-collector-metrics:
- condition: service_started
- # Tracetest End
+docker compose run tracetest-run
```
-Tracetest depends on Postgres and the OpenTelemetry Collector. Tracetest requires config files to be loaded via a volume. The volumes are mapped from the `tracetest` directory into the `root` directory of the Tracetest container instance and the respective config files.
-
-The `collector.config.yaml` file contains the OpenTelemetry Collector configuration that enables routing traces from the Pokeshop API to both Tracetest and SigNoz.
-
-```yaml
-# collector.config.yaml
-
-receivers:
- otlp:
- protocols:
- grpc:
- http:
-
-processors:
- batch:
- timeout: 100ms
-
- # Data sources: traces
- probabilistic_sampler:
- hash_seed: 22
- sampling_percentage: 100
-
-exporters:
- # OTLP for Tracetest
- otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest.
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
- tls:
- insecure: true
- # OTLP for Signoz
- otlp/signoz:
- endpoint: signoz-otel-collector:4317
- tls:
- insecure: true
-
-service:
- pipelines:
- traces:
- receivers: [otlp]
- processors: [probabilistic_sampler, batch]
- exporters: [otlp/signoz,otlp/tracetest]
-```
-
-The `tracetest-config.yaml` file contains the basic setup of connecting Tracetest to the Postgres instance. It also enables forwarding Tracetest's internal telemetry to SigNoz as well, with the `telemetry` and `server` config.
-
-```yaml
-# tracetest-config.yaml
-
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100 # 100%
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
-
-```
-
-The `tracetest-provision.yaml` file defines the trace data store, set to SigNoz, meaning the traces will be forwarded via the OpenTelemetry Collector to both Tracetest when running tests and SigNoz where they are stored.
-
-```yaml
-# tracetest-provision.yaml
-
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 10m
-
----
-type: DataStore
-spec:
- name: Signoz
- type: signoz
-
----
-type: TestRunner
-spec:
- id: current
- name: default
- requiredGates:
- - analyzer-score
- - test-specs
-
----
-type: Demo
-spec:
- type: pokeshop
- enabled: true
- name: pokeshop
- opentelemetryStore: {}
- pokeshop:
- httpEndpoint: http://demo-api:8081
- grpcEndpoint: demo-rpc:8082
-```
-
-How do traces reach SigNoz?
-
-The Pokeshop API code uses the native Node.js OpenTelemetry modules which send information to the OpenTelemetry Collector to be processed and then sent to the internal SigNoz OpenTelemetry Collector.
-
-## SigNoz
-
-The `docker-compose.yaml` includes 7 services related to SigNoz.
-
-- [**Zookeeper**](https://zookeeper.apache.org/) - ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
-- [**ClickHouse**](https://clickhouse.com/) - ClickHouse is the fastest and most resource efficient open-source database for real-time apps and analytics.
-- [**SigNoz - Alert Manager**](https://github.com/SigNoz/alertmanager) - The `Alertmanager` handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct receiver integrations such as email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts.
-- [**SigNoz - Query Service**](https://github.com/SigNoz/signoz/tree/develop/pkg/query-service) - Handles querying for data.
-- [**SigNoz - Front end**](https://github.com/SigNoz/signoz/tree/develop/frontend) - The SigNoz front-end app.
-- [**SigNoz - OpenTelemetry Collector**)](https://opentelemetry.io/docs/collector/getting-started/) - Vendor-agnostic way to receive, process and export telemetry data.
-- [**SigNoz - OpenTelemetry Collector Metrics**)](https://opentelemetry.io/docs/collector/getting-started/) - Vendor-agnostic way to receive, process and export telemetry data. This service is dedicated to metrics.
-
-```yaml
-version: "3"
-
-# ...
-services:
-
- # ...
-
- # SigNoz
- zookeeper-1:
- image: bitnami/zookeeper:3.7.1
- container_name: zookeeper-1
- hostname: zookeeper-1
- user: root
- volumes:
- - ./signoz/data/zookeeper-1:/bitnami/zookeeper
- environment:
- - ZOO_SERVER_ID=1
- - ALLOW_ANONYMOUS_LOGIN=yes
- - ZOO_AUTOPURGE_INTERVAL=1
-
- clickhouse:
- restart: on-failure
- image: clickhouse/clickhouse-server:22.8.8-alpine
- tty: true
- depends_on:
- - zookeeper-1
- logging:
- options:
- max-size: 50m
- max-file: "3"
- healthcheck:
- test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
- interval: 30s
- timeout: 5s
- retries: 3
- ulimits:
- nproc: 65535
- nofile:
- soft: 262144
- hard: 262144
- container_name: clickhouse
- hostname: clickhouse
- volumes:
- - ./signoz/clickhouse-config.xml:/etc/clickhouse-server/config.xml
- - ./signoz/clickhouse-users.xml:/etc/clickhouse-server/users.xml
- - ./signoz/custom-function.xml:/etc/clickhouse-server/custom-function.xml
- - ./signoz/clickhouse-cluster.xml:/etc/clickhouse-server/config.d/cluster.xml
- - ./signoz/data/clickhouse/:/var/lib/clickhouse/
- - ./signoz/user_scripts:/var/lib/clickhouse/user_scripts/
-
- alertmanager:
- image: signoz/alertmanager:${ALERTMANAGER_TAG:-0.23.1}
- volumes:
- - ./signoz/data/alertmanager:/data
- depends_on:
- query-service:
- condition: service_healthy
- restart: on-failure
- command:
- - --queryService.url=http://query-service:8085
- - --storage.path=/data
-
- query-service:
- image: signoz/query-service:${DOCKER_TAG:-0.22.0}
- command: ["-config=/root/config/prometheus.yml"]
- volumes:
- - ./signoz/prometheus.yml:/root/config/prometheus.yml
- - ./signoz/data/signoz/:/var/lib/signoz/
- environment:
- - ClickHouseUrl=tcp://clickhouse:9000/?database=signoz_traces
- - ALERTMANAGER_API_PREFIX=http://alertmanager:9093/api/
- - SIGNOZ_LOCAL_DB_PATH=/var/lib/signoz/signoz.db
- - DASHBOARDS_PATH=/root/config/dashboards
- - STORAGE=clickhouse
- - GODEBUG=netdns=go
- - TELEMETRY_ENABLED=true
- - DEPLOYMENT_TYPE=docker-standalone-amd
- restart: on-failure
- healthcheck:
- test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/health"]
- interval: 30s
- timeout: 5s
- retries: 3
- depends_on:
- clickhouse:
- condition: service_healthy
-
- frontend:
- image: signoz/frontend:${DOCKER_TAG:-0.22.0}
- restart: on-failure
- depends_on:
- - alertmanager
- - query-service
- ports:
- - 3301:3301
- volumes:
- - ./signoz/common/nginx-config.conf:/etc/nginx/conf.d/default.conf
-
- signoz-otel-collector:
- image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.79.2}
- command: ["--config=/etc/otel-collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
- user: root # required for reading docker container logs
- volumes:
- - ./signoz/otel-collector-config.yaml:/etc/otel-collector-config.yaml
- - /var/lib/docker/containers:/var/lib/docker/containers:ro
- environment:
- - OTEL_RESOURCE_ATTRIBUTES=host.name=signoz-host,os.type=linux
- - DOCKER_MULTI_NODE_CLUSTER=false
- - LOW_CARDINAL_EXCEPTION_GROUPING=false
- restart: on-failure
- depends_on:
- clickhouse:
- condition: service_healthy
-
- signoz-otel-collector-metrics:
- image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.79.2}
- command: ["--config=/etc/otel-collector-metrics-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
- volumes:
- - ./signoz/otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml
- restart: on-failure
- depends_on:
- clickhouse:
- condition: service_healthy
- # SigNoz End
-```
-
-SigNoz depends on ClickHouse and Zookeeper. The SigNoz services require config files to be loaded via volumes. The volumes are mapped from the `signoz` directory.
-
-## Run the Pokeshop API, SigNoz and Tracetest
-
-To start all the services, run this command:
-
-```bash
-docker-compose up
-```
-
-This will start your Tracetest instance on `http://localhost:11633/`. Open it and start creating tests!
-
-Make sure to use the `http://demo-api:8081/` URL in your test creation, because your Pokeshop API and Tracetest are in the same network.
-
-## Run Tracetest Tests with the Tracetest CLI
-
-First, [install the CLI](https://docs.tracetest.io/getting-started/installation#install-the-tracetest-cli).
-Then, configure the CLI:
-
-```bash
-tracetest configure --server-url http://localhost:11633
-```
-
-Once configured, you can run a test against the Tracetest instance via the terminal.
-
-Check out the `tests/test.yaml` file.
-
-```yaml
-# tests/test.yaml
-
-type: Test
-spec:
- id: ZVJwkpC4g
- name: Pokeshop - Import
- description: Import a Pokemon
- trigger:
- type: http
- httpRequest:
- method: POST
- url: http://demo-api:8081/pokemon/import
- body: '{"id":6}'
- headers:
- - key: Content-Type
- value: application/json
- specs:
- - selector: span[tracetest.span.type="http"]
- name: "All HTTP Spans: Status code is 200"
- assertions:
- - attr:http.status_code = 200
- - selector: span[tracetest.span.type="general" name="import pokemon"]
- name: Validate that this span always exists after the message queue
- assertions:
- - attr:tracetest.selected_spans.count = 1
- - attr:span.events not-contains "exception"
- - selector: span[tracetest.span.type="database" name="get pokemon_6" db.system="redis" db.operation="get" db.redis.database_index="0"]
- name: Validate that Redis is using Charizard.
- assertions:
- - attr:db.payload = '{"key":"pokemon_6"}'
- - selector: span[tracetest.span.type="database" name="create postgres.pokemon" db.system="postgres" db.name="postgres" db.user="postgres" db.operation="create" db.sql.table="pokemon"]
- name: Validate that the Postgres has Charizard.
- assertions:
- - attr:db.result contains "charizard"
-```
-
-This file defines a test the same way you would through the Web UI.
-
-To run the test, run this command in the terminal:
-
-```bash
-tracetest run test -f ./tests/test.yaml
-```
-
-```bash title="Output:"
-✔ Pokeshop - Import (http://localhost:11633/test/ZVJwkpC4g/run/1/test) - trace id: 4eff1e124f67cf7a802b3c4fc51c19d4
- ✔ All HTTP Spans: Status code is 200
- ✔ Validate that this span always exists after the message queue
- ✔ Validate that Redis is using Charizard.
- ✔ Validate that the Postgres has Charizard.
-```
-
-![tracetest web ui overview](https://res.cloudinary.com/djwdcmwdz/image/upload/v1692356467/Blogposts/Docs/screely-1692356427154_ewzduy.png)
-
-## View Trace Spans Over Time in SigNoz
-
-To access a historical overview of all the trace spans the Pokeshop App generates, jump over to SigNoz.
-
-![signoz trace overview](https://res.cloudinary.com/djwdcmwdz/image/upload/v1692364823/Blogposts/Docs/screely-1692364815231_birvhj.png)
-
-You can also drill down into a particular trace.
-
-![signoz trace drilldown](https://res.cloudinary.com/djwdcmwdz/image/upload/v1692364964/Blogposts/Docs/screely-1692364957669_te7pe2.png)
-
-With SigNoz and Tracetest, you get the best of both worlds. You can run trace-based tests and automate running E2E and integration tests against real trace data. And, use SigNoz to get a historical overview of all traces your distributed application generates.
-
-```mdx-code-block
-
-
-```
+This will:
+1. Start the Node.js app, the OpenTelemetry Collector, and send the traces to Signoz.
+2. Start the Tracetest Agent.
+3. Configure the tracing backend and create tests in your environment.
+4. Run the tests.
## Learn More
diff --git a/examples/quick-start-jaeger-nodejs/tracetest-tracing-backend.yaml b/examples/quick-start-jaeger-nodejs/tracetest-tracing-backend.yaml
deleted file mode 100644
index 1595add71d..0000000000
--- a/examples/quick-start-jaeger-nodejs/tracetest-tracing-backend.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-type: DataStore
-spec:
- id: current
- name: Jaeger
- type: jaeger
- default: true
- jaeger:
- endpoint: jaeger:16685
- tls:
- insecure: true
diff --git a/examples/tracetest-datadog/.env b/examples/tracetest-datadog/.env.template
similarity index 92%
rename from examples/tracetest-datadog/.env
rename to examples/tracetest-datadog/.env.template
index 3fd31c808e..3e1a3fa1f8 100644
--- a/examples/tracetest-datadog/.env
+++ b/examples/tracetest-datadog/.env.template
@@ -1,3 +1,10 @@
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
+DATADOG_API_KEY=""
+
# Images
IMAGE_VERSION=1.3.0
IMAGE_NAME=ghcr.io/open-telemetry/demo
diff --git a/examples/tracetest-datadog/.gitignore b/examples/tracetest-datadog/.gitignore
new file mode 100644
index 0000000000..4c49bd78f1
--- /dev/null
+++ b/examples/tracetest-datadog/.gitignore
@@ -0,0 +1 @@
+.env
diff --git a/examples/tracetest-datadog/Dockerfile.tracetest b/examples/tracetest-datadog/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-datadog/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-datadog/tracetest/collector.config.yaml b/examples/tracetest-datadog/collector.config.yaml
similarity index 86%
rename from examples/tracetest-datadog/tracetest/collector.config.yaml
rename to examples/tracetest-datadog/collector.config.yaml
index 89b2f78750..20130b49ac 100644
--- a/examples/tracetest-datadog/tracetest/collector.config.yaml
+++ b/examples/tracetest-datadog/collector.config.yaml
@@ -42,8 +42,7 @@ processors:
exporters:
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest.
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# Datadog exporter
@@ -52,7 +51,7 @@ exporters:
datadog:
api:
site: datadoghq.com
- key: ${DATADOG_API_KEY} # Add here you API key for Datadog
+ key: ${env:DATADOG_API_KEY} # Add here you API key for Datadog
service:
pipelines:
diff --git a/examples/tracetest-datadog/docker-compose.yaml b/examples/tracetest-datadog/docker-compose.yaml
index 1b3b4e9b62..5dd55b69c5 100644
--- a/examples/tracetest-datadog/docker-compose.yaml
+++ b/examples/tracetest-datadog/docker-compose.yaml
@@ -16,7 +16,7 @@
# to disable the metrics and rely on OTel collector container
# defined on ./tracetest/docker-compose.yaml
-version: '3.9'
+version: "3.9"
x-default-logging: &logging
driver: "json-file"
options:
@@ -29,6 +29,50 @@ networks:
driver: bridge
services:
+ # Cloud-based Managed Tracetest
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
+ environment:
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
+
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
+ depends_on:
+ frontend:
+ condition: service_healthy
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
+
# ******************
# Core Demo Services
# ******************
@@ -164,7 +208,7 @@ services:
environment:
- CURRENCY_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
+ - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
depends_on:
- otel-collector
logging: *logging
@@ -202,8 +246,8 @@ services:
memory: 200M
restart: unless-stopped
ports:
- - "${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
- - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
+ - "${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
+ - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
environment:
- FEATURE_FLAG_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_PORT
@@ -213,7 +257,8 @@ services:
- DATABASE_URL=ecto://ffs:ffs@ffs_postgres:5432/ffs
- FEATURE_FLAG_SERVICE_PATH_ROOT="/feature"
healthcheck:
- test: ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"]
+ test:
+ ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"]
depends_on:
ffs_postgres:
condition: service_healthy
@@ -281,6 +326,11 @@ services:
- recommendationservice
- shippingservice
logging: *logging
+ healthcheck:
+ test: ["CMD", "wget", "--spider", "localhost:8084"]
+ interval: 1s
+ timeout: 3s
+ retries: 60
# Payment service
paymentservice:
@@ -359,7 +409,7 @@ services:
deploy:
resources:
limits:
- memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
+ memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
restart: unless-stopped
ports:
- "${RECOMMENDATION_SERVICE_PORT}"
@@ -465,3 +515,15 @@ services:
ports:
- "${REDIS_PORT}"
logging: *logging
+
+ otel-collector:
+ image: otel/opentelemetry-collector-contrib:0.100.0
+ container_name: otel-collector
+ restart: unless-stopped
+ environment:
+ - DATADOG_API_KEY
+ command:
+ - "--config"
+ - "/otel-local-config.yaml"
+ volumes:
+ - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-datadog/resources/apply.sh b/examples/tracetest-datadog/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-datadog/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-datadog/resources/datastore.yaml b/examples/tracetest-datadog/resources/datastore.yaml
new file mode 100644
index 0000000000..cd9cf0dc4a
--- /dev/null
+++ b/examples/tracetest-datadog/resources/datastore.yaml
@@ -0,0 +1,5 @@
+type: DataStore
+spec:
+ id: current
+ name: datadog
+ type: datadog
diff --git a/examples/tracetest-datadog/resources/run.sh b/examples/tracetest-datadog/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-datadog/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-datadog/http-test.yaml b/examples/tracetest-datadog/resources/test.yaml
similarity index 100%
rename from examples/tracetest-datadog/http-test.yaml
rename to examples/tracetest-datadog/resources/test.yaml
diff --git a/examples/tracetest-datadog/tracetest/docker-compose.yaml b/examples/tracetest-datadog/tracetest/docker-compose.yaml
deleted file mode 100644
index f4a5153156..0000000000
--- a/examples/tracetest-datadog/tracetest/docker-compose.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-version: "3.9"
-
-networks:
- default:
- name: opentelemetry-demo
- driver: bridge
-
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- container_name: tracetest
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provisioning.yaml
- command: --provisioning-file /app/provisioning.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- tt-postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- tt-postgres:
- image: postgres:14
- container_name: tt-postgres
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- container_name: otel-collector
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-datadog/tracetest/tracetest-config.yaml b/examples/tracetest-datadog/tracetest/tracetest-config.yaml
deleted file mode 100644
index 3edb085fe2..0000000000
--- a/examples/tracetest-datadog/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-postgres:
- host: tt-postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-datadog/tracetest/tracetest-provision.yaml b/examples/tracetest-datadog/tracetest/tracetest-provision.yaml
deleted file mode 100644
index 4144adcdbe..0000000000
--- a/examples/tracetest-datadog/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://frontend:8084
- productCatalogEndpoint: productcatalogservice:3550
- cartEndpoint: cartservice:7070
- checkoutEndpoint: checkoutservice:5050
-
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 180s
-
----
-type: DataStore
-spec:
- name: datadog
- type: datadog
diff --git a/examples/tracetest-dynatrace/.env b/examples/tracetest-dynatrace/.env.template
similarity index 92%
rename from examples/tracetest-dynatrace/.env
rename to examples/tracetest-dynatrace/.env.template
index 3fd31c808e..53e73a3657 100644
--- a/examples/tracetest-dynatrace/.env
+++ b/examples/tracetest-dynatrace/.env.template
@@ -1,3 +1,9 @@
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN="MCiA34CIR"
+TRACETEST_ENVIRONMENT_ID="ttenv_b42fa137465c6e04"
+DYNATRACE_SECRET=""
+
# Images
IMAGE_VERSION=1.3.0
IMAGE_NAME=ghcr.io/open-telemetry/demo
diff --git a/examples/tracetest-dynatrace/.gitignore b/examples/tracetest-dynatrace/.gitignore
new file mode 100644
index 0000000000..4c49bd78f1
--- /dev/null
+++ b/examples/tracetest-dynatrace/.gitignore
@@ -0,0 +1 @@
+.env
diff --git a/examples/tracetest-dynatrace/Dockerfile.tracetest b/examples/tracetest-dynatrace/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-dynatrace/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-dynatrace/tracetest/collector.config.yaml b/examples/tracetest-dynatrace/collector.config.yaml
similarity index 82%
rename from examples/tracetest-dynatrace/tracetest/collector.config.yaml
rename to examples/tracetest-dynatrace/collector.config.yaml
index d41e40b9cd..e4ee4490b0 100644
--- a/examples/tracetest-dynatrace/tracetest/collector.config.yaml
+++ b/examples/tracetest-dynatrace/collector.config.yaml
@@ -41,15 +41,14 @@ processors:
exporters:
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest.
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# OTLP for Dynatrace
otlphttp/dynatrace:
endpoint: https://abc12345.live.dynatrace.com/api/v2/otlp
headers:
- Authorization: "Api-Token dt0c01.sample.secret" # Requires "openTelemetryTrace.ingest" permission
+ Authorization: "Api-Token ${DYNATRACE_SECRET}" # Requires "openTelemetryTrace.ingest" permission
service:
pipelines:
diff --git a/examples/tracetest-dynatrace/docker-compose.yaml b/examples/tracetest-dynatrace/docker-compose.yaml
index f0961154e2..6a40d96780 100644
--- a/examples/tracetest-dynatrace/docker-compose.yaml
+++ b/examples/tracetest-dynatrace/docker-compose.yaml
@@ -16,7 +16,7 @@
# to disable the metrics and rely on OTel collector container
# defined on ./tracetest/docker-compose.yaml
-version: '3.9'
+version: "3.9"
x-default-logging: &logging
driver: "json-file"
options:
@@ -29,6 +29,50 @@ networks:
driver: bridge
services:
+ # Cloud-based Managed Tracetest
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
+ environment:
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
+
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
+ depends_on:
+ frontend:
+ condition: service_healthy
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
+
# ******************
# Core Demo Services
# ******************
@@ -164,7 +208,7 @@ services:
environment:
- CURRENCY_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
+ - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
depends_on:
- otel-collector
logging: *logging
@@ -202,8 +246,8 @@ services:
memory: 200M
restart: unless-stopped
ports:
- - "${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
- - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
+ - "${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
+ - "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
environment:
- FEATURE_FLAG_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_PORT
@@ -213,7 +257,8 @@ services:
- DATABASE_URL=ecto://ffs:ffs@ffs_postgres:5432/ffs
- FEATURE_FLAG_SERVICE_PATH_ROOT="/feature"
healthcheck:
- test: ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"]
+ test:
+ ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"]
depends_on:
ffs_postgres:
condition: service_healthy
@@ -281,6 +326,11 @@ services:
- recommendationservice
- shippingservice
logging: *logging
+ healthcheck:
+ test: ["CMD", "wget", "--spider", "localhost:8084"]
+ interval: 1s
+ timeout: 3s
+ retries: 60
# Payment service
paymentservice:
@@ -290,7 +340,7 @@ services:
deploy:
resources:
limits:
- memory: 200M
+ memory: 70M
restart: unless-stopped
ports:
- "${PAYMENT_SERVICE_PORT}"
@@ -359,7 +409,7 @@ services:
deploy:
resources:
limits:
- memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
+ memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
restart: unless-stopped
ports:
- "${RECOMMENDATION_SERVICE_PORT}"
@@ -450,7 +500,7 @@ services:
start_period: 10s
interval: 5s
timeout: 10s
- retries: 10000
+ retries: 10
# Redis used by Cart service
redis-cart:
@@ -465,3 +515,15 @@ services:
ports:
- "${REDIS_PORT}"
logging: *logging
+
+ otel-collector:
+ image: otel/opentelemetry-collector-contrib:0.100.0
+ container_name: otel-collector
+ restart: unless-stopped
+ environment:
+ - DYNATRACE_SECRET
+ command:
+ - "--config"
+ - "/otel-local-config.yaml"
+ volumes:
+ - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-dynatrace/resources/apply.sh b/examples/tracetest-dynatrace/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-dynatrace/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-dynatrace/resources/datastore.yaml b/examples/tracetest-dynatrace/resources/datastore.yaml
new file mode 100644
index 0000000000..a05f4656d2
--- /dev/null
+++ b/examples/tracetest-dynatrace/resources/datastore.yaml
@@ -0,0 +1,5 @@
+type: DataStore
+spec:
+ id: current
+ name: Dynatrace
+ type: dynatrace
diff --git a/examples/tracetest-dynatrace/resources/run.sh b/examples/tracetest-dynatrace/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-dynatrace/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-dynatrace/http-test.yaml b/examples/tracetest-dynatrace/resources/test.yaml
similarity index 100%
rename from examples/tracetest-dynatrace/http-test.yaml
rename to examples/tracetest-dynatrace/resources/test.yaml
diff --git a/examples/tracetest-dynatrace/tracetest/docker-compose.yaml b/examples/tracetest-dynatrace/tracetest/docker-compose.yaml
deleted file mode 100644
index 45bfc78e09..0000000000
--- a/examples/tracetest-dynatrace/tracetest/docker-compose.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-version: "3.9"
-
-networks:
- default:
- name: opentelemetry-demo
- driver: bridge
-
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- container_name: tracetest
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provisioning.yaml
- command: --provisioning-file /app/provisioning.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- tt-postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- tt-postgres:
- image: postgres:14
- container_name: tt-postgres
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.82.0
- container_name: otel-collector
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-dynatrace/tracetest/tracetest-config.yaml b/examples/tracetest-dynatrace/tracetest/tracetest-config.yaml
deleted file mode 100644
index 3edb085fe2..0000000000
--- a/examples/tracetest-dynatrace/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-postgres:
- host: tt-postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-dynatrace/tracetest/tracetest-provision.yaml b/examples/tracetest-dynatrace/tracetest/tracetest-provision.yaml
deleted file mode 100644
index a8c140c85a..0000000000
--- a/examples/tracetest-dynatrace/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://frontend:8084
- productCatalogEndpoint: productcatalogservice:3550
- cartEndpoint: cartservice:7070
- checkoutEndpoint: checkoutservice:5050
-
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 10m
-
----
-type: DataStore
-spec:
- name: Dynatrace
- type: dynatrace
-
----
-type: TestRunner
-spec:
- id: current
- name: default
- requiredGates:
- - analyzer-score
- - test-specs
diff --git a/examples/tracetest-honeycomb/.env.template b/examples/tracetest-honeycomb/.env.template
index aeeabffc65..2d069de446 100644
--- a/examples/tracetest-honeycomb/.env.template
+++ b/examples/tracetest-honeycomb/.env.template
@@ -1,3 +1,6 @@
-TRACETEST_API_KEY=""
-TRACETEST_API_TOKEN=""
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
HONEYCOMB_API_KEY=""
diff --git a/examples/tracetest-honeycomb/Dockerfile.tracetest b/examples/tracetest-honeycomb/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-honeycomb/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-honeycomb/collector.config.yaml b/examples/tracetest-honeycomb/collector.config.yaml
index ba0ef5970a..72055a43c3 100644
--- a/examples/tracetest-honeycomb/collector.config.yaml
+++ b/examples/tracetest-honeycomb/collector.config.yaml
@@ -12,13 +12,6 @@ exporters:
logging:
loglevel: debug
- # OTLP for Hobby Tracetest Core
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
- otlp/tracetest:
- endpoint: tracetest:4317
- tls:
- insecure: true
-
# Cloud-based Managed Tracetest
otlp/tracetest-agent:
endpoint: tracetest-agent:4317
@@ -29,7 +22,7 @@ exporters:
otlp/honeycomb:
endpoint: "api.honeycomb.io:443"
headers:
- "x-honeycomb-team": ${HONEYCOMB_API_KEY}
+ "x-honeycomb-team": ${env:HONEYCOMB_API_KEY}
# "x-honeycomb-dataset": "" # optional
# Read more in docs here: https://docs.honeycomb.io/getting-data-in/otel-collector/
@@ -38,7 +31,7 @@ service:
traces/tracetest:
receivers: [otlp]
processors: [batch]
- exporters: [otlp/tracetest, otlp/tracetest-agent]
+ exporters: [otlp/tracetest-agent]
traces/honeycomb:
receivers: [otlp]
processors: [batch]
diff --git a/examples/tracetest-honeycomb/docker-compose.agent.yaml b/examples/tracetest-honeycomb/docker-compose.agent.yaml
deleted file mode 100644
index 53a7d47a52..0000000000
--- a/examples/tracetest-honeycomb/docker-compose.agent.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-version: "3"
-services:
- app:
- image: quick-start-nodejs
- extra_hosts:
- - "host.docker.internal:host-gateway"
- build: .
- ports:
- - "8080:8080"
-
- # Cloud-based Managed Tracetest
- tracetest-agent:
- image: kubeshop/tracetest-agent:latest
- command:
- - "--mode=verbose"
- environment:
- # Find the Agent API Key here: https://docs.tracetest.io/configuration/agent
- - TRACETEST_API_KEY=${TRACETEST_API_KEY}
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.101.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-honeycomb/docker-compose.yaml b/examples/tracetest-honeycomb/docker-compose.yaml
index f0a998a174..ba54cdc7cc 100644
--- a/examples/tracetest-honeycomb/docker-compose.yaml
+++ b/examples/tracetest-honeycomb/docker-compose.yaml
@@ -7,49 +7,60 @@ services:
build: .
ports:
- "8080:8080"
- tracetest:
- image: kubeshop/tracetest:latest
- platform: linux/amd64
- volumes:
- - type: bind
- source: ./tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest-provision.yaml
- target: /app/provisioning.yaml
- ports:
- - 11633:11633
- command: --provisioning-file /app/provisioning.yaml
depends_on:
- postgres:
- condition: service_healthy
otel-collector:
condition: service_started
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
+
+ # Cloud-based Managed Tracetest
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
- postgres:
- image: postgres:14
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
- ports:
- - 5432:5432
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
+ depends_on:
+ app:
+ condition: service_started
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
otel-collector:
- image: otel/opentelemetry-collector-contrib:0.82.0
+ image: otel/opentelemetry-collector-contrib:0.101.0
command:
- "--config"
- "/otel-local-config.yaml"
+ environment:
+ - HONEYCOMB_API_KEY
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-honeycomb/resources/apply.sh b/examples/tracetest-honeycomb/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-honeycomb/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-honeycomb/tracetest-tracing-backend.yaml b/examples/tracetest-honeycomb/resources/datastore.yaml
similarity index 95%
rename from examples/tracetest-honeycomb/tracetest-tracing-backend.yaml
rename to examples/tracetest-honeycomb/resources/datastore.yaml
index 92ef90df7c..45da5dfcbc 100644
--- a/examples/tracetest-honeycomb/tracetest-tracing-backend.yaml
+++ b/examples/tracetest-honeycomb/resources/datastore.yaml
@@ -1,4 +1,3 @@
----
type: DataStore
spec:
id: current
diff --git a/examples/tracetest-honeycomb/resources/run.sh b/examples/tracetest-honeycomb/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-honeycomb/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-honeycomb/test-api.yaml b/examples/tracetest-honeycomb/resources/test.yaml
similarity index 100%
rename from examples/tracetest-honeycomb/test-api.yaml
rename to examples/tracetest-honeycomb/resources/test.yaml
diff --git a/examples/tracetest-honeycomb/tracetest-config.yaml b/examples/tracetest-honeycomb/tracetest-config.yaml
deleted file mode 100644
index 5f2c307848..0000000000
--- a/examples/tracetest-honeycomb/tracetest-config.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-# This section enables sending traces that the Tracetest
-# server generates into Honeycomb for a histogram overview.
-# View docs here: https://docs.tracetest.io/configuration/telemetry
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-honeycomb/tracetest-provision.yaml b/examples/tracetest-honeycomb/tracetest-provision.yaml
deleted file mode 100644
index 81dc652d04..0000000000
--- a/examples/tracetest-honeycomb/tracetest-provision.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 10m
-
----
-type: DataStore
-spec:
- name: Honeycomb
- type: honeycomb
- default: true
-
----
-type: TestRunner
-spec:
- id: current
- name: default
- requiredGates:
- - analyzer-score
- - test-specs
diff --git a/examples/tracetest-lightstep/.env b/examples/tracetest-lightstep/.env.template
similarity index 87%
rename from examples/tracetest-lightstep/.env
rename to examples/tracetest-lightstep/.env.template
index 41d00e095f..9e93e0cab9 100644
--- a/examples/tracetest-lightstep/.env
+++ b/examples/tracetest-lightstep/.env.template
@@ -1,3 +1,10 @@
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
+LIGHTSTEP_ACCESS_TOKEN=""
+
# Collector
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
diff --git a/examples/tracetest-lightstep/.gitignore b/examples/tracetest-lightstep/.gitignore
new file mode 100644
index 0000000000..4c49bd78f1
--- /dev/null
+++ b/examples/tracetest-lightstep/.gitignore
@@ -0,0 +1 @@
+.env
diff --git a/examples/tracetest-lightstep/Dockerfile.tracetest b/examples/tracetest-lightstep/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-lightstep/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-lightstep/tracetest/collector.config.yaml b/examples/tracetest-lightstep/collector.config.yaml
similarity index 53%
rename from examples/tracetest-lightstep/tracetest/collector.config.yaml
rename to examples/tracetest-lightstep/collector.config.yaml
index 1f00b60a81..49e79b46d3 100644
--- a/examples/tracetest-lightstep/tracetest/collector.config.yaml
+++ b/examples/tracetest-lightstep/collector.config.yaml
@@ -9,18 +9,16 @@ processors:
timeout: 100ms
exporters:
- logging:
- logLevel: debug
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317
tls:
insecure: true
# OTLP for Lightstep
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
- "lightstep-access-token": "" # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start
+ "lightstep-access-token": ${env:LIGHTSTEP_ACCESS_TOKEN} # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start
service:
pipelines:
@@ -31,4 +29,4 @@ service:
traces/lightstep:
receivers: [otlp]
processors: [batch]
- exporters: [logging, otlp/lightstep]
+ exporters: [otlp/lightstep]
diff --git a/examples/tracetest-lightstep/docker-compose.yaml b/examples/tracetest-lightstep/docker-compose.yaml
index b310d5094d..6b036a304e 100644
--- a/examples/tracetest-lightstep/docker-compose.yaml
+++ b/examples/tracetest-lightstep/docker-compose.yaml
@@ -1,8 +1,52 @@
-# OpenTelemetry Demo
+# OpenTelemetry Demo
# https://github.com/open-telemetry/opentelemetry-demo
version: "3.2"
services:
+ # Cloud-based Managed Tracetest
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
+ environment:
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
+
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
+ depends_on:
+ otel-frontend:
+ condition: service_healthy
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
+
cache:
image: redis:6
restart: unless-stopped
@@ -114,6 +158,11 @@ services:
- otel-recommendationservice
- otel-shippingservice
- otel-collector
+ healthcheck:
+ test: ["CMD", "wget", "--spider", "localhost:8084"]
+ interval: 1s
+ timeout: 3s
+ retries: 60
# PaymentService
otel-paymentservice:
@@ -179,3 +228,25 @@ services:
depends_on:
postgres:
condition: service_healthy
+
+ postgres:
+ image: postgres:14
+ environment:
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_USER: postgres
+ healthcheck:
+ test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
+ interval: 1s
+ timeout: 5s
+ retries: 60
+
+ otel-collector:
+ image: otel/opentelemetry-collector-contrib:0.100.0
+ restart: unless-stopped
+ environment:
+ - LIGHTSTEP_ACCESS_TOKEN
+ command:
+ - "--config"
+ - "/otel-local-config.yaml"
+ volumes:
+ - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-lightstep/resources/apply.sh b/examples/tracetest-lightstep/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-lightstep/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-lightstep/resources/datastore.yaml b/examples/tracetest-lightstep/resources/datastore.yaml
new file mode 100644
index 0000000000..8f546b0528
--- /dev/null
+++ b/examples/tracetest-lightstep/resources/datastore.yaml
@@ -0,0 +1,6 @@
+---
+type: DataStore
+spec:
+ id: current
+ name: Lightstep
+ type: lightstep
diff --git a/examples/tracetest-lightstep/resources/run.sh b/examples/tracetest-lightstep/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-lightstep/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-lightstep/http-test.yaml b/examples/tracetest-lightstep/resources/test.yaml
similarity index 100%
rename from examples/tracetest-lightstep/http-test.yaml
rename to examples/tracetest-lightstep/resources/test.yaml
diff --git a/examples/tracetest-lightstep/tracetest/docker-compose.yaml b/examples/tracetest-lightstep/tracetest/docker-compose.yaml
deleted file mode 100644
index 0e918b5fc9..0000000000
--- a/examples/tracetest-lightstep/tracetest/docker-compose.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-version: "3.2"
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-lightstep/tracetest/tracetest-config.yaml b/examples/tracetest-lightstep/tracetest/tracetest-config.yaml
deleted file mode 100644
index f3116d864f..0000000000
--- a/examples/tracetest-lightstep/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-lightstep/tracetest/tracetest-provision.yaml b/examples/tracetest-lightstep/tracetest/tracetest-provision.yaml
deleted file mode 100644
index 3ed599c3d6..0000000000
--- a/examples/tracetest-lightstep/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-type: DataStore
-spec:
- name: Lightstep
- type: lightstep
-
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://otel-frontend:8084
- productCatalogEndpoint: otel-productcatalogservice:3550
- cartEndpoint: otel-cartservice:7070
- checkoutEndpoint: otel-checkoutservice:5050
diff --git a/examples/tracetest-new-relic/.env b/examples/tracetest-new-relic/.env.template
similarity index 87%
rename from examples/tracetest-new-relic/.env
rename to examples/tracetest-new-relic/.env.template
index 41d00e095f..872be54986 100644
--- a/examples/tracetest-new-relic/.env
+++ b/examples/tracetest-new-relic/.env.template
@@ -1,3 +1,10 @@
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
+NEW_RELIC_INGEST_LICENSE=""
+
# Collector
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
diff --git a/examples/tracetest-new-relic/.gitignore b/examples/tracetest-new-relic/.gitignore
new file mode 100644
index 0000000000..4c49bd78f1
--- /dev/null
+++ b/examples/tracetest-new-relic/.gitignore
@@ -0,0 +1 @@
+.env
diff --git a/examples/tracetest-new-relic/Dockerfile.tracetest b/examples/tracetest-new-relic/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-new-relic/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-new-relic/tracetest/collector.config.yaml b/examples/tracetest-new-relic/collector.config.yaml
similarity index 71%
rename from examples/tracetest-new-relic/tracetest/collector.config.yaml
rename to examples/tracetest-new-relic/collector.config.yaml
index dd52a27b9f..256e26467f 100644
--- a/examples/tracetest-new-relic/tracetest/collector.config.yaml
+++ b/examples/tracetest-new-relic/collector.config.yaml
@@ -9,18 +9,16 @@ processors:
timeout: 100ms
exporters:
- logging:
- logLevel: debug
# OTLP for Tracetest
otlp/tracetest:
- endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
+ endpoint: tracetest-agent:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
tls:
insecure: true
# OTLP for New Relic
otlp/newrelic:
endpoint: otlp.nr-data.net:443
headers:
- api-key: # Send traces to New Relic.
+ api-key: ${NEW_RELIC_INGEST_LICENSE} # Send traces to New Relic.
# Read more in docs here: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-setup/#collector-export
# And here: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/collector/opentelemetry-collector-basic/
@@ -33,4 +31,4 @@ service:
traces/newrelic:
receivers: [otlp]
processors: [batch]
- exporters: [logging, otlp/newrelic]
+ exporters: [otlp/newrelic]
diff --git a/examples/tracetest-new-relic/docker-compose.yaml b/examples/tracetest-new-relic/docker-compose.yaml
index 2166ff2760..7b823455a9 100644
--- a/examples/tracetest-new-relic/docker-compose.yaml
+++ b/examples/tracetest-new-relic/docker-compose.yaml
@@ -1,8 +1,52 @@
-# OpenTelemetry Demo
+# OpenTelemetry Demo
# https://github.com/open-telemetry/opentelemetry-demo
version: "3.2"
services:
+ # Cloud-based Managed Tracetest
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
+ environment:
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
+
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
+ depends_on:
+ otel-frontend:
+ condition: service_healthy
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
+
cache:
image: redis:6
restart: unless-stopped
@@ -15,6 +59,7 @@ services:
# AdService
otel-adservice:
image: otel/demo:v0.3.4-alpha-adservice
+ platform: linux/amd64
environment:
- AD_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
@@ -26,6 +71,7 @@ services:
# CartService
otel-cartservice:
image: otel/demo:v0.3.4-alpha-cartservice
+ platform: linux/amd64
environment:
- CART_SERVICE_PORT
- REDIS_ADDR
@@ -39,6 +85,7 @@ services:
# CheckoutService
otel-checkoutservice:
image: otel/demo:v0.3.4-alpha-checkoutservice
+ platform: linux/amd64
environment:
- CHECKOUT_SERVICE_PORT
- CART_SERVICE_ADDR
@@ -61,6 +108,7 @@ services:
# CurrencyService
otel-currencyservice:
image: otel/demo:v0.3.4-alpha-currencyservice
+ platform: linux/amd64
environment:
- CURRENCY_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
@@ -71,6 +119,7 @@ services:
# EmailService
otel-emailservice:
image: otel/demo:v0.3.4-alpha-emailservice
+ platform: linux/amd64
environment:
- APP_ENV=production
- EMAIL_SERVICE_PORT
@@ -82,6 +131,7 @@ services:
# Frontend
otel-frontend:
image: otel/demo:v0.3.4-alpha-frontend
+ platform: linux/amd64
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
environment:
@@ -108,10 +158,16 @@ services:
- otel-recommendationservice
- otel-shippingservice
- otel-collector
+ healthcheck:
+ test: ["CMD", "wget", "--spider", "localhost:8084"]
+ interval: 1s
+ timeout: 3s
+ retries: 60
# PaymentService
otel-paymentservice:
image: otel/demo:v0.3.4-alpha-paymentservice
+ platform: linux/amd64
environment:
- PAYMENT_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
@@ -122,6 +178,7 @@ services:
# ProductCatalogService
otel-productcatalogservice:
image: otel/demo:v0.3.4-alpha-productcatalogservice
+ platform: linux/amd64
environment:
- PRODUCT_CATALOG_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_ADDR
@@ -133,6 +190,7 @@ services:
# RecommendationService
otel-recommendationservice:
image: otel/demo:v0.3.4-alpha-recommendationservice
+ platform: linux/amd64
depends_on:
- otel-productcatalogservice
- otel-collector
@@ -146,6 +204,7 @@ services:
# ShippingService
otel-shippingservice:
image: otel/demo:v0.3.4-alpha-shippingservice
+ platform: linux/amd64
environment:
- SHIPPING_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
@@ -156,6 +215,7 @@ services:
# FeatureFlagService
otel-featureflagservice:
image: otel/demo:v0.3.4-alpha-featureflagservice
+ platform: linux/amd64
ports:
- "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
environment:
@@ -168,3 +228,25 @@ services:
depends_on:
postgres:
condition: service_healthy
+
+ postgres:
+ image: postgres:14
+ environment:
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_USER: postgres
+ healthcheck:
+ test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
+ interval: 1s
+ timeout: 5s
+ retries: 60
+
+ otel-collector:
+ image: otel/opentelemetry-collector-contrib:0.100.0
+ restart: unless-stopped
+ environment:
+ - NEW_RELIC_INGEST_LICENSE
+ command:
+ - "--config"
+ - "/otel-local-config.yaml"
+ volumes:
+ - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-new-relic/http-test.yaml b/examples/tracetest-new-relic/http-test.yaml
deleted file mode 100644
index fc76274c5a..0000000000
--- a/examples/tracetest-new-relic/http-test.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-type: Test
-spec:
- id: YJmFC7hVg
- name: Otel - List Products
- description: Otel - List Products
- trigger:
- type: http
- httpRequest:
- url: http://otel-frontend:8084/api/products
- method: GET
- headers:
- - key: Content-Type
- value: application/json
- specs:
- - selector: span[tracetest.span.type="http" name="API HTTP GET" http.target="/api/products"
- http.method="GET"]
- assertions:
- - attr:http.status_code = 200
- - attr:tracetest.span.duration < 50ms
- - selector: span[tracetest.span.type="rpc" name="grpc.hipstershop.ProductCatalogService/ListProducts"]
- assertions:
- - attr:rpc.grpc.status_code = 0
- - selector: span[tracetest.span.type="rpc" name="hipstershop.ProductCatalogService/ListProducts"
- rpc.system="grpc" rpc.method="ListProducts" rpc.service="hipstershop.ProductCatalogService"]
- assertions:
- - attr:rpc.grpc.status_code = 0
diff --git a/examples/tracetest-new-relic/resources/apply.sh b/examples/tracetest-new-relic/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-new-relic/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-new-relic/resources/datastore.yaml b/examples/tracetest-new-relic/resources/datastore.yaml
new file mode 100644
index 0000000000..6e2d51aa59
--- /dev/null
+++ b/examples/tracetest-new-relic/resources/datastore.yaml
@@ -0,0 +1,6 @@
+---
+type: DataStore
+spec:
+ id: current
+ name: New Relic
+ type: newrelic
diff --git a/examples/tracetest-new-relic/resources/run.sh b/examples/tracetest-new-relic/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-new-relic/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-new-relic/resources/test.yaml b/examples/tracetest-new-relic/resources/test.yaml
new file mode 100644
index 0000000000..2e733f6ffa
--- /dev/null
+++ b/examples/tracetest-new-relic/resources/test.yaml
@@ -0,0 +1,28 @@
+type: Test
+spec:
+ id: YJmFC7hVg
+ name: Otel - List Products
+ description: Otel - List Products
+ trigger:
+ type: http
+ httpRequest:
+ url: http://otel-frontend:8084/api/products
+ method: GET
+ headers:
+ - key: Content-Type
+ value: application/json
+ specs:
+ - selector:
+ span[tracetest.span.type="http" name="API HTTP GET" http.target="/api/products"
+ http.method="GET"]
+ assertions:
+ - attr:http.status_code = 200
+ - attr:tracetest.span.duration < 50ms
+ - selector: span[tracetest.span.type="rpc" name="grpc.hipstershop.ProductCatalogService/ListProducts"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - selector:
+ span[tracetest.span.type="rpc" name="hipstershop.ProductCatalogService/ListProducts"
+ rpc.system="grpc" rpc.method="ListProducts" rpc.service="hipstershop.ProductCatalogService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
diff --git a/examples/tracetest-new-relic/tracetest/docker-compose.yaml b/examples/tracetest-new-relic/tracetest/docker-compose.yaml
deleted file mode 100644
index 0e918b5fc9..0000000000
--- a/examples/tracetest-new-relic/tracetest/docker-compose.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-version: "3.2"
-services:
- tracetest:
- restart: unless-stopped
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
- volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- otel-collector:
- condition: service_started
- environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
-
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
-
- otel-collector:
- image: otel/opentelemetry-collector-contrib:0.68.0
- restart: unless-stopped
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/tracetest-new-relic/tracetest/tracetest-config.yaml b/examples/tracetest-new-relic/tracetest/tracetest-config.yaml
deleted file mode 100644
index 7ff7e5de6c..0000000000
--- a/examples/tracetest-new-relic/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-new-relic/tracetest/tracetest-provision.yaml b/examples/tracetest-new-relic/tracetest/tracetest-provision.yaml
deleted file mode 100644
index 0d902699f9..0000000000
--- a/examples/tracetest-new-relic/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-type: DataStore
-spec:
- name: New Relic
- type: newrelic
- default: true
-
----
-type: Demo
-spec:
- name: "OpenTelemetry Shop"
- enabled: true
- type: otelstore
- opentelemetryStore:
- frontendEndpoint: http://otel-frontend:8084
- productCatalogEndpoint: otel-productcatalogservice:3550
- cartEndpoint: otel-cartservice:7070
- checkoutEndpoint: otel-checkoutservice:5050
diff --git a/examples/tracetest-signoz-pokeshop/.env.template b/examples/tracetest-signoz-pokeshop/.env.template
index d780ddb12c..c0437a9d95 100644
--- a/examples/tracetest-signoz-pokeshop/.env.template
+++ b/examples/tracetest-signoz-pokeshop/.env.template
@@ -1,2 +1,4 @@
-TRACETEST_API_KEY=""
-TRACETEST_API_TOKEN=""
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
diff --git a/examples/tracetest-signoz-pokeshop/Dockerfile.tracetest b/examples/tracetest-signoz-pokeshop/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/tracetest-signoz-pokeshop/Dockerfile.tracetest
@@ -0,0 +1,11 @@
+FROM alpine
+
+WORKDIR /app
+ARG TRACETEST_IMAGE_VERSION=v1.4.0
+
+RUN apk --update add bash jq curl
+RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION
+
+WORKDIR /resources
+
+ENTRYPOINT ["echo", "Tracetest CLI installed"]
diff --git a/examples/tracetest-signoz-pokeshop/tracetest/collector.config.yaml b/examples/tracetest-signoz-pokeshop/collector.config.yaml
similarity index 69%
rename from examples/tracetest-signoz-pokeshop/tracetest/collector.config.yaml
rename to examples/tracetest-signoz-pokeshop/collector.config.yaml
index bc59998e2a..8708e952f8 100644
--- a/examples/tracetest-signoz-pokeshop/tracetest/collector.config.yaml
+++ b/examples/tracetest-signoz-pokeshop/collector.config.yaml
@@ -14,12 +14,6 @@ processors:
sampling_percentage: 100
exporters:
- # OTLP for Hobby Tracetest Core
- otlp/tracetest:
- # Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
- endpoint: tracetest:4317
- tls:
- insecure: true
# OTLP for Cloud-based Managed Tracetest
otlp/tracetest-agent:
# Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
@@ -37,4 +31,4 @@ service:
traces:
receivers: [otlp]
processors: [probabilistic_sampler, batch]
- exporters: [otlp/signoz,otlp/tracetest,otlp/tracetest-agent]
+ exporters: [otlp/signoz, otlp/tracetest-agent]
diff --git a/examples/tracetest-signoz-pokeshop/docker-compose.agent.yaml b/examples/tracetest-signoz-pokeshop/docker-compose.agent.yaml
deleted file mode 100644
index fd0617d68a..0000000000
--- a/examples/tracetest-signoz-pokeshop/docker-compose.agent.yaml
+++ /dev/null
@@ -1,249 +0,0 @@
-version: "3"
-services:
-
- # Cloud-based Managed Tracetest
- tracetest-agent:
- image: kubeshop/tracetest-agent:latest
- command:
- - "--mode=verbose"
- environment:
- # Find the Agent API Key here: https://docs.tracetest.io/configuration/agent
- - TRACETEST_API_KEY=${TRACETEST_API_KEY}
-
- otel-collector:
- image: otel/opentelemetry-collector:0.101.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
- ports:
- - 4317:4317
- depends_on:
- signoz-otel-collector:
- condition: service_started
- signoz-otel-collector-metrics:
- condition: service_started
- # Tracetest End
-
- # SigNoz
- zookeeper-1:
- image: bitnami/zookeeper:3.7.1
- container_name: zookeeper-1
- hostname: zookeeper-1
- user: root
- volumes:
- - ./signoz/data/zookeeper-1:/bitnami/zookeeper
- environment:
- - ZOO_SERVER_ID=1
- - ALLOW_ANONYMOUS_LOGIN=yes
- - ZOO_AUTOPURGE_INTERVAL=1
-
- clickhouse:
- restart: on-failure
- image: clickhouse/clickhouse-server:22.8.8-alpine
- tty: true
- depends_on:
- - zookeeper-1
- logging:
- options:
- max-size: 50m
- max-file: "3"
- healthcheck:
- test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
- interval: 30s
- timeout: 5s
- retries: 3
- ulimits:
- nproc: 65535
- nofile:
- soft: 262144
- hard: 262144
- container_name: clickhouse
- hostname: clickhouse
- volumes:
- - ./signoz/clickhouse-config.xml:/etc/clickhouse-server/config.xml
- - ./signoz/clickhouse-users.xml:/etc/clickhouse-server/users.xml
- - ./signoz/custom-function.xml:/etc/clickhouse-server/custom-function.xml
- - ./signoz/clickhouse-cluster.xml:/etc/clickhouse-server/config.d/cluster.xml
- - ./signoz/data/clickhouse/:/var/lib/clickhouse/
- - ./signoz/user_scripts:/var/lib/clickhouse/user_scripts/
-
- alertmanager:
- image: signoz/alertmanager:${ALERTMANAGER_TAG:-0.23.1}
- volumes:
- - ./signoz/data/alertmanager:/data
- depends_on:
- query-service:
- condition: service_healthy
- restart: on-failure
- command:
- - --queryService.url=http://query-service:8085
- - --storage.path=/data
-
- query-service:
- image: signoz/query-service:${DOCKER_TAG:-0.22.0}
- command: ["-config=/root/config/prometheus.yml"]
- volumes:
- - ./signoz/prometheus.yml:/root/config/prometheus.yml
- - ./signoz/data/signoz/:/var/lib/signoz/
- environment:
- - ClickHouseUrl=tcp://clickhouse:9000/?database=signoz_traces
- - ALERTMANAGER_API_PREFIX=http://alertmanager:9093/api/
- - SIGNOZ_LOCAL_DB_PATH=/var/lib/signoz/signoz.db
- - DASHBOARDS_PATH=/root/config/dashboards
- - STORAGE=clickhouse
- - GODEBUG=netdns=go
- - TELEMETRY_ENABLED=true
- - DEPLOYMENT_TYPE=docker-standalone-amd
- restart: on-failure
- healthcheck:
- test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/health"]
- interval: 30s
- timeout: 5s
- retries: 3
- depends_on:
- clickhouse:
- condition: service_healthy
-
- frontend:
- image: signoz/frontend:${DOCKER_TAG:-0.22.0}
- restart: on-failure
- depends_on:
- - alertmanager
- - query-service
- ports:
- - 3301:3301
- volumes:
- - ./signoz/common/nginx-config.conf:/etc/nginx/conf.d/default.conf
-
- signoz-otel-collector:
- image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.79.2}
- command: ["--config=/etc/otel-collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
- user: root # required for reading docker container logs
- volumes:
- - ./signoz/otel-collector-config.yaml:/etc/otel-collector-config.yaml
- - /var/lib/docker/containers:/var/lib/docker/containers:ro
- environment:
- - OTEL_RESOURCE_ATTRIBUTES=host.name=signoz-host,os.type=linux
- - DOCKER_MULTI_NODE_CLUSTER=false
- - LOW_CARDINAL_EXCEPTION_GROUPING=false
- restart: on-failure
- depends_on:
- clickhouse:
- condition: service_healthy
-
- signoz-otel-collector-metrics:
- image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.79.2}
- command: ["--config=/etc/otel-collector-metrics-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
- volumes:
- - ./signoz/otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml
- restart: on-failure
- depends_on:
- clickhouse:
- condition: service_healthy
- # SigNoz End
-
- # Demo
- postgres:
- image: postgres:14
- environment:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- healthcheck:
- test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
- interval: 1s
- timeout: 5s
- retries: 60
- ports:
- - 5432:5432
-
- demo-cache:
- image: redis:6
- restart: unless-stopped
- healthcheck:
- test: ["CMD", "redis-cli", "ping"]
- interval: 1s
- timeout: 3s
- retries: 60
-
- demo-queue:
- image: rabbitmq:3.8-management
- restart: unless-stopped
- healthcheck:
- test: rabbitmq-diagnostics -q check_running
- interval: 1s
- timeout: 5s
- retries: 60
-
- demo-api:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: api
- ports:
- - "8081:8081"
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:8081"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
-
- demo-worker:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: worker
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
-
- demo-rpc:
- image: kubeshop/demo-pokemon-api:latest
- restart: unless-stopped
- pull_policy: always
- environment:
- REDIS_URL: demo-cache
- DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
- RABBITMQ_HOST: demo-queue
- POKE_API_BASE_URL: https://pokeapi.co/api/v2
- COLLECTOR_ENDPOINT: http://otel-collector:4317
- NPM_RUN_COMMAND: rpc
- ports:
- - 8082:8082
- healthcheck:
- test: ["CMD", "lsof", "-i", "8082"]
- interval: 1s
- timeout: 3s
- retries: 60
- depends_on:
- postgres:
- condition: service_healthy
- demo-cache:
- condition: service_healthy
- demo-queue:
- condition: service_healthy
- # Demo End
diff --git a/examples/tracetest-signoz-pokeshop/docker-compose.yaml b/examples/tracetest-signoz-pokeshop/docker-compose.yaml
index b0666d292d..3e3243c659 100644
--- a/examples/tracetest-signoz-pokeshop/docker-compose.yaml
+++ b/examples/tracetest-signoz-pokeshop/docker-compose.yaml
@@ -1,42 +1,57 @@
version: "3"
services:
+ tracetest-agent:
+ image: kubeshop/tracetest-agent:latest
+ environment:
+ # Get the required information here: https://app.tracetest.io/retrieve-token
+ - TRACETEST_API_KEY=${TRACETEST_TOKEN}
+ - TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}
- # Tracetest
- tracetest:
- image: kubeshop/tracetest:${TAG:-latest}
- platform: linux/amd64
+ tracetest-apply:
+ build:
+ dockerfile: Dockerfile.tracetest
volumes:
- - type: bind
- source: ./tracetest/tracetest-config.yaml
- target: /app/tracetest.yaml
- - type: bind
- source: ./tracetest/tracetest-provision.yaml
- target: /app/provision.yaml
- command: --provisioning-file /app/provision.yaml
- ports:
- - 11633:11633
- extra_hosts:
- - "host.docker.internal:host-gateway"
+ - ./resources:/resources
+ environment:
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/apply.sh
+ networks:
+ default: null
depends_on:
- postgres:
- condition: service_healthy
otel-collector:
condition: service_started
- healthcheck:
- test: [ "CMD", "wget", "--spider", "localhost:11633" ]
- interval: 1s
- timeout: 3s
- retries: 60
+ demo-api:
+ condition: service_healthy
+ tracetest-agent:
+ condition: service_started
+
+ tracetest-run:
+ build:
+ dockerfile: Dockerfile.tracetest
+ volumes:
+ - ./resources:/resources
environment:
- TRACETEST_DEV: ${TRACETEST_DEV}
+ TRACETEST_TOKEN: ${TRACETEST_TOKEN}
+ TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
+ entrypoint:
+ - bash
+ - /resources/run.sh
+ networks:
+ default: null
+ depends_on:
+ tracetest-apply:
+ condition: service_completed_successfully
otel-collector:
- image: otel/opentelemetry-collector:0.54.0
+ image: otel/opentelemetry-collector:0.101.0
command:
- "--config"
- "/otel-local-config.yaml"
volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
+ - ./collector.config.yaml:/otel-local-config.yaml
ports:
- 4317:4317
depends_on:
@@ -70,7 +85,7 @@ services:
max-size: 50m
max-file: "3"
healthcheck:
- test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
+ test: ["CMD", "wget", "--spider", "-q", "0.0.0.0:8123/ping"]
interval: 30s
timeout: 5s
retries: 3
@@ -155,7 +170,8 @@ services:
signoz-otel-collector-metrics:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.79.2}
- command: ["--config=/etc/otel-collector-metrics-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
+ command:
+ ["--config=/etc/otel-collector-metrics-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
volumes:
- ./signoz/otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml
restart: on-failure
@@ -215,6 +231,8 @@ services:
timeout: 3s
retries: 60
depends_on:
+ demo-worker:
+ condition: service_started
postgres:
condition: service_healthy
demo-cache:
diff --git a/examples/tracetest-signoz-pokeshop/resources/apply.sh b/examples/tracetest-signoz-pokeshop/resources/apply.sh
new file mode 100644
index 0000000000..13b878ba47
--- /dev/null
+++ b/examples/tracetest-signoz-pokeshop/resources/apply.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/tracetest-signoz-pokeshop/tracetest/tracetest-tracing-backend.yaml b/examples/tracetest-signoz-pokeshop/resources/datastore.yaml
similarity index 100%
rename from examples/tracetest-signoz-pokeshop/tracetest/tracetest-tracing-backend.yaml
rename to examples/tracetest-signoz-pokeshop/resources/datastore.yaml
diff --git a/examples/tracetest-signoz-pokeshop/resources/run.sh b/examples/tracetest-signoz-pokeshop/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/tracetest-signoz-pokeshop/resources/run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+
+run() {
+ echo "Configuring Tracetest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Running Trace-Based Tests..."
+ tracetest run test -f /resources/test.yaml
+}
+
+run
diff --git a/examples/tracetest-signoz-pokeshop/tests/test.yaml b/examples/tracetest-signoz-pokeshop/resources/test.yaml
similarity index 100%
rename from examples/tracetest-signoz-pokeshop/tests/test.yaml
rename to examples/tracetest-signoz-pokeshop/resources/test.yaml
diff --git a/examples/tracetest-signoz-pokeshop/tests/curl_get.sh b/examples/tracetest-signoz-pokeshop/tests/curl_get.sh
deleted file mode 100755
index 4d5faaf1b1..0000000000
--- a/examples/tracetest-signoz-pokeshop/tests/curl_get.sh
+++ /dev/null
@@ -1 +0,0 @@
-curl -d '' -H "Content-Type: application/json" -X GET http://localhost:8081/pokemon
\ No newline at end of file
diff --git a/examples/tracetest-signoz-pokeshop/tests/curl_post.sh b/examples/tracetest-signoz-pokeshop/tests/curl_post.sh
deleted file mode 100755
index cdffda742f..0000000000
--- a/examples/tracetest-signoz-pokeshop/tests/curl_post.sh
+++ /dev/null
@@ -1 +0,0 @@
-curl -d '{"id":6}' -H "Content-Type: application/json" -X POST http://localhost:8081/pokemon/import
\ No newline at end of file
diff --git a/examples/tracetest-signoz-pokeshop/tracetest/tracetest-config.yaml b/examples/tracetest-signoz-pokeshop/tracetest/tracetest-config.yaml
deleted file mode 100644
index 77fe974a60..0000000000
--- a/examples/tracetest-signoz-pokeshop/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
-
-telemetry:
- exporters:
- collector:
- serviceName: tracetest
- sampling: 100 # 100%
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
- applicationExporter: collector
diff --git a/examples/tracetest-signoz-pokeshop/tracetest/tracetest-provision.yaml b/examples/tracetest-signoz-pokeshop/tracetest/tracetest-provision.yaml
deleted file mode 100644
index 8fd420e72a..0000000000
--- a/examples/tracetest-signoz-pokeshop/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-type: PollingProfile
-spec:
- name: Default
- strategy: periodic
- default: true
- periodic:
- retryDelay: 5s
- timeout: 10m
-
----
-type: DataStore
-spec:
- name: Signoz
- type: signoz
-
----
-type: TestRunner
-spec:
- id: current
- name: default
- requiredGates:
- - analyzer-score
- - test-specs
-
----
-type: Demo
-spec:
- type: pokeshop
- enabled: true
- name: pokeshop
- opentelemetryStore: {}
- pokeshop:
- httpEndpoint: http://demo-api:8081
- grpcEndpoint: demo-rpc:8082