Documentation
¶
Index ¶
- func Generate() string
- func Get(ctx context.Context) (t string)
- func GetJob(ctx context.Context) (job string)
- func InitProvider(ctx context.Context, cfg ProviderConfig) (func(context.Context) error, error)
- func Set(ctx context.Context, trace string) context.Context
- func SetJob(ctx context.Context, job string) context.Context
- type ProviderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJob ¶ added in v3.14.0
GetJob returns the name of the background job that caused the request.
func InitProvider ¶ added in v3.7.0
InitProvider sets up the global OTel TracerProvider and W3C TraceContext propagator.
If tracing is disabled or no endpoint is configured, the provider returned is just a nop.
The returned shutdown function must be called (e.g. via defer) to flush and stop the exporter.
Types ¶
type ProviderConfig ¶ added in v3.7.0
type ProviderConfig struct {
Enabled bool
Endpoint string // OTLP/gRPC endpoint, e.g. "localhost:4317"
Collector string // OTLP/HTTP collector URL, e.g. "http://localhost:4318"
ServiceName string
Log *zerolog.Logger
}
ProviderConfig holds the tracing configuration.