Documentation ¶
Overview ¶
Package transform provides transformation functionality from the sdk/metric/metricdata data-types into OTLP data-types.
Index ¶
- func AttrIter(iter attribute.Iterator) []*cpb.KeyValue
- func DataPoints[N int64 | float64](dPts []metricdata.DataPoint[N]) []*mpb.NumberDataPoint
- func Exemplars[N int64 | float64](exemplars []metricdata.Exemplar[N]) []*mpb.Exemplar
- func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N]) (*mpb.Metric_ExponentialHistogram, error)
- func ExponentialHistogramDataPointBuckets(bucket metricdata.ExponentialBucket) *mpb.ExponentialHistogramDataPoint_Buckets
- func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.ExponentialHistogramDataPoint[N]) []*mpb.ExponentialHistogramDataPoint
- func Gauge[N int64 | float64](g metricdata.Gauge[N]) *mpb.Metric_Gauge
- func Histogram[N int64 | float64](h metricdata.Histogram[N]) (*mpb.Metric_Histogram, error)
- func HistogramDataPoints[N int64 | float64](dPts []metricdata.HistogramDataPoint[N]) []*mpb.HistogramDataPoint
- func KeyValue(kv attribute.KeyValue) *cpb.KeyValue
- func KeyValues(attrs []attribute.KeyValue) []*cpb.KeyValue
- func Metrics(ms []metricdata.Metrics) ([]*mpb.Metric, error)
- func QuantileValues(quantiles []metricdata.QuantileValue) []*mpb.SummaryDataPoint_ValueAtQuantile
- func ResourceMetrics(rm *metricdata.ResourceMetrics) (*mpb.ResourceMetrics, error)
- func ScopeMetrics(sms []metricdata.ScopeMetrics) ([]*mpb.ScopeMetrics, error)
- func Sum[N int64 | float64](s metricdata.Sum[N]) (*mpb.Metric_Sum, error)
- func Summary(s metricdata.Summary) *mpb.Metric_Summary
- func SummaryDataPoints(dPts []metricdata.SummaryDataPoint) []*mpb.SummaryDataPoint
- func Temporality(t metricdata.Temporality) (mpb.AggregationTemporality, error)
- func Value(v attribute.Value) *cpb.AnyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataPoints ¶
func DataPoints[N int64 | float64](dPts []metricdata.DataPoint[N]) []*mpb.NumberDataPoint
DataPoints returns a slice of OTLP NumberDataPoint generated from dPts.
func Exemplars ¶ added in v1.24.0
Exemplars returns a slice of OTLP Exemplars generated from exemplars.
func ExponentialHistogram ¶
func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N]) (*mpb.Metric_ExponentialHistogram, error)
ExponentialHistogram returns an OTLP Metric_ExponentialHistogram generated from h. An error is returned if the temporality of h is unknown.
func ExponentialHistogramDataPointBuckets ¶
func ExponentialHistogramDataPointBuckets(bucket metricdata.ExponentialBucket) *mpb.ExponentialHistogramDataPoint_Buckets
ExponentialHistogramDataPointBuckets returns an OTLP ExponentialHistogramDataPoint_Buckets generated from bucket.
func ExponentialHistogramDataPoints ¶
func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.ExponentialHistogramDataPoint[N]) []*mpb.ExponentialHistogramDataPoint
ExponentialHistogramDataPoints returns a slice of OTLP ExponentialHistogramDataPoint 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 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 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 QuantileValues ¶ added in v1.25.0
func QuantileValues(quantiles []metricdata.QuantileValue) []*mpb.SummaryDataPoint_ValueAtQuantile
QuantileValues returns a slice of OTLP SummaryDataPoint_ValueAtQuantile generated from quantiles.
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 if the temporality of s is unknown.
func Summary ¶ added in v1.25.0
func Summary(s metricdata.Summary) *mpb.Metric_Summary
Summary returns an OTLP Metric_Summary generated from s.
func SummaryDataPoints ¶ added in v1.25.0
func SummaryDataPoints(dPts []metricdata.SummaryDataPoint) []*mpb.SummaryDataPoint
SummaryDataPoints returns a slice of OTLP SummaryDataPoint generated from dPts.
func Temporality ¶
func Temporality(t metricdata.Temporality) (mpb.AggregationTemporality, error)
Temporality returns an OTLP AggregationTemporality generated from t. If t is unknown, an error is returned along with the invalid AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED.
Types ¶
This section is empty.