metric

package
v1.300048.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateMetricName

func DecorateMetricName(measurement, fieldKey string) string

func RangeDataPointAttributes added in v1.300048.0

func RangeDataPointAttributes(m pmetric.Metric, fn func(attrs pcommon.Map))

func RangeDataPoints added in v1.300048.0

func RangeDataPoints[T DataPoint[T]](dps DataPoints[T], fn func(dp T))

func RangeMetrics added in v1.300048.0

func RangeMetrics(md pmetric.Metrics, fn func(m pmetric.Metric))

Types

type DataPoint added in v1.300048.0

type DataPoint[T any] interface {
	pmetric.NumberDataPoint | pmetric.HistogramDataPoint | pmetric.ExponentialHistogramDataPoint | pmetric.SummaryDataPoint
	MoveTo(dest T)
	Attributes() pcommon.Map
	StartTimestamp() pcommon.Timestamp
	SetStartTimestamp(pcommon.Timestamp)
	Timestamp() pcommon.Timestamp
	SetTimestamp(pcommon.Timestamp)
	CopyTo(dest T)
}

DataPoint is used to provide a common interface for OTEL metric data points.

type DataPoints added in v1.300048.0

type DataPoints[T DataPoint[T]] interface {
	Len() int
	At(i int) T
	EnsureCapacity(newCap int)
	AppendEmpty() T
	RemoveIf(f func(T) bool)
}

DataPoints is used to provide a common interface for OTEL slice types.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(metrics pmetric.MetricSlice) *Metrics

func (*Metrics) AddGaugeMetricDataPoint

func (metrics *Metrics) AddGaugeMetricDataPoint(
	name string,
	unit string,
	value interface{},
	timestamp pcommon.Timestamp,
	starttime pcommon.Timestamp,
	attributes map[string]string,
)

Jump to

Keyboard shortcuts

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