diff --git a/.env.example b/.env.example index 7928982e..4fe7b95d 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1 @@ DASHBOARD_LICENCE=add_your_dashboard_licence_here -TRACING_ENABLED=false -INSTRUMENTATION_ENABLED=0 diff --git a/README.md b/README.md index 1538c241..dfb6950f 100755 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ All of the directories contain `docker-compose.yml`, `bootstrap.sh` and `README. * [SLIs and SLOs with Prometheus and Grafana](deployments/slo-prometheus-grafana/README.md) * [SSO](deployments/sso/README.md) * [WAF](deployments/waf/README.md) -* [Zipkin](deployments/tracing/README.md) +* (deprecated) [OpenTracing/Zipkin] ## Environment variables diff --git a/deployments/mdcb/docker-compose.yml b/deployments/mdcb/docker-compose.yml index a46a9013..20d56b2e 100644 --- a/deployments/mdcb/docker-compose.yml +++ b/deployments/mdcb/docker-compose.yml @@ -25,6 +25,8 @@ services: - TYK_INSTRUMENTATION=${INSTRUMENTATION_ENABLED:-0} - TYK_GW_TRACER_ENABLED=${TRACING_ENABLED:-0} - TYK_GW_SLAVEOPTIONS_APIKEY=${MDCB_USER_API_CREDENTIALS:-placeholder} + - TYK_GW_OPENTELEMETRY_ENABLED=${OPENTELEMETRY_ENABLED:-false} + - TYK_GW_OPENTELEMETRY_ENDPOINT=${OPENTELEMETRY_ENDPOINT:-false} volumes: - ./deployments/mdcb/volumes/tyk-worker-gateway/tyk.conf:/opt/tyk-gateway/tyk.conf - ./deployments/tyk/volumes/tyk-gateway/certs:/opt/tyk-gateway/certs diff --git a/deployments/otel-jaeger/README.md b/deployments/otel-jaeger/README.md index d3b51f4d..2b0e3e0d 100644 --- a/deployments/otel-jaeger/README.md +++ b/deployments/otel-jaeger/README.md @@ -1,10 +1,11 @@ -# Jaeger +# OpenTelemetry with Jaeger -Jaeger can demonstrate tracing via Open Telemetry. It has a [Dashboard](http://localhost:16686/) you can use to view traces. +Discover the distributed traces generated by Tyk Gateway through [Jaeger](http://localhost:16686/). -It has been configured to use in-memory storage, so will not retain data once the container is restarted/removed. +Jaeger is configured to use in-memory storage, implying that data won't persist once the container is restarted or removed. + +For further information on Tyk OpenTelemetry support, refer to Tyk's documentation: [Tyk OpenTelemetry Overview](https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/distributed-tracing/open-telemetry/open-telemetry-overview/). -- [Jaeger Dashboard](http://localhost:16686/) ## Setup @@ -16,10 +17,10 @@ Run the `up.sh` script with the `otel-jaeger` parameter: ## Usage -To use Jaeger, open the [Jaeger Dashboard](http://localhost:16686/) in a browser. The _Search_ page displays trace data based on filters: +Open [Jaeger](http://localhost:16686/) in a browser. The _Search_ page displays trace data based on filters: - For _Service_, select `tyk-gateway` to see traces from the Tyk gateway, or select `jaeger-query` to see traces from the Jaeger application. - The values for _Operation_ change based on the _service_. Leave it on `all` to see everything. - _Lookback_ filters by time, by limiting displayed data to the selected time period. -Tyk Demo generates trace data as a byproduct of the bootstrap process, so you should see trace entries for the `tyk-gateway` service without having to send any API requests yourself. However, if you don't see any data, try increasing the duration of the _Lookback_ filter to a longer period, or generate some fresh trace data by [sending a basic request](http://tyk-gateway.localhost:8080/basic-open-api/get) to the Gateway. +Tyk Demo generates trace data during the bootstrap process, so you should see trace entries for the `tyk-gateway` service without having to send any API requests yourself. If you don't see any data, try increasing the duration of the _Lookback_ filter to a longer period, or generate some fresh trace data by [sending a basic request](http://tyk-gateway.localhost:8080/basic-open-api/get) to the Gateway. diff --git a/deployments/otel-jaeger/bootstrap.sh b/deployments/otel-jaeger/bootstrap.sh index 4805927a..6439d3e6 100755 --- a/deployments/otel-jaeger/bootstrap.sh +++ b/deployments/otel-jaeger/bootstrap.sh @@ -1,7 +1,7 @@ #!/bin/bash source scripts/common.sh -deployment="Open Telemetry + Jaeger" +deployment="OpenTelemetry + Jaeger" log_start_deployment bootstrap_progress @@ -12,8 +12,6 @@ log_message "Waiting for Jaeger to respond ok" wait_for_response "$jaeger_health_url" "200" bootstrap_progress -otc_health_url="http://localhost:13133" -wait_for_response "$otc_health_url" "200" bootstrap_progress log_end_deployment diff --git a/deployments/otel-jaeger/docker-compose.yml b/deployments/otel-jaeger/docker-compose.yml index 0faa10b0..bf1133ec 100644 --- a/deployments/otel-jaeger/docker-compose.yml +++ b/deployments/otel-jaeger/docker-compose.yml @@ -3,24 +3,13 @@ version: "2" services: # Jaeger jaeger-all-in-one: - image: jaegertracing/all-in-one:1.47 + image: jaegertracing/all-in-one:1.52 ports: - - "16686:16686" # Dashboard + - "16686:16686" # Jaeger UI + - "4317:4317" # OTLP receiver - "14269:14269" # Health Check networks: - tyk - # Collector - collector-gateway: - image: otel/opentelemetry-collector:0.81.0 - volumes: - - ./deployments/otel-jaeger/volumes/otel-collector.yml:/etc/otel-collector.yml - command: [ "--config=/etc/otel-collector.yml" ] - ports: - - "13133:13133" # health_check extension - depends_on: - - jaeger-all-in-one - networks: - - tyk networks: tyk: diff --git a/deployments/otel-jaeger/volumes/otel-collector.yml b/deployments/otel-jaeger/volumes/otel-collector.yml deleted file mode 100644 index 31160021..00000000 --- a/deployments/otel-jaeger/volumes/otel-collector.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -receivers: - otlp: - protocols: - http: - endpoint: 0.0.0.0:4318 - grpc: - endpoint: 0.0.0.0:4317 -processors: - batch: -exporters: - jaeger: - endpoint: jaeger-all-in-one:14250 - tls: - insecure: true -extensions: - health_check: - pprof: - endpoint: :1888 - zpages: - endpoint: :55679 -service: - extensions: [ pprof, zpages, health_check ] - pipelines: - traces: - receivers: [ otlp ] - processors: [ batch ] - exporters: [ jaeger ] diff --git a/deployments/tyk/docker-compose.yml b/deployments/tyk/docker-compose.yml index b035b921..e7309358 100755 --- a/deployments/tyk/docker-compose.yml +++ b/deployments/tyk/docker-compose.yml @@ -42,6 +42,7 @@ services: - TYK_GW_ANALYTICSCONFIG_ENABLEGEOIP=true - TYK_GW_ANALYTICSCONFIG_GEOIPDBLOCATION=/opt/tyk-gateway/databases/GeoLite2-Country.mmdb - TYK_GW_OPENTELEMETRY_ENABLED=${OPENTELEMETRY_ENABLED:-false} + - TYK_GW_OPENTELEMETRY_ENDPOINT=${OPENTELEMETRY_ENDPOINT:-false} env_file: - .env volumes: diff --git a/up.sh b/up.sh index c7a00f81..64739549 100755 --- a/up.sh +++ b/up.sh @@ -58,6 +58,12 @@ else set_docker_environment_value "OPENTELEMETRY_ENABLED" "false" fi +if [[ "$*" == *otel-jaeger* ]]; then + set_docker_environment_value "OPENTELEMETRY_ENDPOINT" "jaeger-all-in-one:4317" +else + set_docker_environment_value "OPENTELEMETRY_ENDPOINT" "" +fi + # deployment lists deployments_to_create=() commands_to_process=()