otel

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

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

Documentation

Overview

Command otel traces job work with OpenTelemetry. It records spans in memory and prints them; in production pass a TracerProvider with an OTLP exporter (configured by the standard OTEL_EXPORTER_OTLP_* variables).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL