hopperotel

package module
v0.10.1 Latest Latest
Warning

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

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

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 New

func New(cfg *Config) hopper.Middleware

New returns tracing and metrics middleware.

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.

Jump to

Keyboard shortcuts

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