Documentation ¶
Overview ¶
Package otel provides otel support.
Index ¶
- func AddSpan(ctx context.Context, spanName string, keyValues ...attribute.KeyValue) (context.Context, trace.Span)
- func AddTraceToRequest(ctx context.Context, r *http.Request)
- func GetTraceID(ctx context.Context) string
- func InitTracing(log *logger.Logger, cfg Config) (trace.TracerProvider, func(ctx context.Context), error)
- func InjectTracing(ctx context.Context, tracer trace.Tracer) context.Context
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSpan ¶
func AddSpan(ctx context.Context, spanName string, keyValues ...attribute.KeyValue) (context.Context, trace.Span)
AddSpan adds an otel span to the existing trace.
func AddTraceToRequest ¶
AddTraceToRequest adds the current trace id to the request so it can be delivered to the service being called.
func GetTraceID ¶
GetTraceID returns the trace id from the context.
func InitTracing ¶
func InitTracing(log *logger.Logger, cfg Config) (trace.TracerProvider, func(ctx context.Context), error)
InitTracing configures open telemetry to be used with the service.
Types ¶
Click to show internal directories.
Click to hide internal directories.