Instrument selection criteria + stream configuration
(metrics/sdk.md §View L259-L327).
A View maps matching instruments to metric streams by specifying which instruments to select and how the resulting stream should be configured (name override, description override, attribute filtering, aggregation, etc.).
All selection criteria are optional and additive (AND). An instrument must match all provided criteria for the View to apply.
References
- OTel Metrics SDK §View:
opentelemetry-specification/specification/metrics/sdk.mdL259-L327
Summary
Types
@type config() :: %{ optional(:name) => String.t(), optional(:description) => String.t(), optional(:attribute_keys) => {:include, [String.t()]} | {:exclude, [String.t()]}, optional(:aggregation) => module(), optional(:aggregation_options) => map(), optional(:exemplar_reservoir) => module(), optional(:aggregation_cardinality_limit) => pos_integer() }
@type primitive_any() :: primitive() | [primitive_any()] | %{required(String.t()) => primitive_any()}
Functions
@spec description(view :: t(), instrument :: Otel.API.Metrics.Instrument.t()) :: String.t()
@spec matches?(view :: t(), instrument :: Otel.API.Metrics.Instrument.t()) :: boolean()
@spec name(view :: t(), instrument :: Otel.API.Metrics.Instrument.t()) :: String.t()