Telemetry
Generated applications include structured logging, metrics, traces, and HTTP instrumentation through OpenTelemetry.
Process-local wiring
Both cmd/app and cmd/queue include the application-owned telemetry module. Fx starts and stops exporters with each process. Application and request logs use log/slog; pass context.Context so trace metadata can be attached.
Export configuration
1TELEMETRY_SERVICE_NAME=orbit
2TELEMETRY_SERVICE_VERSION=1.0.0
3OTLP_LOGS_ENDPOINT=
4OTLP_METRICS_ENDPOINT=https://collector.example.com
5OTLP_TRACES_ENDPOINT=https://collector.example.com
6OTLP_HEADERS=Authorization=Bearer token
7TRACE_SAMPLE_RATE=1.0
Batch size and timeout are configurable. The generated provider validates service identity, batch settings, and the trace sample rate before exporters start.
Instrument useful boundaries
Create spans around meaningful application operations and record stable route templates rather than raw, high-cardinality values. Never put passwords, tokens, complete email bodies, or unbounded user input into logs or telemetry attributes.