Documentation
¶
Overview ¶
Package scope groups OpenTelemetry instruments under one instrumentation scope name.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChildOnly ¶ added in v1.1.4
func ChildOnly(provider trace.TracerProvider) trace.TracerProvider
ChildOnly wraps provider so its tracers start a span only under a parent: a context carrying a valid span context, local or remote. Without one they start nothing and return the context unchanged with its non-recording span. Given to an instrumented client (a database, a cache), it adds spans to the operations that use the client and never turns the client's own background work (polling, pings, sweeps) into root traces.
Types ¶
type Option ¶
type Option func(*options)
Option configures a Scope.
func WithErrorRenderer ¶ added in v1.3.0
WithErrorRenderer renders the errors every Run of this scope records (see span.WithErrorRenderer). Set it once on the service's scope; a Run option still overrides it.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider uses provider to construct the scope meter.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider uses provider to construct the scope tracer.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope owns commonly used OpenTelemetry instruments for a component.
func (*Scope) ErrorRenderer ¶ added in v1.3.0
ErrorRenderer returns the scope's error renderer (nil when unset), for helpers that record errors outside Run, such as xtrace.Call.