Documentation ¶
Overview ¶
Package metrictransform provides translations for opentelemetry-go concepts and structures to otlp structures.
Index ¶
- Variables
- func InstrumentationLibraryReader(ctx context.Context, temporalitySelector aggregation.TemporalitySelector, ...) (*metricpb.ResourceMetrics, error)
- func Iterator(iter attribute.Iterator) []*commonpb.KeyValue
- func KeyValue(kv attribute.KeyValue) *commonpb.KeyValue
- func KeyValues(attrs []attribute.KeyValue) []*commonpb.KeyValue
- func Record(temporalitySelector aggregation.TemporalitySelector, r export.Record) (*metricpb.Metric, error)
- func Resource(r *resource.Resource) *resourcepb.Resource
- func ResourceAttributes(resource *resource.Resource) []*commonpb.KeyValue
- func Value(v attribute.Value) *commonpb.AnyValue
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnimplementedAgg is returned when a transformation of an unimplemented // aggregator is attempted. ErrUnimplementedAgg = errors.New("unimplemented aggregator") // ErrIncompatibleAgg is returned when // aggregation.Kind implies an interface conversion that has // failed ErrIncompatibleAgg = errors.New("incompatible aggregation type") // ErrUnknownValueType is returned when a transformation of an unknown value // is attempted. ErrUnknownValueType = errors.New("invalid value type") // ErrContextCanceled is returned when a context cancellation halts a // transformation. ErrContextCanceled = errors.New("context canceled") // ErrTransforming is returned when an unexected error is encountered transforming. ErrTransforming = errors.New("transforming failed") )
Functions ¶
func InstrumentationLibraryReader ¶ added in v0.24.0
func InstrumentationLibraryReader(ctx context.Context, temporalitySelector aggregation.TemporalitySelector, res *resource.Resource, ilmr export.InstrumentationLibraryReader, numWorkers uint) (*metricpb.ResourceMetrics, error)
InstrumentationLibraryReader transforms all records contained in a checkpoint into batched OTLP ResourceMetrics.
func KeyValues ¶ added in v0.23.0
KeyValues transforms a slice of attribute KeyValues into OTLP key-values.
func Record ¶
func Record(temporalitySelector aggregation.TemporalitySelector, r export.Record) (*metricpb.Metric, error)
Record transforms a Record into an OTLP Metric. An ErrIncompatibleAgg error is returned if the Record Aggregator is not supported.
func Resource ¶
func Resource(r *resource.Resource) *resourcepb.Resource
Resource transforms a Resource into an OTLP Resource.
func ResourceAttributes ¶
ResourceAttributes transforms a Resource OTLP key-values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.