Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute ¶ added in v1.5.0
Attribute stores how to expose a metric attribute: its exposed name and how to get its value from the ebpf.Record.
func BuildOTELAttributeGetters ¶ added in v1.5.0
BuildOTELAttributeGetters builds a list of Attribute getters for the names provided by the user configuration, ready to be passed to an OpenTelemetry exporter. Whatever is the format of the user-provided attribute names (dot-based or underscore-based), it converts underscores to dots to make sure that the correct attribute name is exposed.
func BuildPromAttributeGetters ¶ added in v1.5.0
BuildPromAttributeGetters builds a list of Attribute getters for the names provided by the user configuration, ready to be passed to a Prometheus exporter. It differentiates two name formats: the exposed name for the attribute (uses _ for word separation, as required by Prometheus); and the internal name of the attribute (uses . for word separation, as internally Beyla stores the metadata). Whatever is the format provided by the user (dot-based or underscore-based), it converts dots to underscores and vice-versa to make sure that the correct format is used either internally or externally.
type ExpiryMap ¶ added in v1.5.0
type ExpiryMap[T any] struct { // contains filtered or unexported fields }
ExpiryMap stores elements in a synchronized map, and removes them if they haven't been accessed/updated for a given time period
func NewExpiryMap ¶ added in v1.5.0
func NewExpiryMap[T any](expireTime time.Duration, opts ...ExpiryOption[T]) *ExpiryMap[T]
NewExpiryMap creates an expiry map. Its labeled instances are dropped if they haven't been updated during the last timeout period
func (*ExpiryMap[T]) All ¶ added in v1.5.0
func (ex *ExpiryMap[T]) All() []T
All returns an array with all the stored entries. It might contain expired entries if DeleteExpired is not invoked before it. TODO: use https://tip.golang.org/wiki/RangefuncExperiment when available
func (*ExpiryMap[T]) DeleteExpired ¶ added in v1.5.0
DeleteExpired entries and return their label set
func (*ExpiryMap[T]) GetOrCreate ¶ added in v1.5.0
GetOrCreate returns the stored object for the given slice of label values. If that combination of label values is accessed for the first time, a new instance is created. If not, a cached copy is returned and the "last access" cache time is updated.
func (*ExpiryMap[T]) UpdateTime ¶ added in v1.5.0
func (ex *ExpiryMap[T]) 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 (e.g. before invoking GetOrCreate).