diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-grafana-cloud-tempo.mdx b/docs/docs/examples-tutorials/recipes/running-tracetest-with-grafana-cloud-tempo.mdx
index 7b5389d0cc..6010161d68 100644
--- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-grafana-cloud-tempo.mdx
+++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-grafana-cloud-tempo.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/quick-start-grafana-cloud-tempo-nodejs)
:::
@@ -36,11 +32,6 @@ import CodeBlock from '@theme/CodeBlock';
This is a simple 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. The infrastructure will use Tempo on Grafana Cloud as the trace data store, and OpenTelemetry Collector to receive traces from the Node.js app and send them to Tempo.
-```mdx-code-block
-
-
-```
-
## Prerequisites
**Tracetest Account**:
@@ -71,11 +62,10 @@ cd tracetest/examples/quick-start-grafana-cloud-tempo-nodejs
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.yaml -f ./docker-compose.agent.yaml up -d`.
-5. This example is configured to use the Grafana Tempo Tracing Backend. Ensure the environment you're using to run this example is configured to use the Grafana Tempo Tracing Backend by clicking on Settings, Tracing Backend, Grafana Tempo, Save. Or, use the CLI as explained below.
-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 [GRAFANA_AUTH_READ_HASH and GRAFANA_AUTH_WRITE_HASH](https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/) deatails from your Tempo setup
+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.
@@ -92,7 +82,15 @@ The Node.js app is a simple Express app, contained in [the `app.js` file](https:
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=""
+
+# https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
+GRAFANA_AUTH_READ_HASH=""
+GRAFANA_AUTH_WRITE_HASH=""
+
```
The OpenTelemetry tracing is contained in the `tracing.otel.grpc.js` or `tracing.otel.http.js` files. Traces will be sent to Grafana Tempo.
@@ -107,368 +105,32 @@ Enabling the tracer is done by preloading the trace file. As seen in the `packag
},
```
-## Configuring OpenTelemetry Collector
-
-Configure OpenTelemetry Collector to send traces to Grafana Cloud Tempo.
-
-```yaml title="collector.config.yaml"
-receivers:
- otlp:
- protocols:
- grpc:
- http:
-
-exporters:
- logging:
- verbosity: detailed
- otlp:
- endpoint: tempo-us-central1.grafana.net:443
- headers:
- authorization: Basic
-
-service:
- pipelines:
- traces:
- receivers: [otlp]
- exporters: [logging, otlp]
-```
-
-Fill the authorization header in the `collector.config.yaml` file from your Grafana Tempo Setup. It should be encoded `base64` with the format of `username:token`. Follow [this guide to learn how](https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/).
-
-## Configuring Grafana Tempo
-
-Configure Tempo as a Tracing Backend:
-
-```yaml title="tracetest-tracing-backend.yaml"
----
-type: DataStore
-spec:
- id: tempo-cloud
- name: Tempo
- type: tempo
- tempo:
- type: http
- http:
- url: https://tempo-us-central1.grafana.net/tempo
- headers:
- authorization: Basic
- tls: {}
-```
-
-Fill in the details of your Grafana Cloud Tempo instance by using the HTTP integration `authorization` header. It should be encoded `base64` with the format of `username:token`. Follow [this guide to learn how](https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/).
-
-```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
-The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/docker-compose.yaml) and [`Dockerfile`](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/Dockerfile) in the root directory are for the Node.js app. The `docker-compose.yaml` contains one service for the Node.js app.
-
-The [`docker-compose.agent.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/docker-compose.agent.yaml) is for the Tracetest Agent and OpenTelemetry Collector.
+The [`docker-compose.yaml` file](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/docker-compose.yaml) and [`Dockerfile`](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/Dockerfile) in the root directory are for the Node.js app. The `docker-compose.yaml` contains one service for the Node.js app, as well as the Tracetest Agent, Tempo, and OpenTelemetry Collector.
[The `collector.config.yaml` configures the OpenTelemetry Collector](https://github.com/kubeshop/tracetest/blob/main/examples/quick-start-tempo-nodejs/collector.config.yaml). It receives traces via either `grpc` or `http`. Then, exports them to Tempo via the OTLP `exporter`.
To start it, run this command:
```bash
-docker compose -f ./docker-compose.yaml -f ./docker-compose.agent.yaml up -d
+docker compose run tracetest-run
```
This will start the Node.js app the OpenTelemetry Collector and send the traces to Grafana Tempo.
## Run Tracetest Tests
-1. Open [Tracetest](https://app.tracetest.io/)
-2. [Configure Tempo as a tracing backend](/configuration/connecting-to-data-stores/tempo) 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:
-
-```bash
-tracetest configure -t
-tracetest run test -f ./test-api.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. 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 `tracetest` directory are for the setting up Tracetest, Tempo, 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.
-
-### 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. For example, `tempo:4317` in the `collector.config.yaml` will map to the `tempo` service, where the port `4317` is the port where Tempo accepts traces. And, `tempo:9095` in the `tracetest-provision.yaml` will map to the `tempo` service and port `9095` where Tracetest will fetch trace data from Tempo.
-
-## 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, respectively.
-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 four 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"
-services:
- 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/provisioning.yaml
- ports:
- - 11633:11633
- command: --provisioning-file /app/provisioning.yaml
- depends_on:
- postgres:
- condition: service_healthy
- tempo:
- condition: service_started
- otel-collector:
- condition: service_started
- healthcheck:
- test: ["CMD", "wget", "--spider", "localhost:11633"]
- interval: 1s
- timeout: 3s
- retries: 60
- 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.59.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
- depends_on:
- - tempo
-```
-
-Tracetest depends on Postgres, Tempo and the OpenTelemetry Collector. All three services 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, we will 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 trace data store and 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 # 100%
- exporter:
- type: collector
- collector:
- endpoint: otel-collector:4317
-
-server:
- telemetry:
- exporter: collector
-```
-
-The `tracetest-provision.yaml` file defines the trace data store, set to Grafana Cloud Tempo, meaning the traces will be stored in Tempo and Tracetest will fetch them from Tempo when running tests.
-
-How does Tracetest fetch traces?
-
-Tracetest uses `https://tempo-us-central1.grafana.net/tempo` to connect to Tempo and fetch trace data.
-
-```yaml
-# tracetest-provision.yaml
-
----
-type: DataStore
-spec:
- name: Grafana Tempo Cloud
- type: tempo
- tempo:
- type: http
- http:
- url: https://tempo-us-central1.grafana.net/tempo
- headers:
- Authorization: Basic
- # https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
-
-```
-
-How do traces reach Tempo?
-
-The `collector.config.yaml` explains that. It receives traces via either `grpc` or `http`. Then, exports them to Tempo's OTLP HTTP endpoint `tempo-us-central1.grafana.net:443`.
-
-```yaml
-# collector.config.yaml
-
-receivers:
- otlp:
- protocols:
- grpc:
- http:
-
-exporters:
- logging:
- verbosity: detailed
- otlp:
- endpoint: tempo-us-central1.grafana.net:443
- headers:
- authorization: Basic
-
-service:
- pipelines:
- traces:
- receivers: [otlp]
- exporters: [logging, otlp]
-```
-
-## Run Both the Node.js App and Tracetest
-
-To start both the Node.js app 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
-```
+## Run Tracetest Tests
-This will start your Tracetest instance on `http://localhost:11633/`.
+This will:
+1. Start the Node.js app, the OpenTelemetry Collector, and send the traces to Tempo.
+2. Start the Tracetest Agent.
+3. Configure the tracing backend and create tests in your environment.
+4. Run the tests.
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.
-```mdx-code-block
-
-
-```
-
## Learn More
Feel free to check out our [examples in GitHub](https://github.com/kubeshop/tracetest/tree/main/examples) and join our [Slack Community](https://dub.sh/tracetest-community) for more info!
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/.env.template b/examples/quick-start-grafana-cloud-tempo-nodejs/.env.template
index d780ddb12c..4f29f672ec 100644
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/.env.template
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/.env.template
@@ -1,2 +1,8 @@
-TRACETEST_API_KEY=""
-TRACETEST_API_TOKEN=""
+# Get the required information here: https://app.tracetest.io/retrieve-token
+
+TRACETEST_TOKEN=""
+TRACETEST_ENVIRONMENT_ID=""
+
+# https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
+GRAFANA_AUTH_READ_HASH=""
+GRAFANA_AUTH_WRITE_HASH=""
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/.gitignore b/examples/quick-start-grafana-cloud-tempo-nodejs/.gitignore
index d8f337266f..e34636b928 100644
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/.gitignore
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/.gitignore
@@ -1,3 +1,4 @@
node_modules
.DS_Store
.env
+/resources/datastore.yaml
\ No newline at end of file
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/Dockerfile.tracetest b/examples/quick-start-grafana-cloud-tempo-nodejs/Dockerfile.tracetest
new file mode 100644
index 0000000000..883f239155
--- /dev/null
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/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/quick-start-grafana-cloud-tempo-nodejs/collector.config.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/collector.config.yaml
index 4c415a7bbc..027ea4f23b 100644
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/collector.config.yaml
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/collector.config.yaml
@@ -2,18 +2,26 @@ receivers:
otlp:
protocols:
grpc:
+ endpoint: 0.0.0.0:4317
http:
+ endpoint: 0.0.0.0:4318
+
+processors:
+ batch:
+ timeout: 100ms
exporters:
logging:
- verbosity: detailed
+ loglevel: debug
otlp:
endpoint: tempo-us-central1.grafana.net:443
headers:
- authorization: Basic
+ authorization: Basic ${env:GRAFANA_AUTH_WRITE_HASH}
+ # https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
service:
pipelines:
traces:
receivers: [otlp]
+ processors: [batch]
exporters: [logging, otlp]
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.agent.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.agent.yaml
deleted file mode 100644
index b10263ddb5..0000000000
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.agent.yaml
+++ /dev/null
@@ -1,18 +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-contrib:0.100.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.yaml
index d415e83d4f..6cc4f39914 100644
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.yaml
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/docker-compose.yaml
@@ -1,7 +1,66 @@
-version: '3'
+version: "3"
+
services:
app:
image: quick-start-nodejs
build: .
ports:
- "8080:8080"
+ depends_on:
+ otel-collector:
+ condition: service_started
+
+ otel-collector:
+ image: otel/opentelemetry-collector-contrib:0.105.0
+ command:
+ - "--config"
+ - "/otel-local-config.yaml"
+ environment:
+ - GRAFANA_AUTH_WRITE_HASH
+ volumes:
+ - ./collector.config.yaml:/otel-local-config.yaml
+
+ # 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}
+ GRAFANA_AUTH_READ_HASH: ${GRAFANA_AUTH_READ_HASH}
+ 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
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/resources/apply.sh b/examples/quick-start-grafana-cloud-tempo-nodejs/resources/apply.sh
new file mode 100644
index 0000000000..edc769ab6b
--- /dev/null
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/resources/apply.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+TOKEN=$TRACETEST_TOKEN
+ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID
+GRAFANA_HASH=$GRAFANA_AUTH_READ_HASH
+
+apply() {
+ echo "Configuring TraceTest"
+ tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID
+
+ echo "Applying Resources"
+ echo "
+type: DataStore
+spec:
+ id: current
+ name: Grafana Tempo Cloud
+ type: tempo
+ tempo:
+ type: http
+ http:
+ url: https://tempo-us-central1.grafana.net/tempo
+ headers:
+ Authorization: Basic ${GRAFANA_HASH}
+" > /resources/datastore.yaml
+
+ tracetest apply datastore -f /resources/datastore.yaml
+ tracetest apply test -f /resources/test.yaml
+}
+
+apply
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/resources/run.sh b/examples/quick-start-grafana-cloud-tempo-nodejs/resources/run.sh
new file mode 100644
index 0000000000..05d0f41724
--- /dev/null
+++ b/examples/quick-start-grafana-cloud-tempo-nodejs/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/quick-start-grafana-cloud-tempo-nodejs/test-api.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/resources/test.yaml
similarity index 100%
rename from examples/quick-start-grafana-cloud-tempo-nodejs/test-api.yaml
rename to examples/quick-start-grafana-cloud-tempo-nodejs/resources/test.yaml
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/collector.config.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/collector.config.yaml
deleted file mode 100644
index ee7f117abd..0000000000
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/collector.config.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-receivers:
- otlp:
- protocols:
- grpc:
- http:
-
-processors:
- batch:
- timeout: 100ms
-
-exporters:
- logging:
- loglevel: debug
- otlp:
- endpoint: tempo-us-central1.grafana.net:443
- headers:
- authorization: Basic
- # https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
- tls:
- insecure: false
-
-service:
- pipelines:
- traces:
- receivers: [otlp]
- processors: [batch]
- exporters: [otlp]
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/docker-compose.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/docker-compose.yaml
deleted file mode 100644
index 5deaed4052..0000000000
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/docker-compose.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-version: "3"
-services:
- 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/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
- 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.73.0
- command:
- - "--config"
- - "/otel-local-config.yaml"
- volumes:
- - ./tracetest/collector.config.yaml:/otel-local-config.yaml
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-config.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-config.yaml
deleted file mode 100644
index 5e732f6d38..0000000000
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-config.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-postgres:
- host: postgres
- user: postgres
- password: postgres
- port: 5432
- dbname: postgres
- params: sslmode=disable
diff --git a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-provision.yaml b/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-provision.yaml
deleted file mode 100644
index bc4053fc65..0000000000
--- a/examples/quick-start-grafana-cloud-tempo-nodejs/tracetest/tracetest-provision.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-type: DataStore
-spec:
- name: Grafana Tempo Cloud
- type: tempo
- tempo:
- type: http
- http:
- url: https://tempo-us-central1.grafana.net/tempo
- headers:
- Authorization: Basic
- # https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/
diff --git a/examples/tracetest-grafana-tempo-pokeshop/docker-compose.yml b/examples/tracetest-grafana-tempo-pokeshop/docker-compose.yml
index 74a00eb072..5c7c87aaa6 100644
--- a/examples/tracetest-grafana-tempo-pokeshop/docker-compose.yml
+++ b/examples/tracetest-grafana-tempo-pokeshop/docker-compose.yml
@@ -46,7 +46,7 @@ services:
# Grafana
otel-collector:
- image: otel/opentelemetry-collector-contrib:0.59.0
+ image: otel/opentelemetry-collector-contrib:0.100.0
command:
- "--config"
- "/otel-local-config.yaml"