transform

package
v0.0.0-...-79dcdee Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package transform 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 encoutered transforming.
	ErrTransforming = errors.New("transforming failed")
)

Functions

func Attributes

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

Attributes transforms a slice of KeyValues into a slice of OTLP attribute key-values.

func CheckpointSet

func CheckpointSet(ctx context.Context, exportSelector export.ExportKindSelector, cps export.CheckpointSet, numWorkers uint) ([]*metricpb.ResourceMetrics, error)

CheckpointSet transforms all records contained in a checkpoint into batched OTLP ResourceMetrics.

func Record

func Record(exportSelector export.ExportKindSelector, 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 into a slice of OTLP attribute key-values.

func SpanData

func SpanData(sdl []*export.SpanSnapshot) []*tracepb.ResourceSpans

SpanData transforms a slice of SpanSnapshot into a slice of OTLP ResourceSpans.

Types

This section is empty.

Jump to

Keyboard shortcuts

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