model

package
v0.120.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeKeyValue

type AttributeKeyValue struct {
	Key          string
	DefaultValue pcommon.Value
}

type CollectorInstanceInfo

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

CollectorInstanceInfo holds the attributes that could uniquely identify the current collector instance. These attributes are initialized from the telemetry settings. The CollectorInstanceInfo can copy these attributes, with a given prefix, to a provided map.

func NewCollectorInstanceInfo

func NewCollectorInstanceInfo(
	set component.TelemetrySettings,
) *CollectorInstanceInfo

func (CollectorInstanceInfo) Copy

func (info CollectorInstanceInfo) Copy(to pcommon.Map)

func (CollectorInstanceInfo) Size

func (info CollectorInstanceInfo) Size() int

Size returns the max number of attributes that defines a collector's instance information. Can be used to presize the attributes.

type ExplicitHistogram

type ExplicitHistogram[K any] struct {
	Buckets []float64
	Count   *ottl.Statement[K]
	Value   *ottl.Statement[K]
}

type ExponentialHistogram

type ExponentialHistogram[K any] struct {
	MaxSize int32
	Count   *ottl.Statement[K]
	Value   *ottl.Statement[K]
}

type MetricDef

type MetricDef[K any] struct {
	Key                       MetricKey
	Unit                      string
	IncludeResourceAttributes []AttributeKeyValue
	Attributes                []AttributeKeyValue
	Conditions                *ottl.ConditionSequence[K]
	ExponentialHistogram      *ExponentialHistogram[K]
	ExplicitHistogram         *ExplicitHistogram[K]
	Sum                       *Sum[K]
}

func (*MetricDef[K]) FilterAttributes

func (md *MetricDef[K]) FilterAttributes(attrs pcommon.Map) (pcommon.Map, bool)

FilterAttributes filters event attributes (datapoint, logrecord, spans) based on the `Attributes` selected for the metric definition. If no attributes are selected then an empty `pcommon.Map` is returned. Note that, this filtering differs from resource attribute filtering as in attribute filtering if any of the configured attributes is not present in the data being processed then that metric definition is not processed. The method returns a bool signaling if the filter was successful and metric should be processed. If the bool value is false then the returned map should not be used.

func (*MetricDef[K]) FilterResourceAttributes

func (md *MetricDef[K]) FilterResourceAttributes(
	attrs pcommon.Map,
	collectorInfo *CollectorInstanceInfo,
) pcommon.Map

FilterResourceAttributes filters resource attributes based on the `IncludeResourceAttributes` list for the metric definition. Resource attributes are only filtered if the list is specified, otherwise all the resource attributes are used for creating the metrics from the metric definition.

func (*MetricDef[K]) FromMetricInfo

func (md *MetricDef[K]) FromMetricInfo(
	mi config.MetricInfo,
	parser ottl.Parser[K],
	telemetrySettings component.TelemetrySettings,
) error

type MetricKey

type MetricKey struct {
	Name        string
	Description string
}

type Sum

type Sum[K any] struct {
	Value *ottl.Statement[K]
}

Jump to

Keyboard shortcuts

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