metrictransform

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package metrictransform provides translations for opentelemetry-go concepts and structures to otlp structures.

Index

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 Iterator added in v0.23.0

func Iterator(iter attribute.Iterator) []*commonpb.KeyValue

Iterator transforms an attribute iterator into OTLP key-values.

func KeyValue added in v0.23.0

func KeyValue(kv attribute.KeyValue) *commonpb.KeyValue

KeyValue transforms an attribute KeyValue into an OTLP key-value.

func KeyValues added in v0.23.0

func KeyValues(attrs []attribute.KeyValue) []*commonpb.KeyValue

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

func ResourceAttributes(resource *resource.Resource) []*commonpb.KeyValue

ResourceAttributes transforms a Resource OTLP key-values.

func Value added in v0.23.0

func Value(v attribute.Value) *commonpb.AnyValue

Value transforms an attribute Value into an OTLP AnyValue.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL