diff --git a/.gitignore b/.gitignore index 4896ebb4d63..3204f36dc34 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .vscode /dist /cmd/tempo-cli/tempo-cli -/example/docker-compose/example-data/tempo +/example/docker-compose/**/tempo-data/ +/example/docker-compose/**/gcs-data/ .DS_Store /tempodb/encoding/benchmark_block \ No newline at end of file diff --git a/docs/tempo/website/configuration/_index.md b/docs/tempo/website/configuration/_index.md index 6452234fcca..cb41e6777cc 100644 --- a/docs/tempo/website/configuration/_index.md +++ b/docs/tempo/website/configuration/_index.md @@ -59,7 +59,7 @@ server: See [here](https://github.com/grafana/tempo/blob/main/modules/distributor/config.go) for all configuration options. Distributors are responsible for receiving spans and forwarding them to the appropriate ingesters. The below configuration -exposes the otlp receiver on port 0.0.0.0:5680. [This configuration](https://github.com/grafana/tempo/blob/main/example/docker-compose/etc/tempo-s3-minio.yaml) shows how to +exposes the otlp receiver on port 0.0.0.0:5680. [This configuration](https://github.com/grafana/tempo/blob/main/example/docker-compose/local/tempo-local.yaml) shows how to configure all available receiver options. ``` diff --git a/docs/tempo/website/configuration/multitenancy.md b/docs/tempo/website/configuration/multitenancy.md index 6b2d5099d93..cc5dba10dc4 100644 --- a/docs/tempo/website/configuration/multitenancy.md +++ b/docs/tempo/website/configuration/multitenancy.md @@ -7,7 +7,7 @@ of a header: `X-Scope-OrgID`. This guide details how to setup multitenancy. ## Multitenancy -If you're interested in setting up multitenancy, please consult the [multitenant example](https://github.com/grafana/tempo/tree/main/example/docker-compose/docker-compose.multitenant.yaml) +If you're interested in setting up multitenancy, please consult the [multitenant example](https://github.com/grafana/tempo/tree/main/example/docker-compose/otel-collector-multitenant) in the repo. This example uses the following settings to achieve multitenancy in Tempo: - Configure the OTEL Collector to attach the X-Scope-OrgID header on push: diff --git a/docs/tempo/website/configuration/querying.md b/docs/tempo/website/configuration/querying.md index 60e62b1f568..72efa08066f 100644 --- a/docs/tempo/website/configuration/querying.md +++ b/docs/tempo/website/configuration/querying.md @@ -19,6 +19,6 @@ Note that the port of 3100 is a common port used in our examples. Tempo default ## Grafana 7.4.x Grafana 7.4.x is *not* able to query Tempo directly and requires the tempo-query component as an intermediary. In this case -you need to run Tempo-Query and direct it at Tempo proper. Check out [the Grafana 7.4.x example](https://github.com/grafana/tempo/tree/main/example/docker-compose#grafana-74x) to help with configuration. +you need to run Tempo-Query and direct it at Tempo proper. Check out [the Grafana 7.4.x example](https://github.com/grafana/tempo/tree/main/example/docker-compose/grafana7.4) to help with configuration. The url entered will be `http://:16686/`. \ No newline at end of file diff --git a/docs/tempo/website/getting-started/_index.md b/docs/tempo/website/getting-started/_index.md index 66d62fa9b30..e1f9f20206d 100644 --- a/docs/tempo/website/getting-started/_index.md +++ b/docs/tempo/website/getting-started/_index.md @@ -71,7 +71,7 @@ Getting started with Tempo is easy. - If you're looking for examples of how to get started with Tempo, check out the [examples]({{< relref "example-demo-app.md" >}}) topic. - For production workloads, refer to the [deployment]({{< relref "../operations/deployment" >}}) section. -> **Note:** The Grafana Agent is already set up to use Tempo. Refer to the [configuration](https://github.com/grafana/agent/blob/main/docs/configuration-reference.md#tempo_config) and [example](https://github.com/grafana/agent/blob/main/example/docker-compose/agent/config/agent.yaml) for details. +> **Note:** The Grafana Agent is already set up to use Tempo. Refer to the [configuration](https://github.com/grafana/agent/blob/main/docs/configuration-reference.md#tempo_config) and [example](https://github.com/grafana/agent/blob/main/example/docker-compose/agent/agent.yaml) for details. ## 4. Visualization (Grafana) diff --git a/docs/tempo/website/operations/architecture.md b/docs/tempo/website/operations/architecture.md index 1c1fad9ba0a..fc0213409dc 100644 --- a/docs/tempo/website/operations/architecture.md +++ b/docs/tempo/website/operations/architecture.md @@ -69,4 +69,4 @@ The Compactors stream blocks to and from the backend storage to reduce the total When using older versions of Grafana (7.4.x), you must also use `tempo-query` in order to visualize traces. The `tempo-query` is [Jaeger Query](https://www.jaegertracing.io/docs/1.19/deployment/#query-service--ui) with a [GRPC Plugin](https://github.com/jaegertracing/jaeger/tree/master/plugin/storage/grpc) that allows it to query Tempo. -For more information, refer to [these example](https://github.com/grafana/tempo/tree/main/example/docker-compose#grafana-74x) and [these docs](../../configuration/querying). +For more information, refer to [these example](https://github.com/grafana/tempo/tree/main/example/docker-compose/grafana7.4) and [these docs](../../configuration/querying). diff --git a/example/docker-compose/etc/agent.yaml b/example/docker-compose/agent/agent.yaml similarity index 100% rename from example/docker-compose/etc/agent.yaml rename to example/docker-compose/agent/agent.yaml diff --git a/example/docker-compose/docker-compose.agent.yaml b/example/docker-compose/agent/docker-compose.yaml similarity index 53% rename from example/docker-compose/docker-compose.agent.yaml rename to example/docker-compose/agent/docker-compose.yaml index 109090dc013..5cc3c7c7ad7 100644 --- a/example/docker-compose/docker-compose.agent.yaml +++ b/example/docker-compose/agent/docker-compose.yaml @@ -1,29 +1,29 @@ -version: "3.4" +version: "3" services: + # Generate fake traces... synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://agent:14268 # And put them in a Grafana Agent pipeline... agent: - image: grafana/agent:v0.14.0 + image: grafana/agent:v0.15.0 + command: [ "-config.file=/etc/agent.yaml" ] volumes: - - ./etc/agent.yaml:/etc/agent.yaml - command: - - -config.file=/etc/agent.yaml + - ./agent.yaml:/etc/agent.yaml # To eventually offload to Tempo... tempo: image: grafana/tempo:latest - command: ["-config.file=/etc/tempo.yaml"] + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-local.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ../local/tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger ingest - "3100" # tempo @@ -31,12 +31,18 @@ services: - "55681" # otlp http - "9411" # zipkin + prometheus: + image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] + volumes: + - ../shared/prometheus.yaml:/etc/prometheus.yaml + ports: + - "9090:9090" + grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/readme.agent.md b/example/docker-compose/agent/readme.md similarity index 65% rename from example/docker-compose/readme.agent.md rename to example/docker-compose/agent/readme.md index 5c066984305..b5d372d5c86 100644 --- a/example/docker-compose/readme.agent.md +++ b/example/docker-compose/agent/readme.md @@ -4,26 +4,26 @@ This example highlights setting up the Grafana Agent in a simple tracing pipelin 1. First start up the stack. ```console -docker-compose -f docker-compose.agent.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.agent.yaml ps +docker-compose ps ``` ``` Name Command State Ports ---------------------------------------------------------------------------------------------------------- -dockercompose_agent_1 /bin/agent -config.file=/e ... Up -dockercompose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -dockercompose_synthetic-load-generator_1 ./start.sh Up -dockercompose_tempo_1 /tempo --target=all --mult ... Up 0.0.0.0:8081->80/tcp +agent_agent_1 /bin/agent -config.file=/e ... Up +agent_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +agent_synthetic-load-generator_1 ./start.sh Up +agent_tempo_1 /tempo --target=all --mult ... Up 0.0.0.0:8081->80/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. ```console -ls ./example-data/tempo +ls tempo-data/ ``` 3. The synthetic-load-generator is now printing out trace ids it's flushing into Tempo. To view its logs use - @@ -46,10 +46,10 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. 5. To stop the setup use - ```console -docker-compose -f docker-compose.agent.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/azure/docker-compose.yaml b/example/docker-compose/azure/docker-compose.yaml new file mode 100644 index 00000000000..b9fc08225d7 --- /dev/null +++ b/example/docker-compose/azure/docker-compose.yaml @@ -0,0 +1,57 @@ +version: "3" +services: + + tempo: + image: grafana/tempo:latest + command: [ "-config.file=/etc/tempo.yaml" ] + volumes: + - ./tempo-azure.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo + ports: + - "14268" # jaeger + - "3100:3100" # tempo + depends_on: + - azure-cli + - azurite + + azurite: + image: mcr.microsoft.com/azure-storage/azurite + ports: + - 10000:10000 + + # Creates the Azure storage container + azure-cli: + image: mcr.microsoft.com/azure-cli:2.9.1 + command: [ "az", "storage","container", "create", "-n","tempo", "--connection-string","DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;" ] + depends_on: + - azurite + + synthetic-load-generator: + image: omnition/synthetic-load-generator:1.0.25 + volumes: + - ../shared/load-generator.json:/etc/load-generator.json + environment: + - TOPOLOGY_FILE=/etc/load-generator.json + - JAEGER_COLLECTOR_URL=http://tempo:14268 + depends_on: + - tempo + + prometheus: + image: prom/prometheus:latest + volumes: + - ../shared/prometheus.yaml:/etc/prometheus.yaml + command: + - --config.file=/etc/prometheus.yaml + ports: + - "9090:9090" + + grafana: + image: grafana/grafana:7.5.7 + volumes: + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml + environment: + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_AUTH_DISABLE_LOGIN_FORM=true + ports: + - "3000:3000" diff --git a/example/docker-compose/readme.azure.md b/example/docker-compose/azure/readme.md similarity index 65% rename from example/docker-compose/readme.azure.md rename to example/docker-compose/azure/readme.md index 7e715921a3f..75952cc5ae7 100644 --- a/example/docker-compose/readme.azure.md +++ b/example/docker-compose/azure/readme.md @@ -4,23 +4,23 @@ In this example tempo is configured to write data to Azure via [Azurite](https:/ 1. First start up the azure stack. ```console -docker-compose -f docker-compose.azure.azurite.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.azure.azurite.yaml ps +docker-compose ps ``` ``` Name Command State Ports -------------------------------------------------------------------------------------------------------------------------------------- -docker-compose_azure-cli_1 az storage container creat ... Exit 0 -docker-compose_azurite_1 docker-entrypoint.sh azuri ... Up 0.0.0.0:10000->10000/tcp, 10001/tcp -docker-compose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -docker-compose_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp -docker-compose_synthetic-load-generator_1 ./start.sh Up -docker-compose_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:32768->14268/tcp, 0.0.0.0:3100->3100/tcp +azure_azure-cli_1 az storage container creat ... Exit 0 +azure_azurite_1 docker-entrypoint.sh azuri ... Up 0.0.0.0:10000->10000/tcp, 10001/tcp +azure_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +azure_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp +azure_synthetic-load-generator_1 ./start.sh Up +azure_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:32768->14268/tcp, 0.0.0.0:3100->3100/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. Check [Azure Storage Explorer](https://azure.microsoft.com/en-us/features/storage-explorer/) and [Azurite docs](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite). @@ -45,11 +45,11 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. Also notice that you can query Tempo metrics from the Prometheus data source setup in Grafana. 5. To stop the setup use - ```console -docker-compose -f docker-compose.azure.azurite.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/etc/tempo-azure.yaml b/example/docker-compose/azure/tempo-azure.yaml similarity index 96% rename from example/docker-compose/etc/tempo-azure.yaml rename to example/docker-compose/azure/tempo-azure.yaml index c936203b0e1..36741c8d17d 100644 --- a/example/docker-compose/etc/tempo-azure.yaml +++ b/example/docker-compose/azure/tempo-azure.yaml @@ -24,7 +24,7 @@ ingester: compactor: compaction: compaction_window: 1h # blocks in this time window will be compacted together - max_block_bytes: 100_000_000 # maximum size of compacted blocks + max_block_bytes: 100_000_000 # maximum size of compacted blocks block_retention: 1h compacted_block_retention: 10m diff --git a/example/docker-compose/docker-compose.azure.azurite.yaml b/example/docker-compose/docker-compose.azure.azurite.yaml deleted file mode 100644 index f565a511c98..00000000000 --- a/example/docker-compose/docker-compose.azure.azurite.yaml +++ /dev/null @@ -1,61 +0,0 @@ -version: "2" -services: - - tempo: - image: grafana/tempo:latest - restart: unless-stopped - command: ["-config.file=/etc/tempo.yaml"] - volumes: - - ./etc/tempo-azure.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo - ports: - - "14268" # jaeger - - "3100:3100" # tempo - depends_on: - - azure-cli - - azurite - - azurite: - image: mcr.microsoft.com/azure-storage/azurite - ports: - - 10000:10000 - -# Creates the Azure storage container - azure-cli: - image: mcr.microsoft.com/azure-cli:2.9.1 - command: ["az", "storage","container", "create", "-n","tempo", "--connection-string","DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;"] - depends_on: - - azurite - - prometheus: - image: prom/prometheus:latest - volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml - ports: - - "9090:9090" - - synthetic-load-generator: - image: omnition/synthetic-load-generator:1.0.25 - volumes: - - ./etc/load-generator.json:/etc/load-generator.json - environment: - - TOPOLOGY_FILE=/etc/load-generator.json - - JAEGER_COLLECTOR_URL=http://tempo:14268 - depends_on: - - tempo - - grafana: - image: grafana/grafana:7.5.1 - volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards - environment: - - GF_AUTH_ANONYMOUS_ENABLED=true - - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - - GF_AUTH_DISABLE_LOGIN_FORM=true - ports: - - "3000:3000" diff --git a/example/docker-compose/docker-compose.multitenant.yaml b/example/docker-compose/docker-compose.multitenant.yaml deleted file mode 100644 index 916401a9342..00000000000 --- a/example/docker-compose/docker-compose.multitenant.yaml +++ /dev/null @@ -1,38 +0,0 @@ -version: "3.4" -services: - # Generate fake traces... - synthetic-load-generator: - image: omnition/synthetic-load-generator:1.0.25 - volumes: - - ./etc/load-generator.json:/etc/load-generator.json - environment: - - TOPOLOGY_FILE=/etc/load-generator.json - - JAEGER_COLLECTOR_URL=http://otel-collector:14268 - - # And put them in an OTEL collector pipeline... - otel-collector: - image: otel/opentelemetry-collector:0.16.0 - volumes: - - ./etc/otel-collector.multitenant.yaml:/etc/otel-collector.yaml - command: - - --config=/etc/otel-collector.yaml - - # To eventually offload to Tempo... - tempo: - image: grafana/tempo:latest - command: ["--target=all","--multitenancy.enabled=true","--storage.trace.backend=local", "--storage.trace.local.path=/var/tempo"] - ports: - - 8081:80 - - grafana: - image: grafana/grafana:7.5.1 - volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards - environment: - - GF_AUTH_ANONYMOUS_ENABLED=true - - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - - GF_AUTH_DISABLE_LOGIN_FORM=true - ports: - - "3000:3000" \ No newline at end of file diff --git a/example/docker-compose/example-data/dashboards-provisioning/dashboards.yaml b/example/docker-compose/example-data/dashboards-provisioning/dashboards.yaml deleted file mode 100644 index b6633afce25..00000000000 --- a/example/docker-compose/example-data/dashboards-provisioning/dashboards.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: 1 - -providers: -- name: 'dashboards' - orgId: 1 - folder: 'dashboards' - folderUid: '' - type: file - disableDeletion: true - editable: true - updateIntervalSeconds: 3600 - allowUiUpdates: false - options: - path: /var/lib/grafana/dashboards \ No newline at end of file diff --git a/example/docker-compose/docker-compose.gcs.fake.yaml b/example/docker-compose/gcs/docker-compose.yaml similarity index 54% rename from example/docker-compose/docker-compose.gcs.fake.yaml rename to example/docker-compose/gcs/docker-compose.yaml index 3699182fdd1..7d8b67524fe 100644 --- a/example/docker-compose/docker-compose.gcs.fake.yaml +++ b/example/docker-compose/gcs/docker-compose.yaml @@ -1,12 +1,12 @@ -version: "2" +version: "3" services: tempo: image: grafana/tempo:latest - command: ["-config.file=/etc/tempo.yaml"] + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-gcs-fake.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ./tempo-gcs.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger - "3100:3100" # tempo @@ -15,17 +15,17 @@ services: gcs: image: fsouza/fake-gcs-server - command: -public-host gcs:4443 + command: [ "-public-host gcs:4443"] ports: - "4443:4443" volumes: # This creates an empty tempo bucket - - ./example-data/gcs/tempo/:/data/tempo/ + - ./gcs-data/:/data/tempo/ synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://tempo:14268 @@ -35,19 +35,15 @@ services: prometheus: image: prom/prometheus:latest volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml + - ../shared/prometheus.yaml:/etc/prometheus.yaml + command: --config.file=/etc/prometheus.yaml ports: - "9090:9090" grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/readme.gcs.md b/example/docker-compose/gcs/readme.md similarity index 64% rename from example/docker-compose/readme.gcs.md rename to example/docker-compose/gcs/readme.md index 9ee03e4f1ec..166f0a34e31 100644 --- a/example/docker-compose/readme.gcs.md +++ b/example/docker-compose/gcs/readme.md @@ -4,22 +4,22 @@ In this example Tempo is configured to write data to GCS via [fake-gcs-server](h 1. First start up the azure stack. ```console -docker-compose -f docker-compose.gcs.fake.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.gcs.fake.yaml ps +docker-compose ps ``` ``` Name Command State Ports ------------------------------------------------------------------------------------------------------------------------------------ -dockercompose_gcs_1 /bin/fake-gcs-server -data ... Up 0.0.0.0:4443->4443/tcp -dockercompose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -dockercompose_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp -dockercompose_synthetic-load-generator_1 ./start.sh Up -dockercompose_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59543->14268/tcp, 0.0.0.0:3100->3100/tcp +gcs_gcs_1 /bin/fake-gcs-server -data ... Up 0.0.0.0:4443->4443/tcp +gcs_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +gcs_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp +gcs_synthetic-load-generator_1 ./start.sh Up +gcs_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59543->14268/tcp, 0.0.0.0:3100->3100/tcp ``` 2. If you're interested you can kind of see the wal/blocks as they are being created. Navigate to https://localhost:4443/storage/v1/b/tempo/o @@ -45,11 +45,11 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. Also notice that you can query Tempo metrics from the Prometheus data source setup in Grafana. 5. To stop the setup use - ```console -docker-compose -f docker-compose.gcs.fake.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/etc/tempo-gcs-fake.yaml b/example/docker-compose/gcs/tempo-gcs.yaml similarity index 100% rename from example/docker-compose/etc/tempo-gcs-fake.yaml rename to example/docker-compose/gcs/tempo-gcs.yaml diff --git a/example/docker-compose/docker-compose.grafana7.4.yaml b/example/docker-compose/grafana7.4/docker-compose.yaml similarity index 52% rename from example/docker-compose/docker-compose.grafana7.4.yaml rename to example/docker-compose/grafana7.4/docker-compose.yaml index 6a6f64f4829..fed56250077 100644 --- a/example/docker-compose/docker-compose.grafana7.4.yaml +++ b/example/docker-compose/grafana7.4/docker-compose.yaml @@ -1,21 +1,21 @@ -version: "2" +version: "3" services: tempo: image: grafana/tempo:latest - command: ["-config.file=/etc/tempo.yaml"] + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-local.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ../local/tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data/:/tmp/tempo ports: - "14268" # jaeger ingest - "3100" # tempo tempo-query: image: grafana/tempo-query:latest - command: ["--grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml"] + command: [ "--grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml" ] volumes: - - ./etc/tempo-query.yaml:/etc/tempo-query.yaml + - ./tempo-query.yaml:/etc/tempo-query.yaml ports: - "16686:16686" # jaeger-ui depends_on: @@ -24,7 +24,7 @@ services: synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://tempo:14268 @@ -33,20 +33,16 @@ services: prometheus: image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml + - ../shared/prometheus.yaml:/etc/prometheus.yaml ports: - "9090:9090" grafana: - image: grafana/grafana:7.4.2 + image: grafana/grafana:7.4.5 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/grafana7.4/grafana-datasources.yaml b/example/docker-compose/grafana7.4/grafana-datasources.yaml new file mode 100644 index 00000000000..77932580280 --- /dev/null +++ b/example/docker-compose/grafana7.4/grafana-datasources.yaml @@ -0,0 +1,23 @@ +apiVersion: 1 + +datasources: +- name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + basicAuth: false + isDefault: false + version: 1 + editable: false +- name: 'Tempo-Query (Grafana 7.4)' # tempo-query is required for 7.4.x Grafana and before + type: tempo + access: proxy + orgId: 1 + url: http://tempo-query:16686 + basicAuth: false + isDefault: true + version: 1 + editable: false + apiVersion: 1 + uid: tempo-query \ No newline at end of file diff --git a/example/docker-compose/readme.grafana7.4.md b/example/docker-compose/grafana7.4/readme.md similarity index 59% rename from example/docker-compose/readme.grafana7.4.md rename to example/docker-compose/grafana7.4/readme.md index 8010021ab78..057bf0f2097 100644 --- a/example/docker-compose/readme.grafana7.4.md +++ b/example/docker-compose/grafana7.4/readme.md @@ -6,27 +6,28 @@ to pull this off. 1. First start up the stack. ```console -docker-compose -f docker-compose.grafana7.4.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.grafana7.4.yaml ps +docker-compose ps ``` ``` Name Command State Ports ------------------------------------------------------------------------------------------------------------------------------------- -dockercompose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -dockercompose_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp -dockercompose_synthetic-load-generator_1 ./start.sh Up -dockercompose_tempo-query_1 /go/bin/query-linux --grpc ... Up 0.0.0.0:16686->16686/tcp -dockercompose_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59541->14268/tcp, 0.0.0.0:59542->3100/tcp +grafana74_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +grafana74_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp +grafana74_synthetic-load-generator_1 ./start.sh Up +grafana74_tempo-query_1 /go/bin/query-linux --grpc ... Up 0.0.0.0:16686->16686/tcp +grafana74_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59541->14268/tcp, 0.0.0.0:59542->3100/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. + ```console -ls ./example-data/tempo +ls tempo-data/ ``` 3. The synthetic-load-generator is now printing out trace ids it's flushing into Tempo. To view its logs use - @@ -49,10 +50,12 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo-Query%20(Grafana%207.4)%22,%7B%7D%5D) and paste the trace id to request it from Tempo. Note that you are using the "Tempo-Query" datasource which is specially configured to look at tempo-query. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. + +> Note: This example uses the "Tempo-Query" datasource which is specially configured to look at tempo-query. 5. To stop the setup use - ```console -docker-compose -f docker-compose.grafana7.4.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/etc/tempo-query.yaml b/example/docker-compose/grafana7.4/tempo-query.yaml similarity index 100% rename from example/docker-compose/etc/tempo-query.yaml rename to example/docker-compose/grafana7.4/tempo-query.yaml diff --git a/example/docker-compose/docker-compose.yaml b/example/docker-compose/local/docker-compose.yaml similarity index 55% rename from example/docker-compose/docker-compose.yaml rename to example/docker-compose/local/docker-compose.yaml index 7cb0fe60fef..94e19f83730 100644 --- a/example/docker-compose/docker-compose.yaml +++ b/example/docker-compose/local/docker-compose.yaml @@ -1,12 +1,12 @@ -version: "2" +version: "3" services: tempo: image: grafana/tempo:latest - command: ["-config.file=/etc/tempo.yaml"] + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-local.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ./tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger ingest - "3100" # tempo @@ -17,7 +17,7 @@ services: synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://tempo:14268 @@ -26,20 +26,16 @@ services: prometheus: image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml + - ../shared/prometheus.yaml:/etc/prometheus.yaml ports: - "9090:9090" grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/readme.local.md b/example/docker-compose/local/readme.md similarity index 86% rename from example/docker-compose/readme.local.md rename to example/docker-compose/local/readme.md index 4f9cffd381e..c2790537e48 100644 --- a/example/docker-compose/readme.local.md +++ b/example/docker-compose/local/readme.md @@ -1,8 +1,9 @@ ## Local Storage -In this example all data is stored locally in the example-data/tempo folder. Local storage is fine for experimenting with Tempo +In this example all data is stored locally in the `tempo-data` folder. Local storage is fine for experimenting with Tempo or when using the single binary, but does not work in a distributed/microservices scenario. 1. First start up the local stack. + ```console docker-compose up -d ``` @@ -22,8 +23,9 @@ docker-compose_tempo_1 /tempo -storage.trace.back ... Up ``` 2. If you're interested you can see the wal/blocks as they are being created. + ```console -ls ./example-data/tempo +ls tempo-data/ ``` 3. The synthetic-load-generator is now printing out trace ids it's flushing into Tempo. To view its logs use - @@ -46,7 +48,7 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. Also notice that you can query Tempo metrics from the Prometheus data source setup in Grafana. 5. To stop the setup use - diff --git a/example/docker-compose/etc/tempo-local.yaml b/example/docker-compose/local/tempo-local.yaml similarity index 96% rename from example/docker-compose/etc/tempo-local.yaml rename to example/docker-compose/local/tempo-local.yaml index da35442412e..aa6ba6be039 100644 --- a/example/docker-compose/etc/tempo-local.yaml +++ b/example/docker-compose/local/tempo-local.yaml @@ -24,7 +24,7 @@ ingester: compactor: compaction: compaction_window: 1h # blocks in this time window will be compacted together - max_block_bytes: 100_000_000 # maximum size of compacted blocks + max_block_bytes: 100_000_000 # maximum size of compacted blocks block_retention: 1h compacted_block_retention: 10m diff --git a/example/docker-compose/docker-compose.loki.yaml b/example/docker-compose/loki/docker-compose.yaml similarity index 58% rename from example/docker-compose/docker-compose.loki.yaml rename to example/docker-compose/loki/docker-compose.yaml index a6fdecd478e..074dd86b058 100644 --- a/example/docker-compose/docker-compose.loki.yaml +++ b/example/docker-compose/loki/docker-compose.yaml @@ -1,15 +1,12 @@ -version: "2" +version: "3" services: tempo: image: grafana/tempo:latest - command: - - "-storage.trace.backend=local" # tell tempo where to permanently put traces - - "-storage.trace.local.path=/tmp/tempo/traces" - - "-storage.trace.wal.path=/tmp/tempo/wal" # tell tempo where to store the wal - - "-server.http-listen-port=3100" + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./example-data/tempo:/tmp/tempo + - ../local/tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger ingest logging: @@ -17,13 +14,26 @@ services: options: loki-url: 'http://localhost:3100/api/prom/push' + loki: + image: grafana/loki:2.1.0 + command: [ "-config.file=/etc/loki/local-config.yaml" ] + ports: + - "3100:3100" # loki needs to be exposed so it receives logs + environment: + - JAEGER_AGENT_HOST=tempo + - JAEGER_ENDPOINT=http://tempo:14268/api/traces # send traces to Tempo + - JAEGER_SAMPLER_TYPE=const + - JAEGER_SAMPLER_PARAM=1 + logging: + driver: loki + options: + loki-url: 'http://localhost:3100/api/prom/push' + prometheus: image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml + - ../shared/prometheus.yaml:/etc/prometheus.yaml ports: - "9090:9090" logging: @@ -32,32 +42,15 @@ services: loki-url: 'http://localhost:3100/api/prom/push' grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - GF_AUTH_DISABLE_LOGIN_FORM=true ports: - "3000:3000" - logging: - driver: loki - options: - loki-url: 'http://localhost:3100/api/prom/push' - - loki: - image: grafana/loki:2.1.0 - command: -config.file=/etc/loki/local-config.yaml - ports: - - "3100:3100" # loki needs to be exposed so it receives logs - environment: - - JAEGER_AGENT_HOST=tempo - - JAEGER_ENDPOINT=http://tempo:14268/api/traces # send traces to Tempo - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 logging: driver: loki options: diff --git a/example/docker-compose/example-data/datasources/datasource.yml b/example/docker-compose/loki/grafana-datasources.yaml similarity index 52% rename from example/docker-compose/example-data/datasources/datasource.yml rename to example/docker-compose/loki/grafana-datasources.yaml index fc3fb81b663..bc2d4edd8f1 100644 --- a/example/docker-compose/example-data/datasources/datasource.yml +++ b/example/docker-compose/loki/grafana-datasources.yaml @@ -1,9 +1,5 @@ apiVersion: 1 -deleteDatasources: - - name: Prometheus - - name: Tempo - datasources: - name: Prometheus type: prometheus @@ -25,32 +21,6 @@ datasources: editable: false apiVersion: 1 uid: tempo -- name: Tempo-Multitenant - type: tempo - access: proxy - orgId: 1 - url: http://tempo - basicAuth: false - isDefault: false - version: 1 - editable: false - apiVersion: 1 - uid: tempo-authed - jsonData: - httpHeaderName1: 'X-Scope-OrgID' - secureJsonData: - httpHeaderValue1: 'foo-bar-baz' -- name: 'Tempo-Query (Grafana 7.4)' # tempo-query is required for 7.4.x Grafana and before - type: tempo - access: proxy - orgId: 1 - url: http://tempo-query:16686 - basicAuth: false - isDefault: false - version: 1 - editable: false - apiVersion: 1 - uid: tempo-query - name: Loki type: loki access: proxy diff --git a/example/docker-compose/readme.loki.md b/example/docker-compose/loki/readme.md similarity index 62% rename from example/docker-compose/readme.loki.md rename to example/docker-compose/loki/readme.md index 6522c9c99cd..e6e4d83b607 100644 --- a/example/docker-compose/readme.loki.md +++ b/example/docker-compose/loki/readme.md @@ -11,47 +11,43 @@ docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all 2. Next start up the Loki stack. ```console -docker-compose -f docker-compose.loki.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.loki.yaml ps +docker-compose ps ``` ``` Name Command State Ports ------------------------------------------------------------------------------------------------ -docker-compose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -docker-compose_loki_1 /usr/bin/loki -config.file ... Up 0.0.0.0:3100->3100/tcp -docker-compose_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp -docker-compose_tempo_1 /tempo -storage.trace.back ... Up 0.0.0.0:32774->14268/tcp +loki_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +loki_loki_1 /usr/bin/loki -config.file ... Up 0.0.0.0:3100->3100/tcp +loki_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp +loki_tempo_1 /tempo -storage.trace.back ... Up 0.0.0.0:32774->14268/tcp ``` 3. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Loki%22,%7B%7D%5D) and **query Loki a few times to generate some traces** (this setup does not use the synthetic load generator and all traces are generated from Loki). Something like the below works, but feel free to explore other options! ``` -{container_name="dockercompose_loki_1"} +{container_name="loki_loki_1"} ``` -> Note: When running docker-compose on a MacBook, the `container_name` would be `docker-compose_loki_1`. - 4. Now let's execute a query specifically looking for some trace ids. In an operational scenario you would normally be using Loki to search for things like query path, or status code, but we're just going to do this for the example: ``` -{container_name="dockercompose_loki_1"} |= "traceID" +{container_name="loki_loki_1"} |= "traceID" ``` -> Note: When running docker-compose on a MacBook, the `container_name` would be `docker-compose_loki_1`. - 5. Drop down the log line and click the Tempo link to jump directly from logs to traces! -![Tempo link](./tempo-link.png) +![Tempo link](tempo-link.png) 6. To stop the setup use - ```console -docker-compose -f docker-compose.loki.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/tempo-link.png b/example/docker-compose/loki/tempo-link.png similarity index 100% rename from example/docker-compose/tempo-link.png rename to example/docker-compose/loki/tempo-link.png diff --git a/example/docker-compose/otel-collector-multitenant/docker-compose.yaml b/example/docker-compose/otel-collector-multitenant/docker-compose.yaml new file mode 100644 index 00000000000..f42f5a6ddad --- /dev/null +++ b/example/docker-compose/otel-collector-multitenant/docker-compose.yaml @@ -0,0 +1,51 @@ +version: "3" +services: + + # Generate fake traces... + synthetic-load-generator: + image: omnition/synthetic-load-generator:1.0.25 + volumes: + - ../shared/load-generator.json:/etc/load-generator.json + environment: + - TOPOLOGY_FILE=/etc/load-generator.json + - JAEGER_COLLECTOR_URL=http://otel-collector:14268 + + # And put them in an OTEL collector pipeline... + otel-collector: + image: otel/opentelemetry-collector:0.27.0 + command: [ "--config=/etc/otel-collector.yaml" ] + volumes: + - ./otel-collector.multitenant.yaml:/etc/otel-collector.yaml + + # To eventually offload to Tempo... + tempo: + image: grafana/tempo:latest + command: [ "-multitenancy.enabled=true", "-config.file=/etc/tempo.yaml" ] + volumes: + - ../local/tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo + ports: + - "14268" # jaeger ingest + - "3100" # tempo + - "55680" # otlp grpc + - "55681" # otlp http + - "9411" # zipkin + + prometheus: + image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] + volumes: + - ../shared/prometheus.yaml:/etc/prometheus.yaml + ports: + - "9090:9090" + + grafana: + image: grafana/grafana:7.5.7 + volumes: + - ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml + environment: + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_AUTH_DISABLE_LOGIN_FORM=true + ports: + - "3000:3000" \ No newline at end of file diff --git a/example/docker-compose/otel-collector-multitenant/grafana-datasources.yaml b/example/docker-compose/otel-collector-multitenant/grafana-datasources.yaml new file mode 100644 index 00000000000..2f6554fd00f --- /dev/null +++ b/example/docker-compose/otel-collector-multitenant/grafana-datasources.yaml @@ -0,0 +1,27 @@ +apiVersion: 1 + +datasources: +- name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + basicAuth: false + isDefault: false + version: 1 + editable: false +- name: Tempo-Multitenant + type: tempo + access: proxy + orgId: 1 + url: http://tempo:3100 + basicAuth: false + isDefault: true + version: 1 + editable: false + apiVersion: 1 + uid: tempo-authed + jsonData: + httpHeaderName1: 'X-Scope-OrgID' + secureJsonData: + httpHeaderValue1: 'foo-bar-baz' \ No newline at end of file diff --git a/example/docker-compose/etc/otel-collector.multitenant.yaml b/example/docker-compose/otel-collector-multitenant/otel-collector.multitenant.yaml similarity index 100% rename from example/docker-compose/etc/otel-collector.multitenant.yaml rename to example/docker-compose/otel-collector-multitenant/otel-collector.multitenant.yaml diff --git a/example/docker-compose/readme.multitenant.md b/example/docker-compose/otel-collector-multitenant/readme.md similarity index 61% rename from example/docker-compose/readme.multitenant.md rename to example/docker-compose/otel-collector-multitenant/readme.md index 8f2937db98f..783a503b55c 100644 --- a/example/docker-compose/readme.multitenant.md +++ b/example/docker-compose/otel-collector-multitenant/readme.md @@ -1,29 +1,29 @@ -## OpenTelemetry Collector +## OpenTelemetry Collector Multitenant This example highlights setting up the OpenTelemetry Collector in a multitenant tracing pipeline. 1. First start up the stack. ```console -docker-compose -f docker-compose.multitenant.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.multitenant.yaml ps +docker-compose ps ``` ``` Name Command State Ports ---------------------------------------------------------------------------------------------------------- -dockercompose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -dockercompose_otel-collector_1 /otelcol --config=/etc/ote ... Up 55678/tcp, 55679/tcp -dockercompose_synthetic-load-generator_1 ./start.sh Up -dockercompose_tempo_1 /tempo --target=all --mult ... Up 0.0.0.0:8081->80/tcp +otel-collector-multitenant_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +otel-collector-multitenant_otel-collector_1 /otelcol --config=/etc/ote ... Up 55678/tcp, 55679/tcp +otel-collector-multitenant_synthetic-load-generator_1 ./start.sh Up +otel-collector-multitenant_tempo_1 /tempo --target=all --mult ... Up 0.0.0.0:8081->80/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. ```console -ls ./example-data/tempo +ls tempo-data/ ``` 3. The synthetic-load-generator is now printing out trace ids it's flushing into Tempo. To view its logs use - @@ -46,10 +46,10 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo-Multitenant%22,%7B%7D%5D) and paste the trace id to request it from Tempo. Note that you are using the "Tempo-Multitenant" datasource which includes a special header to select the tenant. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. Note that you are using the "Tempo-Multitenant" datasource which includes a special header to select the tenant. 5. To stop the setup use - ```console -docker-compose -f docker-compose.multitenant.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/docker-compose.otelcol.yaml b/example/docker-compose/otel-collector/docker-compose.yaml similarity index 52% rename from example/docker-compose/docker-compose.otelcol.yaml rename to example/docker-compose/otel-collector/docker-compose.yaml index ffb781e7661..bdbc6b7d5dd 100644 --- a/example/docker-compose/docker-compose.otelcol.yaml +++ b/example/docker-compose/otel-collector/docker-compose.yaml @@ -1,29 +1,29 @@ -version: "3.4" +version: "3" services: + # Generate fake traces... synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://otel-collector:14268 # And put them in an OTEL collector pipeline... otel-collector: - image: otel/opentelemetry-collector:0.16.0 + image: otel/opentelemetry-collector:0.27.0 + command: [ "--config=/etc/otel-collector.yaml" ] volumes: - - ./etc/otel-collector.yaml:/etc/otel-collector.yaml - command: - - --config=/etc/otel-collector.yaml + - ./otel-collector.yaml:/etc/otel-collector.yaml # To eventually offload to Tempo... tempo: image: grafana/tempo:latest - command: ["-config.file=/etc/tempo.yaml"] + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-local.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ../local/tempo-local.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger ingest - "3100" # tempo @@ -31,12 +31,18 @@ services: - "55681" # otlp http - "9411" # zipkin + prometheus: + image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] + volumes: + - ../shared/prometheus.yaml:/etc/prometheus.yaml + ports: + - "9090:9090" + grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/etc/otel-collector.yaml b/example/docker-compose/otel-collector/otel-collector.yaml similarity index 100% rename from example/docker-compose/etc/otel-collector.yaml rename to example/docker-compose/otel-collector/otel-collector.yaml diff --git a/example/docker-compose/readme.otelcol.md b/example/docker-compose/otel-collector/readme.md similarity index 65% rename from example/docker-compose/readme.otelcol.md rename to example/docker-compose/otel-collector/readme.md index 14b7a6a6029..d99aea54f48 100644 --- a/example/docker-compose/readme.otelcol.md +++ b/example/docker-compose/otel-collector/readme.md @@ -4,28 +4,29 @@ This example highlights setting up the OpenTelemetry Collector in a simple traci 1. First start up the stack. ```console -docker-compose -f docker-compose.otelcol.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - ```console -docker-compose -f docker-compose.otelcol.yaml ps +docker-compose ps ``` ``` Name Command State Ports ---------------------------------------------------------------------------------------------------------- -dockercompose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -dockercompose_otel-collector_1 /otelcol --config=/etc/ote ... Up 55678/tcp, 55679/tcp -dockercompose_synthetic-load-generator_1 ./start.sh Up -dockercompose_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59538->14268/tcp, 0.0.0.0:59540->3100/tcp, +otel-collector_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +otel-collector_otel-collector_1 /otelcol --config=/etc/ote ... Up 55678/tcp, 55679/tcp +otel-collector_synthetic-load-generator_1 ./start.sh Up +otel-collector_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:59538->14268/tcp, 0.0.0.0:59540->3100/tcp, 0.0.0.0:59537->55680/tcp, 0.0.0.0:59536->55681/tcp, 0.0.0.0:59539->9411/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. + ```console -ls ./example-data/tempo +ls tempo-data/ ``` 3. The synthetic-load-generator is now printing out trace ids it's flushing into Tempo. To view its logs use - @@ -48,10 +49,10 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. 5. To stop the setup use - ```console -docker-compose -f docker-compose.otelcol.yaml down -v +docker-compose down -v ``` diff --git a/example/docker-compose/readme.md b/example/docker-compose/readme.md index 60a4b59b1f5..cc70127b44f 100644 --- a/example/docker-compose/readme.md +++ b/example/docker-compose/readme.md @@ -7,23 +7,29 @@ If you are interested in more complex configuration we would recommend the [tank ### Examples -- [Loki Derived Fields](./readme.loki.md) +The easiest example to start with is [Local Storage](local/readme.md): this example will run Tempo as a single binary +together with the synthetic-load-generator, to generate traces, and Grafana, to query Tempo. Data is stored locally on +disk. + +The following examples showcase specific features or integrations: + +- [Loki Derived Fields](loki/readme.md) Highlights use of Loki derived fields to jump directly from logs -> traces. -- [Grafana Agent](./readme.agent.md) +- [Grafana Agent](agent/readme.md) Simple example using the Grafana Agent as a tracing pipeline. -- [OTel Collector](./readme.otelcol.md) +- [OpenTelemetry Collector](otel-collector/readme.md) Simple example using the OpenTelemetry Collector as a tracing pipeline. -- [Multitenant](./readme.multitenant.md) +- [OpenTelemetry Collector Multitenant](otel-collector-multitenant/readme.md) Uses the OpenTelemetry Collector in an advanced multitenant configuration. -- [Grafana 7.4.x](./readme.grafana7.4.md) +- [Grafana 7.4.x](grafana7.4/readme.md) Uses tempo-query to allow for querying from Grafana 7.4 and before. -These examples show off configuration of different storage backends. +These examples show off configuration of different storage backends: -- [Local Storage](./readme.local.md) -- [S3/Minio](./readme.s3.md) -- [Azure/Azurite](./readme.azure.md) -- [GCS/Fake](./readme.gcs.md) +- [Local Storage](local/readme.md) +- [S3/Minio](s3/readme.md) +- [Azure/Azurite](azure/readme.md) +- [GCS/Fake](gcs/readme.md) ### Build Images (Optional) diff --git a/example/docker-compose/docker-compose.s3.minio.yaml b/example/docker-compose/s3/docker-compose.yaml similarity index 59% rename from example/docker-compose/docker-compose.s3.minio.yaml rename to example/docker-compose/s3/docker-compose.yaml index dc11f469da3..0c142e44f90 100644 --- a/example/docker-compose/docker-compose.s3.minio.yaml +++ b/example/docker-compose/s3/docker-compose.yaml @@ -1,15 +1,12 @@ -version: "2" +version: "3" services: tempo: image: grafana/tempo:latest - entrypoint: - - sh - - -euc - - sleep 5 && /tempo -config.file=/etc/tempo.yaml + command: [ "-config.file=/etc/tempo.yaml" ] volumes: - - ./etc/tempo-s3-minio.yaml:/etc/tempo.yaml - - ./example-data/tempo:/tmp/tempo + - ./tempo-s3.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo ports: - "14268" # jaeger - "3100:3100" # tempo @@ -31,7 +28,7 @@ services: synthetic-load-generator: image: omnition/synthetic-load-generator:1.0.25 volumes: - - ./etc/load-generator.json:/etc/load-generator.json + - ../shared/load-generator.json:/etc/load-generator.json environment: - TOPOLOGY_FILE=/etc/load-generator.json - JAEGER_COLLECTOR_URL=http://tempo:14268 @@ -40,20 +37,16 @@ services: prometheus: image: prom/prometheus:latest + command: [ "--config.file=/etc/prometheus.yaml" ] volumes: - - ./etc/prometheus.yaml:/etc/prometheus.yaml - entrypoint: - - /bin/prometheus - - --config.file=/etc/prometheus.yaml + - ../shared/prometheus.yaml:/etc/prometheus.yaml ports: - "9090:9090" grafana: - image: grafana/grafana:7.5.1 + image: grafana/grafana:7.5.7 volumes: - - ./example-data/datasources:/etc/grafana/provisioning/datasources - - ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards - - ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards + - ../shared/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin diff --git a/example/docker-compose/readme.s3.md b/example/docker-compose/s3/readme.md similarity index 67% rename from example/docker-compose/readme.s3.md rename to example/docker-compose/s3/readme.md index 8bc85b178b7..82a10a62a03 100644 --- a/example/docker-compose/readme.s3.md +++ b/example/docker-compose/s3/readme.md @@ -3,7 +3,7 @@ In this example tempo is configured to write data to S3 via MinIO which presents 1. First start up the s3 stack. ```console -docker-compose -f docker-compose.s3.minio.yaml up -d +docker-compose up -d ``` At this point, the following containers should be spun up - @@ -14,11 +14,11 @@ docker-compose ps ``` Name Command State Ports ------------------------------------------------------------------------------------------------------------------------------------- -docker-compose_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp -docker-compose_minio_1 sh -euc mkdir -p /data/tem ... Up 0.0.0.0:9000->9000/tcp -docker-compose_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp -docker-compose_synthetic-load-generator_1 ./start.sh Up -docker-compose_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:32770->14268/tcp, 0.0.0.0:3100->3100/tcp +s3_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp +s3_minio_1 sh -euc mkdir -p /data/tem ... Up 0.0.0.0:9000->9000/tcp +s3_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp +s3_synthetic-load-generator_1 ./start.sh Up +s3_tempo_1 /tempo -config.file=/etc/t ... Up 0.0.0.0:32770->14268/tcp, 0.0.0.0:3100->3100/tcp ``` 2. If you're interested you can see the wal/blocks as they are being created. Navigate to minio at @@ -44,11 +44,11 @@ Emitted traceId for service frontend route /cart Copy one of these trace ids. -4. Navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Tempo%22,%7B%7D%5D) and paste the trace id to request it from Tempo. +4. Navigate to [Grafana](http://localhost:3000/explore) and paste the trace id to request it from Tempo. Also notice that you can query Tempo metrics from the Prometheus data source setup in Grafana. 5. To stop the setup use - ```console -docker-compose -f docker-compose.s3.minio.yaml down -v +docker-compose down -v ``` \ No newline at end of file diff --git a/example/docker-compose/etc/tempo-s3-minio.yaml b/example/docker-compose/s3/tempo-s3.yaml similarity index 100% rename from example/docker-compose/etc/tempo-s3-minio.yaml rename to example/docker-compose/s3/tempo-s3.yaml diff --git a/example/docker-compose/shared/grafana-datasources.yaml b/example/docker-compose/shared/grafana-datasources.yaml new file mode 100644 index 00000000000..75f8964b98a --- /dev/null +++ b/example/docker-compose/shared/grafana-datasources.yaml @@ -0,0 +1,23 @@ +apiVersion: 1 + +datasources: +- name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + basicAuth: false + isDefault: false + version: 1 + editable: false +- name: Tempo + type: tempo + access: proxy + orgId: 1 + url: http://tempo:3100 + basicAuth: false + isDefault: true + version: 1 + editable: false + apiVersion: 1 + uid: tempo \ No newline at end of file diff --git a/example/docker-compose/etc/load-generator.json b/example/docker-compose/shared/load-generator.json similarity index 100% rename from example/docker-compose/etc/load-generator.json rename to example/docker-compose/shared/load-generator.json diff --git a/example/docker-compose/etc/prometheus.yaml b/example/docker-compose/shared/prometheus.yaml similarity index 70% rename from example/docker-compose/etc/prometheus.yaml rename to example/docker-compose/shared/prometheus.yaml index 68e97b8b1a8..8e491bfb42a 100644 --- a/example/docker-compose/etc/prometheus.yaml +++ b/example/docker-compose/shared/prometheus.yaml @@ -5,7 +5,7 @@ global: scrape_configs: - job_name: 'prometheus' static_configs: - - targets: ['localhost:9090'] + - targets: [ 'localhost:9090' ] - job_name: 'tempo' static_configs: - - targets: ['tempo:3100'] \ No newline at end of file + - targets: [ 'tempo:3100' ] \ No newline at end of file