Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for the spanmetrics connector.
Types ¶
type Config ¶
type Config struct { // Dimensions defines the list of additional dimensions on top of the provided: // - service.name // - span.kind // - span.kind // - status.code // The dimensions will be fetched from the span's attributes. Examples of some conventionally used attributes: // https://github.com/open-telemetry/opentelemetry-collector/blob/main/model/semconv/opentelemetry.go. Dimensions []Dimension `mapstructure:"dimensions"` ExcludeDimensions []string `mapstructure:"exclude_dimensions"` // DimensionsCacheSize defines the size of cache for storing Dimensions, which helps to avoid cache memory growing // indefinitely over the lifetime of the collector. // Optional. See defaultDimensionsCacheSize in connector.go for the default value. DimensionsCacheSize int `mapstructure:"dimensions_cache_size"` // ResourceMetricsCacheSize defines the size of the cache holding metrics for a service. This is mostly relevant for // cumulative temporality to avoid memory leaks and correct metric timestamp resets. // Optional. See defaultResourceMetricsCacheSize in connector.go for the default value. ResourceMetricsCacheSize int `mapstructure:"resource_metrics_cache_size"` // ResourceMetricsKeyAttributes filters the resource attributes used to create the resource metrics key hash. // This can be used to avoid situations where resource attributes may change across service restarts, causing // metric counters to break (and duplicate). A resource does not need to have all of the attributes. The list // must include enough attributes to properly identify unique resources or risk aggregating data from more // than one service and span. // e.g. ["service.name", "telemetry.sdk.language", "telemetry.sdk.name"] // See https://opentelemetry.io/docs/specs/semconv/resource/ for possible attributes. ResourceMetricsKeyAttributes []string `mapstructure:"resource_metrics_key_attributes"` AggregationTemporality string `mapstructure:"aggregation_temporality"` Histogram HistogramConfig `mapstructure:"histogram"` // MetricsEmitInterval is the time period between when metrics are flushed or emitted to the configured MetricsExporter. MetricsFlushInterval time.Duration `mapstructure:"metrics_flush_interval"` // MetricsExpiration is the time period after which, if no new spans are received, metrics are considered stale and will no longer be exported. // Default value (0) means that the metrics will never expire. MetricsExpiration time.Duration `mapstructure:"metrics_expiration"` // Namespace is the namespace of the metrics emitted by the connector. Namespace string `mapstructure:"namespace"` // Exemplars defines the configuration for exemplars. Exemplars ExemplarsConfig `mapstructure:"exemplars"` // Events defines the configuration for events section of spans. Events EventsConfig `mapstructure:"events"` }
Config defines the configuration options for spanmetricsconnector.
func (Config) GetAggregationTemporality ¶
func (c Config) GetAggregationTemporality() pmetric.AggregationTemporality
GetAggregationTemporality converts the string value given in the config into a AggregationTemporality. Returns cumulative, unless delta is correctly specified.
type Dimension ¶
type Dimension struct { Name string `mapstructure:"name"` Default *string `mapstructure:"default"` }
Dimension defines the dimension name and optional default value if the Dimension is missing from a span attribute.
type EventsConfig ¶ added in v0.89.0
type ExemplarsConfig ¶ added in v0.82.0
type ExplicitHistogramConfig ¶ added in v0.73.0
type ExponentialHistogramConfig ¶ added in v0.73.0
type ExponentialHistogramConfig struct {
MaxSize int32 `mapstructure:"max_size"`
}
type HistogramConfig ¶ added in v0.73.0
type HistogramConfig struct { Disable bool `mapstructure:"disable"` Unit metrics.Unit `mapstructure:"unit"` Exponential *ExponentialHistogramConfig `mapstructure:"exponential"` Explicit *ExplicitHistogramConfig `mapstructure:"explicit"` }
Click to show internal directories.
Click to hide internal directories.