Documentation
¶
Overview ¶
Package spanmetrics provides an otelcol.connector.spanmetrics component.
Index ¶
- Constants
- Variables
- func ConvertMetricUnit(unit string) (map[string]interface{}, error)
- type Arguments
- func (Arguments) ConnectorType() int
- func (args Arguments) Convert() (otelcomponent.Config, error)
- func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component
- func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension
- func (args Arguments) NextConsumers() *otelcol.ConsumerArguments
- func (args *Arguments) SetToDefault()
- func (args *Arguments) Validate() error
- type Dimension
- type ExplicitHistogramConfig
- type ExponentialHistogramConfig
- type HistogramConfig
Constants ¶
const ( AggregationTemporalityCumulative = "CUMULATIVE" AggregationTemporalityDelta = "DELTA" )
const ( MetricsUnitMilliseconds string = "ms" MetricsUnitSeconds string = "s" )
Variables ¶
var DefaultArguments = Arguments{ DimensionsCacheSize: 1000, AggregationTemporality: AggregationTemporalityCumulative, MetricsFlushInterval: 15 * time.Second, }
DefaultArguments holds default settings for Arguments.
var DefaultHistogramConfig = HistogramConfig{ Unit: MetricsUnitMilliseconds, Exponential: nil, Explicit: nil, }
Functions ¶
func ConvertMetricUnit ¶
The unit is a private type in an internal Otel package, so we need to convert it to a map and then back to the internal type. ConvertMetricUnit matches the Unit type in this internal package: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.80.0/connector/spanmetricsconnector/internal/metrics/unit.go
Types ¶
type Arguments ¶
type Arguments struct { // Dimensions defines the list of additional dimensions on top of the provided: // - service.name // - span.name // - 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 `river:"dimension,block,optional"` // DimensionsCacheSize defines the size of cache for storing Dimensions, which helps to avoid cache memory growing // indefinitely over the lifetime of the collector. DimensionsCacheSize int `river:"dimensions_cache_size,attr,optional"` AggregationTemporality string `river:"aggregation_temporality,attr,optional"` Histogram HistogramConfig `river:"histogram,block"` // MetricsEmitInterval is the time period between when metrics are flushed or emitted to the downstream components. MetricsFlushInterval time.Duration `river:"metrics_flush_interval,attr,optional"` // Namespace is the namespace of the metrics emitted by the connector. Namespace string `river:"namespace,attr,optional"` // Output configures where to send processed data. Required. Output *otelcol.ConsumerArguments `river:"output,block"` }
Arguments configures the otelcol.connector.spanmetrics component.
func (Arguments) ConnectorType ¶
ConnectorType() int implements connector.Arguments.
func (Arguments) Convert ¶
func (args Arguments) Convert() (otelcomponent.Config, error)
Convert implements connector.Arguments.
func (Arguments) Exporters ¶
func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component
Exporters implements connector.Arguments.
func (Arguments) Extensions ¶
func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension
Extensions implements connector.Arguments.
func (Arguments) NextConsumers ¶
func (args Arguments) NextConsumers() *otelcol.ConsumerArguments
NextConsumers implements connector.Arguments.
func (*Arguments) SetToDefault ¶
func (args *Arguments) SetToDefault()
SetToDefault implements river.Defaulter.
type Dimension ¶
type Dimension struct { Name string `river:"name,attr"` Default *string `river:"default,attr,optional"` }
Dimension defines the dimension name and optional default value if the Dimension is missing from a span attribute.
func (Dimension) Convert ¶
func (d Dimension) Convert() spanmetricsconnector.Dimension
type ExplicitHistogramConfig ¶
type ExplicitHistogramConfig struct { // Buckets is the list of durations representing explicit histogram buckets. Buckets []time.Duration `river:"buckets,attr,optional"` }
func (ExplicitHistogramConfig) Convert ¶
func (hc ExplicitHistogramConfig) Convert() *spanmetricsconnector.ExplicitHistogramConfig
func (*ExplicitHistogramConfig) SetToDefault ¶
func (hc *ExplicitHistogramConfig) SetToDefault()
type ExponentialHistogramConfig ¶
type ExponentialHistogramConfig struct {
MaxSize int32 `river:"max_size,attr,optional"`
}
func (ExponentialHistogramConfig) Convert ¶
func (ehc ExponentialHistogramConfig) Convert() *spanmetricsconnector.ExponentialHistogramConfig
func (*ExponentialHistogramConfig) SetToDefault ¶
func (ehc *ExponentialHistogramConfig) SetToDefault()
SetToDefault implements river.Defaulter.
func (*ExponentialHistogramConfig) Validate ¶
func (ehc *ExponentialHistogramConfig) Validate() error
Validate implements river.Validator.
type HistogramConfig ¶
type HistogramConfig struct { Unit string `river:"unit,attr,optional"` Exponential *ExponentialHistogramConfig `river:"exponential,block,optional"` Explicit *ExplicitHistogramConfig `river:"explicit,block,optional"` }
func (HistogramConfig) Convert ¶
func (hc HistogramConfig) Convert() (*spanmetricsconnector.HistogramConfig, error)
func (*HistogramConfig) SetToDefault ¶
func (hc *HistogramConfig) SetToDefault()
func (*HistogramConfig) Validate ¶
func (hc *HistogramConfig) Validate() error