Documentation
¶
Overview ¶
Package tracing provides OpenTelemetry initialization and W3C trace context propagation.
Index ¶
- func EndSpan(span trace.Span, err error, attrs ...attribute.KeyValue)
- func InjectGRPCMetadata(ctx context.Context, md metadata.MD)
- func InjectHTTPHeaders(ctx context.Context, headers http.Header)
- func StartRequestSpan(ctx context.Context, tracer trace.Tracer, protocol, endpoint string) (context.Context, trace.Span)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectGRPCMetadata ¶
InjectGRPCMetadata injects W3C trace context into gRPC metadata.
func InjectHTTPHeaders ¶
InjectHTTPHeaders injects W3C trace context into HTTP headers.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps the OTel TracerProvider and provides convenience methods.
func Init ¶
Init creates an OTel TracerProvider from config. Returns a no-op provider if tracing is disabled.
func (*Provider) ShouldPropagate ¶
ShouldPropagate returns whether W3C trace headers should be injected.
Click to show internal directories.
Click to hide internal directories.