Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Jaeger deployment #229

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
DASHBOARD_LICENCE=add_your_dashboard_licence_here
TRACING_ENABLED=false
INSTRUMENTATION_ENABLED=0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions deployments/mdcb/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions deployments/otel-jaeger/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
4 changes: 1 addition & 3 deletions deployments/otel-jaeger/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

source scripts/common.sh
deployment="Open Telemetry + Jaeger"
deployment="OpenTelemetry + Jaeger"
log_start_deployment
bootstrap_progress

Expand All @@ -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
Expand Down
17 changes: 3 additions & 14 deletions deployments/otel-jaeger/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
28 changes: 0 additions & 28 deletions deployments/otel-jaeger/volumes/otel-collector.yml

This file was deleted.

1 change: 1 addition & 0 deletions deployments/tyk/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=()
Expand Down
Loading