âī¸Tracing
Micro-service Architecture has now become the obvious choice for application developers, but how can you debug and monitor a set of interdependent distributed services? Here comes OpenTelemetry to help us.
GraphQL Rocket Generator, includes an OpenTelemetry integration using Jaeger, helping you to monitor all the components of your GraphQL server ( SQL, Knex statements, GraphQL request life-cycle both Http and WebSocket and of course traces requests and events handled in your messaging handlers.
This feature includes tracing setup code found in src/startup/tracing
, and tracing middleware you can find in :
src/middleware/tracing
,src/messaging/middleware/tracing
,src/pubsub/middleware/tracingPublish
src/subscriptions/middleware/tracing
In addition, to activate this option, you will need to make a few configuration in server's .env
file:
OTEL_SERVICE_NAME=<%= projectName %>
OTEL_TRACING_ENABLED=true
OTEL_TRACE_PROXY=false
Testing tracing locally
Prerequisites:
docker run --rm --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 14250:14250 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 \
jaegertracing/all-in-one:1.62.0
Make sure your services are configured to use your collector on port
4317
, or the one specified in Jaeger All-in-one
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
Access Jaeger Frontend, at e.g.:
http://localhost:16686/
Last updated