Documentation
¶
Overview ¶
Package traces provides helper functions for tracing with OpenTelemetry SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTracerProvider ¶
func InitTracerProvider(log logr.Logger, otelCollectorAddress string, dialTimeout, exportInterval time.Duration) (func(context.Context), error)
InitTracerProvider configures a global tracer provider and dials to the OTEL Collector. Failing in doing so returns an error since service actively export their traces and require the Collector to be up. Returns a shutdown function that should be called at the end of the program to flush all in-momory traces.
func InjectTraceAndLogger ¶ added in v1.0.4
func InjectTraceAndLogger(ctx context.Context, baseLogger logr.Logger) (context.Context, logr.Logger)
InjectTraceAndLogger returns a context and logger enriched with trace ID (if available). If a logger already exists in the context, it returns it directly.
func SetAndRecordError ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.