You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-06 09:09:44 +02:00
Part of https://github.com/open-telemetry/opentelemetry-go/issues/5249 This makes all existing types designed to implement the public Exemplar API public by moving most of `internal/exemplar` to `exemplar`. The only types that are not being made public are `exemplar.Drop`, and `exemplar.FilteredReservoir`. Those types are moved to `internal/aggregate`, and are renamed to `DropReservoir` and `FilteredExemplarReservoir`. The following types are made public: * `exemplar.Exemplar` * `exemplar.Filter` * `exemplar.SampledFilter` * `exemplar.AlwaysOnFilter` * `exemplar.HistogramReservoir` * `exemplar.FixedSizeReservoir` * `exemplar.Reservoir` * `exemplar.Value` * `exemplar.ValueType`
30 lines
996 B
Go
30 lines
996 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar"
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.opentelemetry.io/otel/attribute"
|
|
)
|
|
|
|
// Exemplar is a measurement sampled from a timeseries providing a typical
|
|
// example.
|
|
type Exemplar struct {
|
|
// FilteredAttributes are the attributes recorded with the measurement but
|
|
// filtered out of the timeseries' aggregated data.
|
|
FilteredAttributes []attribute.KeyValue
|
|
// Time is the time when the measurement was recorded.
|
|
Time time.Time
|
|
// Value is the measured value.
|
|
Value Value
|
|
// SpanID is the ID of the span that was active during the measurement. If
|
|
// no span was active or the span was not sampled this will be empty.
|
|
SpanID []byte `json:",omitempty"`
|
|
// TraceID is the ID of the trace the active span belonged to during the
|
|
// measurement. If no span was active or the span was not sampled this will
|
|
// be empty.
|
|
TraceID []byte `json:",omitempty"`
|
|
}
|