transform

package
v0.12.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttrIter

func AttrIter(iter attribute.Iterator) []*cpb.KeyValue

AttrIter transforms an attribute iterator into OTLP key-values.

func DataPoints

func DataPoints[N int64 | float64](dPts []metricdata.DataPoint[N]) []*mpb.NumberDataPoint

DataPoints returns a slice of OTLP NumberDataPoint generated from dPts.

func Gauge

func Gauge[N int64 | float64](g metricdata.Gauge[N]) *mpb.Metric_Gauge

Gauge returns an OTLP Metric_Gauge generated from g.

func Histogram

func Histogram[N int64 | float64](h metricdata.Histogram[N]) (*mpb.Metric_Histogram, error)

Histogram returns an OTLP Metric_Histogram generated from h. An error is returned with a partial Metric_Histogram if the temporality of h is unknown.

func HistogramDataPoints

func HistogramDataPoints[N int64 | float64](dPts []metricdata.HistogramDataPoint[N]) []*mpb.HistogramDataPoint

HistogramDataPoints returns a slice of OTLP HistogramDataPoint generated from dPts.

func KeyValue

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

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

func KeyValues

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

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

func Metrics

func Metrics(ms []metricdata.Metrics) ([]*mpb.Metric, error)

Metrics returns a slice of OTLP Metric generated from ms. If ms contains invalid metric values, an error will be returned along with a slice that contains partial OTLP Metrics.

func ProtoDataPoints

func ProtoDataPoints[N int64 | float64](dPts []*mpb.NumberDataPoint) []metricdata.DataPoint[N]

func ProtoGauge

func ProtoGauge[N int64 | float64](g *mpb.Metric_Gauge) metricdata.Gauge[N]

Gauge returns a Gauge generated from Metric_Gauge.

func ProtoHistogramDataPoints

func ProtoHistogramDataPoints(dPts []*mpb.HistogramDataPoint) []metricdata.HistogramDataPoint[float64]

func ProtoMetrics

func ProtoMetrics(ms []*mpb.Metric) ([]metricdata.Metrics, error)

func ProtoScopeMetrics

func ProtoScopeMetrics(sms []*mpb.ScopeMetrics) ([]metricdata.ScopeMetrics, error)

func ProtoSum

func ProtoSum[N int64 | float64](s *mpb.Metric_Sum) (metricdata.Sum[N], error)

func ProtoToKeyValue

func ProtoToKeyValue(kv *cpb.KeyValue) attribute.KeyValue

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

func ProtoToKeyValues

func ProtoToKeyValues(attrs []*cpb.KeyValue) []attribute.KeyValue

func ProtoToValue

func ProtoToValue(val *cpb.AnyValue) attribute.Value

ProtoToValue transforms an OTLP AnyValue into an attribute Value.

func ProtoToValueArray

func ProtoToValueArray(vals *cpb.ArrayValue) attribute.Value

func ResourceMetrics

func ResourceMetrics(rm *metricdata.ResourceMetrics) (*mpb.ResourceMetrics, error)

ResourceMetrics returns an OTLP ResourceMetrics generated from rm. If rm contains invalid ScopeMetrics, an error will be returned along with an OTLP ResourceMetrics that contains partial OTLP ScopeMetrics.

func ScopeMetrics

func ScopeMetrics(sms []metricdata.ScopeMetrics) ([]*mpb.ScopeMetrics, error)

ScopeMetrics returns a slice of OTLP ScopeMetrics generated from sms. If sms contains invalid metric values, an error will be returned along with a slice that contains partial OTLP ScopeMetrics.

func Sum

func Sum[N int64 | float64](s metricdata.Sum[N]) (*mpb.Metric_Sum, error)

Sum returns an OTLP Metric_Sum generated from s. An error is returned with a partial Metric_Sum if the temporality of s is unknown.

func Temporality

Temporality returns an OTLP AggregationTemporality generated from t. If t is unknown, an error is returned along with the invalid AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED.

func Value

func Value(v attribute.Value) *cpb.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