From f029e84565635a5ccc88a8f17643b439d182402a Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Mon, 8 Mar 2021 16:04:42 +0100 Subject: [PATCH] Devenv: Add tempo data source (#31138) * Add tempo DS to devenv * Remove unsupported values from config * Add tempo ds * Remove tempo-query --- devenv/datasources.yaml | 7 ++++ devenv/docker/blocks/loki/README.md | 18 ++++++++ devenv/docker/blocks/tempo/README.md | 4 ++ .../docker/blocks/tempo/docker-compose.yaml | 8 ++++ devenv/docker/blocks/tempo/tempo.yaml | 41 +++++++++++++++++++ 5 files changed, 78 insertions(+) create mode 100644 devenv/docker/blocks/loki/README.md create mode 100644 devenv/docker/blocks/tempo/README.md create mode 100644 devenv/docker/blocks/tempo/docker-compose.yaml create mode 100644 devenv/docker/blocks/tempo/tempo.yaml diff --git a/devenv/datasources.yaml b/devenv/datasources.yaml index 23d6e6b900c..6c7908385a4 100644 --- a/devenv/datasources.yaml +++ b/devenv/datasources.yaml @@ -269,3 +269,10 @@ datasources: access: proxy url: http://localhost:9411 editable: false + + - name: gdev-tempo + type: tempo + uid: gdev-tempo + access: proxy + url: http://localhost:3101 + editable: false diff --git a/devenv/docker/blocks/loki/README.md b/devenv/docker/blocks/loki/README.md new file mode 100644 index 00000000000..6a41456d78a --- /dev/null +++ b/devenv/docker/blocks/loki/README.md @@ -0,0 +1,18 @@ +By default this block is setup to scrape logs from /var/logs. If you need to log some service from the docker-compse you can add: +``` + # For this to work you need to install the logging driver see https://github.com/grafana/loki/tree/master/cmd/docker-driver#plugin-installation + logging: + driver: loki + options: + loki-url: "http://loki:3100/loki/api/v1/push" +``` + +This also works for self logging Loki logs if you use `http://localhost:3100/loki/api/v1/push`. This is useful together with +``` + environment: + - JAEGER_AGENT_HOST=tempo + - JAEGER_AGENT_PORT=6831 + - JAEGER_SAMPLER_TYPE=const + - JAEGER_SAMPLER_PARAM=1 +``` +which sets up a tracing and so you will have logs with traceIDs to test linking between logs and traces. diff --git a/devenv/docker/blocks/tempo/README.md b/devenv/docker/blocks/tempo/README.md new file mode 100644 index 00000000000..1c343a873b3 --- /dev/null +++ b/devenv/docker/blocks/tempo/README.md @@ -0,0 +1,4 @@ +Right now Tempo is before stable release so this uses :latest tag which means there can be changes depending on when +you pull the image. + +For adding some traces easily you can run Loki block and enable tracing (see ../loki/README.md) diff --git a/devenv/docker/blocks/tempo/docker-compose.yaml b/devenv/docker/blocks/tempo/docker-compose.yaml new file mode 100644 index 00000000000..045c4d65e0e --- /dev/null +++ b/devenv/docker/blocks/tempo/docker-compose.yaml @@ -0,0 +1,8 @@ + tempo: + image: grafana/tempo:latest + command: ["-config.file=/etc/tempo.yaml"] + ports: + - "6831:6831" + - "3101:3101" + volumes: + - ./docker/blocks/tempo/tempo.yaml:/etc/tempo.yaml diff --git a/devenv/docker/blocks/tempo/tempo.yaml b/devenv/docker/blocks/tempo/tempo.yaml new file mode 100644 index 00000000000..9e12ec58ae5 --- /dev/null +++ b/devenv/docker/blocks/tempo/tempo.yaml @@ -0,0 +1,41 @@ +auth_enabled: false + +server: + http_listen_port: 3101 + +distributor: + receivers: # this configuration will listen on all ports and protocols that tempo is capable of. + jaeger: # the receives all come from the OpenTelemetry collector. more configuration information can + protocols: # be found there: https://github.com/open-telemetry/opentelemetry-collector/tree/master/receiver + thrift_http: # + grpc: # for a production deployment you should only enable the receivers you need! + thrift_binary: + thrift_compact: + zipkin: + otlp: + protocols: + http: + grpc: + opencensus: + +ingester: + trace_idle_period: 10s # the length of time after a trace has not received spans to consider it complete and flush it + max_block_duration: 5m # this much time passes + +compactor: + compaction: + compaction_window: 1h # blocks in this time window will be compacted together + max_compaction_objects: 1000000 # maximum size of compacted blocks + block_retention: 1h + compacted_block_retention: 10m + +storage: + trace: + backend: local # backend configuration to use + wal: + path: /tmp/tempo/wal # where to store the the wal locally + local: + path: /tmp/tempo/blocks + pool: + max_workers: 100 # the worker pool mainly drives querying, but is also used for polling the blocklist + queue_depth: 10000