Documentation ¶
Index ¶
- func AttrIter(iter attribute.Iterator) []*cpb.KeyValue
- func DataPoints[N int64 | float64](dPts []metricdata.DataPoint[N]) []*mpb.NumberDataPoint
- 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 ProtoDataPoints[N int64 | float64](dPts []*mpb.NumberDataPoint) []metricdata.DataPoint[N]
- func ProtoGauge[N int64 | float64](g *mpb.Metric_Gauge) metricdata.Gauge[N]
- func ProtoHistogram(h *mpb.Metric_Histogram) (metricdata.Histogram[float64], error)
- func ProtoHistogramDataPoints(dPts []*mpb.HistogramDataPoint) []metricdata.HistogramDataPoint[float64]
- func ProtoMetrics(ms []*mpb.Metric) ([]metricdata.Metrics, error)
- func ProtoScopeMetrics(sms []*mpb.ScopeMetrics) ([]metricdata.ScopeMetrics, error)
- func ProtoSum[N int64 | float64](s *mpb.Metric_Sum) (metricdata.Sum[N], error)
- func ProtoTemporality(t mpb.AggregationTemporality) (metricdata.Temporality, error)
- func ProtoToKeyValue(kv *cpb.KeyValue) attribute.KeyValue
- func ProtoToKeyValues(attrs []*cpb.KeyValue) []attribute.KeyValue
- func ProtoToValue(val *cpb.AnyValue) attribute.Value
- func ProtoToValueArray(vals *cpb.ArrayValue) attribute.Value
- 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 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 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 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 ProtoHistogram ¶
func ProtoHistogram(h *mpb.Metric_Histogram) (metricdata.Histogram[float64], error)
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 ProtoTemporality ¶
func ProtoTemporality(t mpb.AggregationTemporality) (metricdata.Temporality, error)
func ProtoToKeyValue ¶
ProtoToKeyValue transforms an OTLP key-value into an attribute KeyValue.
func ProtoToValue ¶
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 ¶
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.