Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureTracerProvider(config Config) (trace.TracerProvider, error)
- func EchoFirstTraceNodeInfo(propagator propagation.TextMapPropagator) func(http.Handler) http.Handler
- func ExtractTraceInfo(ctx context.Context) (string, string, bool)
- func GetMuxOptions(tr Tracing) []otelmux.Option
- func NewTransport(tr Tracing) *otelhttp.Transport
- type Config
- type ProviderConstructor
- type TraceConfig
- type Tracing
Constants ¶
View Source
const ( SpanIDLogKeyName = "span-id" TraceIdLogKeyName = "trace-id" )
View Source
const DefaultTracerProvider = "noop"
Variables ¶
View Source
var ( ErrTracerProviderNotFound = errors.New("TracerProvider could not be found") ErrTracerProviderBuildFailed = errors.New("Failed building TracerProvider") )
Functions ¶
func ConfigureTracerProvider ¶
func ConfigureTracerProvider(config Config) (trace.TracerProvider, error)
func EchoFirstTraceNodeInfo ¶
func EchoFirstTraceNodeInfo(propagator propagation.TextMapPropagator) func(http.Handler) http.Handler
EchoFirstNodeTraceInfo captures the trace information from a request and writes it back in the response headers if the request is the first one in the trace path.
func ExtractTraceInfo ¶
ExtractTraceInfo returns the ID of the trace flowing through the context as well as ID the current active span. The third boolean return value represents whether the returned IDs are valid and safe to use. OpenTelemetry's noop tracer provider, for instance, returns zero value trace information that's considered invalid and should be ignored.
func GetMuxOptions ¶
func NewTransport ¶
Types ¶
type ProviderConstructor ¶
type ProviderConstructor func(config Config) (trace.TracerProvider, error)
ProviderConstructor is useful when client wants to add their own custom TracerProvider.
type TraceConfig ¶
type TraceConfig struct {
TraceProvider trace.TracerProvider
}
type Tracing ¶
type Tracing struct { // TracerProvider helps create trace spans. TracerProvider trace.TracerProvider // Propagator helps propagate trace context across API boundaries as a cross-cutting concern. Propagator propagation.TextMapPropagator }
Click to show internal directories.
Click to hide internal directories.