otel

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricsExporterProvider

func MetricsExporterProvider(cfg *MetricsConfig) (pipe.FinalFunc[[]*ebpf.Record], error)

Types

type Counter

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

type Expirer

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

Expirer drops metrics from labels that haven't been updated during a given timeout TODO: generify and move to a common section for using it also in AppO11y, supporting more OTEL metrics

func NewExpirer

func NewExpirer(attrs []export.Attribute, expireTime time.Duration) *Expirer

NewExpirer creates a metric that wraps a Counter. Its labeled instances are dropped if they haven't been updated during the last timeout period

func (*Expirer) Collect

func (ex *Expirer) Collect(_ context.Context, observer metric.Int64Observer) error

func (*Expirer) ForRecord

func (ex *Expirer) ForRecord(m *ebpf.Record) *Counter

ForRecord returns the Counter for the given eBPF record. If that record s accessed for the first time, a new Counter is created. If not, a cached copy is returned and the "last access" cache time is updated.

func (*Expirer) UpdateTime

func (ex *Expirer) UpdateTime()

UpdateTime updates the last access time to be annotated to any new or existing metric. It is a required operation before processing a given batch of metrics (invoking the WithLabelValues).

type MetricsConfig

type MetricsConfig struct {
	Metrics           *otel.MetricsConfig
	AllowedAttributes []string
}

func (MetricsConfig) Enabled

func (mc MetricsConfig) Enabled() bool

Jump to

Keyboard shortcuts

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