From 1889a0c9e63a6041d97b5cc115f0ea38aa3296c5 Mon Sep 17 00:00:00 2001 From: Til Blechschmidt Date: Mon, 10 May 2021 15:58:39 +0200 Subject: [PATCH] :whale: Add tracing demo support for Docker --- distribution/docker/docker-compose.yml | 18 ++++++------- test/otel-collector-config.yaml | 35 ++++++++++++++++++++++++++ test/tracing-compose.yml | 31 +++++++++++++++++++++++ 3 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 test/otel-collector-config.yaml create mode 100644 test/tracing-compose.yml diff --git a/distribution/docker/docker-compose.yml b/distribution/docker/docker-compose.yml index ad27f388..bb48109d 100644 --- a/distribution/docker/docker-compose.yml +++ b/distribution/docker/docker-compose.yml @@ -4,7 +4,7 @@ services: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-proxy - command: proxy --log debug,hyper=warn + command: proxy --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 ports: - 8080:40005 depends_on: @@ -13,14 +13,14 @@ services: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-manager - command: manager example-manager webgrid-manager --log debug,hyper=warn + command: manager example-manager webgrid-manager --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 depends_on: - redis orchestrator: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-orchestrator - command: orchestrator --slot-count 5 example-orchestrator docker --images "${REPOSITORY:-webgrid}/node-firefox:${IMAGE_TAG:-latest}=firefox::68.7.0esr,${REPOSITORY:-webgrid}/node-chrome:${IMAGE_TAG:-latest}=chrome::81.0.4044.122" --log debug,hyper=warn + command: orchestrator --slot-count 5 example-orchestrator docker --images "${REPOSITORY:-webgrid}/node-firefox:${IMAGE_TAG:-latest}=firefox::68.7.0esr,${REPOSITORY:-webgrid}/node-chrome:${IMAGE_TAG:-latest}=chrome::81.0.4044.122" --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 ${ORCHESTRATOR_FLAGS:-} depends_on: - redis volumes: @@ -29,7 +29,7 @@ services: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-storage - command: storage --log debug,hyper=warn --host webgrid-storage --storage-directory /storage --size-limit 10 + command: storage --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 --host webgrid-storage --storage-directory /storage --size-limit 10 depends_on: - redis volumes: @@ -38,20 +38,20 @@ services: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-gc - command: gc --log debug + command: gc --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 depends_on: - redis api: image: ${REPOSITORY:-webgrid}/core:${IMAGE_TAG:-latest} platform: linux/amd64 container_name: webgrid-api - command: api --log debug,hyper=warn --host webgrid-api + command: api --log debug,hyper=warn,warp=warn,sqlx=warn,tower=warn,h2=warn --trace-endpoint http://webgrid-otelcol:4317 --host webgrid-api depends_on: - redis redis: image: redis:6.2-alpine container_name: webgrid-redis - command: redis-server --notify-keyspace-events Kgx + command: redis-server --notify-keyspace-events Kgx --save "" --appendonly no ports: - 6379:6379 volumes: @@ -60,5 +60,5 @@ volumes: networks: default: - external: - name: webgrid + external: true + name: webgrid diff --git a/test/otel-collector-config.yaml b/test/otel-collector-config.yaml new file mode 100644 index 00000000..1a822eee --- /dev/null +++ b/test/otel-collector-config.yaml @@ -0,0 +1,35 @@ +receivers: + otlp: + protocols: + http: + grpc: + +exporters: + logging: + loglevel: debug + + jaeger: + endpoint: jaeger-all-in-one:14250 + insecure: true + +processors: + batch: + +extensions: + health_check: + pprof: + endpoint: :1888 + zpages: + endpoint: :55679 + +service: + extensions: [pprof, zpages, health_check] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [logging, jaeger] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [logging] diff --git a/test/tracing-compose.yml b/test/tracing-compose.yml new file mode 100644 index 00000000..50bafb80 --- /dev/null +++ b/test/tracing-compose.yml @@ -0,0 +1,31 @@ +version: "2" +services: + # Jaeger + jaeger-all-in-one: + image: jaegertracing/all-in-one:latest + container_name: webgrid-jaeger + ports: + - "16686:16686" + - "14268" + - "14250" + + # Collector + otel-collector: + image: otel/opentelemetry-collector-dev:latest + container_name: webgrid-otelcol + command: ["--config=/etc/otel-collector-config.yaml"] + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "1888:1888" # pprof extension + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "55681:55681" # OTLP HTTP receiver + - "55670:55679" # zpages extension + depends_on: + - jaeger-all-in-one + +networks: + default: + external: + name: webgrid