Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns a new HTTP handler that will trace all requests with the HTTP method and path as the span name.
func NewTracer ¶ added in v0.32.0
NewTracer returns a trace.Tracer that skips span creation when tracing is disabled. Use this instead of otel.Tracer().
func Transport ¶
func Transport(rt http.RoundTripper) http.RoundTripper
Transport wraps the provided http.RoundTripper with one that starts a span and injects the span context into the outbound request headers. If the provided http.RoundTripper is nil, http.DefaultTransport will be used as the base http.RoundTripper.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is capable of building, (re)installing and shutting down the tracer provider.
func NewManager ¶
NewManager creates a new tracing manager.
func (*Manager) ApplyConfig ¶
func (m *Manager) ApplyConfig(cfg TracingConfig) error
ApplyConfig takes care of refreshing the tracing configuration by shutting down the current tracer provider (if any is registered) and installing a new one.
type TracingClientType ¶ added in v0.32.0
type TracingClientType string
const ( TracingClientHTTP TracingClientType = "http" TracingClientGRPC TracingClientType = "grpc" GzipCompression = "gzip" )
func (*TracingClientType) UnmarshalYAML ¶ added in v0.32.0
func (t *TracingClientType) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type TracingConfig ¶ added in v0.32.0
type TracingConfig struct {
ClientType TracingClientType `yaml:"client_type,omitempty"`
Endpoint string `yaml:"endpoint,omitempty"`
SamplingFraction float64 `yaml:"sampling_fraction,omitempty"`
Insecure bool `yaml:"insecure,omitempty"`
TLSConfig *commoncfg.TLSConfig `yaml:"tls_config,omitempty"`
Headers *commoncfg.Headers `yaml:"headers,omitempty"`
Compression string `yaml:"compression,omitempty"`
Timeout model.Duration `yaml:"timeout,omitempty"`
}
TracingConfig configures the tracing options.
func (*TracingConfig) SetDirectory ¶ added in v0.32.0
func (t *TracingConfig) SetDirectory(dir string)
SetDirectory joins any relative file paths with dir.
func (*TracingConfig) UnmarshalYAML ¶ added in v0.32.0
func (t *TracingConfig) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.