Skip to main content

Tracing

timeserver supports distributed tracing via OpenTelemetry. Traces can be exported to any OTLP-compatible backend (Jaeger, Tempo, Honeycomb, etc.).

Configuration

Environment variableDefaultDescription
OTEL_ENABLEDfalseSet to true to enable tracing
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint (e.g. http://localhost:4318)

Enable tracing locally

OTEL_ENABLED=true \
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
npm run dev

Running Jaeger locally

Jaeger ships an all-in-one image that accepts OTLP and hosts a UI:

docker run -d --name jaeger \
-p 4318:4318 \
-p 16686:16686 \
jaegertracing/all-in-one:latest

Then open http://localhost:16686 to view traces.

What gets traced

  • Every incoming HTTP request — span includes method, route, status code
  • Downstream calls (if any are added) — automatically instrumented via @opentelemetry/auto-instrumentations-node

Kubernetes

Pass the env vars via the Helm secret or ConfigMap:

# values.secret.yaml
secret:
create: true
data:
OTEL_ENABLED: "true"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4318"