config

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Key          string `mapstructure:"key"`
	DefaultValue any    `mapstructure:"default_value"`
}

type Config

type Config struct {
	Spans      []MetricInfo `mapstructure:"spans"`
	Datapoints []MetricInfo `mapstructure:"datapoints"`
	Logs       []MetricInfo `mapstructure:"logs"`
}

Config for the connector. Each configuration field describes the metrics to produce from a specific signal.

func (*Config) Unmarshal added in v0.116.0

func (c *Config) Unmarshal(collectorCfg *confmap.Conf) error

Unmarshal implements the confmap.Unmarshaler interface. It allows unmarshaling the config with a custom logic to allow setting default values when/if required.

func (*Config) Validate

func (c *Config) Validate() error

type ExponentialHistogram

type ExponentialHistogram struct {
	MaxSize int32  `mapstructure:"max_size"`
	Count   string `mapstructure:"count"`
	Value   string `mapstructure:"value"`
}

type Histogram

type Histogram struct {
	Buckets []float64 `mapstructure:"buckets"`
	Count   string    `mapstructure:"count"`
	Value   string    `mapstructure:"value"`
}

type MetricInfo

type MetricInfo struct {
	Name        string `mapstructure:"name"`
	Description string `mapstructure:"description"`
	// Unit, if not-empty, will set the unit associated with the metric.
	// See: https://github.com/open-telemetry/opentelemetry-collector/blob/b06236cc794982916cc956f20828b3e18eb33264/pdata/pmetric/generated_metric.go#L72-L81
	Unit string `mapstructure:"unit"`
	// IncludeResourceAttributes is a list of resource attributes that
	// needs to be included in the generated metric. If no resource
	// attribute is included in the list then all attributes are included.
	IncludeResourceAttributes []Attribute `mapstructure:"include_resource_attributes"`
	Attributes                []Attribute `mapstructure:"attributes"`
	// Conditions are a set of OTTL condtions which are ORed. Data is
	// processed into metrics only if the sequence evaluates to true.
	Conditions           []string              `mapstructure:"conditions"`
	Histogram            *Histogram            `mapstructure:"histogram"`
	ExponentialHistogram *ExponentialHistogram `mapstructure:"exponential_histogram"`
	Sum                  *Sum                  `mapstructure:"sum"`
}

MetricInfo defines the structure of the metric produced by the connector.

type Sum

type Sum struct {
	Value string `mapstructure:"value"`
}

Jump to

Keyboard shortcuts

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