Documentation
¶
Overview ¶
Package hopperotel instruments hopper with OpenTelemetry.
client, err := hopper.NewClient(driver, &hopper.Config{
Middleware: []hopper.Middleware{hopperotel.Middleware(otel.GetTracerProvider())},
})
unregister, err := hopperotel.RegisterStats(client, otel.GetMeterProvider())
The middleware propagates trace context from insert to work through the job's metadata, records a span per attempt, and counts attempts and their duration by kind, queue and outcome. RegisterStats adds observable gauges for queue depth and the age of the oldest claimable job.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(tp trace.TracerProvider) hopper.Middleware
Middleware returns tracing and metrics middleware on the given tracer provider and the global meter provider and propagator.
func RegisterStats ¶
func RegisterStats[TTx any](client *hopper.Client[TTx], mp metric.MeterProvider) (func() error, error)
RegisterStats registers observable gauges for queue depth by state ("hopper.queue.depth"), the age of the oldest claimable job ("hopper.queue.oldest_available") and the number of live clients ("hopper.clients"), read from client.Stats on each collection. Call the returned function to unregister.
Types ¶
type Config ¶
type Config struct {
TracerProvider trace.TracerProvider
MeterProvider metric.MeterProvider
Propagator propagation.TextMapPropagator
}
Config selects the providers. Nil fields use the globals from the otel package.