config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 5 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"`
}

Config for the connector

func (*Config) Unmarshal

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

Unmarshal with custom logic to set default values. This is necessary to ensure that default metrics are not configured if the user has specified any custom metrics.

func (*Config) Validate

func (c *Config) Validate() error

type Counters

type Counters struct {
	SumSuffix   string `mapstructure:"sum_suffix"`
	CountSuffix string `mapstructure:"count_suffix"`
}

Counters aggregate spans as 2 cummulative sum metric with delta temporality. The configs allow adding suffixes to the metric names, the suffix defaults to `.sum` for sum metric and `.count` for count metric.

type ExplicitHistogram

type ExplicitHistogram struct {
	Buckets []float64 `mapstructure:"buckets"`
}

type ExponentialHistogram

type ExponentialHistogram struct {
	MaxSize int32 `mapstructure:"max_size"`
}

type Histogram

type Histogram struct {
	Explicit    *ExplicitHistogram    `mapstructure:"explicit"`
	Exponential *ExponentialHistogram `mapstructure:"exponential"`
}

type MetricInfo

type MetricInfo struct {
	Name        string `mapstructure:"name"`
	Description string `mapstructure:"description"`
	// EphemeralResourceAttribute (experimental) adds a randomly generated
	// ID as a resource attribute. The random ID is unique to a running
	// collector instance.
	EphemeralResourceAttribute bool `mapstructure:"ephemeral_resource_attribute"`
	// 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.
	// Note that configuring this setting might cause the produced metric
	// to lose its identity or cause identity conflict. Check out the
	// `ephemeral_resource_attribute`.
	IncludeResourceAttributes []Attribute `mapstructure:"include_resource_attributes"`
	Attributes                []Attribute `mapstructure:"attributes"`
	Unit                      MetricUnit  `mapstructure:"unit"`
	Histogram                 Histogram   `mapstructure:"histogram"`
	Summary                   *Summary    `mapstructure:"summary"`
	Counters                  *Counters   `mapstructure:"counters"`
}

MetricInfo for a data type

type MetricUnit

type MetricUnit string
const (
	MetricUnitNs MetricUnit = "ns"
	MetricUnitUs MetricUnit = "us"
	MetricUnitMs MetricUnit = "ms"
	MetricUnitS  MetricUnit = "s"
)

type Summary

type Summary struct{}

Jump to

Keyboard shortcuts

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