OpenTelemetry tracing
Sets Config.TracerProvider and prints the recorded spans: foreman.insert <kind> and foreman.work <kind> with job id, kind, queue and attempt attributes. In production use an OTLP exporter.
Run
docker compose -f deploy/docker-compose.yml up -d --wait postgres
go run ./examples/otel
The example connects to FOREMAN_DATABASE_URL (default
postgres://foreman:foreman@localhost:55432/foreman?sslmode=disable) and recreates its own schema
on every run.
Expected output
span: foreman.insert resize
span: foreman.work resize
foreman.job.attempt=1