Skip to content

Commit

Permalink
README: add instructions to enable tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Jul 20, 2023
1 parent 2a4337a commit aa0e927
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ docker run -p 9090:9090 prom/prometheus --config.file=/etc/prometheus/prometheus

A common pattern to set up tracing is to configure your application to forward traces to an agent, which in turn forwards them to your tracing backend, such as a Grafana Stack. QuickPizza can be configured to do this by setting `QUICKPIZZA_OTLP_ENDPOINT` to the URL of said agent (in this case, we will use the [grafana/agent](https://github.com/grafana/agent)), which in turn can be configured through environment variables.

If you have a QuickPizza container running from previous steps, you can stop it now, as we will need to launch it again with tracing enabled. To lauch QuickPizza with tracing enabled, you can run the following commands:
If you have a QuickPizza container running from previous steps, you can stop it now, as we will need to launch it again with tracing enabled. To do so, you can run the following commands:

```shell
# Create a docker network so quickpizza and grafana-agent containers can talk to each other:
docker network create quickpizza
# Configure URL, user, and API key for your tracing backend.
# For Grafana cloud, see https://grafana.com/docs/agent/latest/flow/getting-started/opentelemetry-to-lgtm-stack/#grafana-tempo
# If you use Grafana Cloud, you can get your credentials following these steps: https://grafana.com/docs/agent/latest/flow/getting-started/opentelemetry-to-lgtm-stack/#grafana-tempo
export TRACES_ENDPOINT=your-tracing-endpoint.grafana.local:443
export TRACES_USER=12345
export TRACES_API_KEY=your-api-key
# Run the grafana agent. Config is not kubernetes-specific and works in Docker as well.
# Create a docker network so quickpizza and grafana-agent containers can talk to each other:
docker network create quickpizza
# Run the grafana agent. The provided config is not kubernetes-specific and works in Docker as well.
docker run --name grafana-agent --rm -i -v ./kubernetes/grafana-agent/config/grafana-agent.river:/grafana-agent.river --network quickpizza -e TRACES_ENDPOINT -e TRACES_USER -e TRACES_API_KEY -e AGENT_MODE=flow grafana/agent run /grafana-agent.river
# On a different terminal, run the QuickPizza container on the same network with tracing enabled:
docker run --rm -i -p 3333:3333 -e QUICKPIZZA_OTLP_ENDPOINT=http://grafana-agent:4318 --network quickpizza ghcr.io/grafana/quickpizza-local:latest
Expand Down

0 comments on commit aa0e927

Please sign in to comment.