Documentation
¶
Overview ¶
Package telemetry installs OpenTelemetry through xtrace's SDK bootstrap: resource from the build identity, exporters from the standard OTEL_* environment. A signal without an OTLP endpoint is not exported (xtrace decides per signal), so a service never retries a collector that does not exist.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHistogram = errors.New("telemetry: histogram rule")
ErrHistogram: a histogram rule is invalid.
var ErrSampler = errors.New("unknown sampler")
ErrSampler: an unknown sampler.
var MillisecondsBoundaries = []float64{5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000}
MillisecondsBoundaries are SecondsBoundaries in milliseconds.
var SecondsBoundaries = []float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}
SecondsBoundaries are the buckets of a duration in seconds: OpenTelemetry's semantic conventions for request durations, 5 ms to 10 s.
Functions ¶
func Builtin ¶ added in v0.6.16
Builtin are the rules after the configured ones: a duration gets buckets of its unit instead of OpenTelemetry's defaults (0 to 10000, made for milliseconds, useless for seconds).
func HistogramView ¶ added in v0.6.16
HistogramView is one view applying rules, then Builtin, to every histogram: the first rule matching its name (and unit) decides its aggregation. One view, not one per rule: OpenTelemetry exports a stream per matching view, so overlapping rules would duplicate the histogram.
Types ¶
type Identity ¶
type Identity struct {
Service, Version, Instance, Environment string
}
Identity stamped into the resource.
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry is a lifecycle component; start it first, it stops last.