You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The instrumentation scope (meter) name to match.
/// When set, the view only applies to instruments created under this scope.
pubscope_name:Option<String>,
}
Similarly, MetricStream only supports name and description, while the SDK's Stream::builder() also supports unit, aggregation, allowed_attribute_keys, and cardinality_limit.
Use Case
scope_attributes: Filter by deployment environment or other scope-level metadata, e.g., only apply a view to instruments from scopes tagged with env=production.
The support for OpenTelemetry Rust SDK views is not planned long-term in otap-dataflow, see #2623, which proposes eventually replacing views with equivalent ability in the internal telemetry system. Therefore, it is not super critical to implement the lower priority pieces of the issue unless there is an immediate use case.
Stream (lower priority, follow-up)
Expand MetricStream to support unit, aggregation, allowed_attribute_keys, and cardinality_limit.
Other Selectors (lower priority, follow-up)
instrument_unit, scope_version, and scope_schema_url could be added later if use cases arise. These are rarely needed in practice.
instrument_kind was originally considered a high priority item / easy win, but feedback from @cijothomas on this issue raised a good point that we may not want to support it, at least for now.
Pre-filing checklist
Component(s)
Rust OTAP dataflow (rust/otap-dataflow/)
Is your feature request related to a problem?
Follow-up to #2500
The OpenTelemetry Rust SDK exposes 7 selector dimensions on
&Instrumentfor view matching:instrument.name()instrument.scope().name()instrument.kind()instrument.unit()instrument.scope().version()instrument.scope().schema_url()instrument.scope().attributes()Our
MetricSelectorstruct currently only supportsinstrument_nameandscope_name. This limits the expressiveness of declarative view configuration.otel-arrow/rust/otap-dataflow/crates/config/src/pipeline/telemetry/metrics/views.rs
Lines 19 to 27 in 446e251
Similarly,
MetricStreamonly supportsnameanddescription, while the SDK'sStream::builder()also supportsunit,aggregation,allowed_attribute_keys, andcardinality_limit.Use Case
scope_attributes: Filter by deployment environment or other scope-level metadata, e.g., only apply a view to instruments from scopes tagged withenv=production.Immediate work (high priority)
Add
scope_attributestoMetricSelector:And add corresponding filter clauses in
DeclarativeView::to_view_funtion()inviews_provider.rs.Example YAML config:
Low priority work
Warning
The support for OpenTelemetry Rust SDK views is not planned long-term in otap-dataflow, see #2623, which proposes eventually replacing views with equivalent ability in the internal telemetry system. Therefore, it is not super critical to implement the lower priority pieces of the issue unless there is an immediate use case.
Stream (lower priority, follow-up)
Expand
MetricStreamto supportunit,aggregation,allowed_attribute_keys, andcardinality_limit.Other Selectors (lower priority, follow-up)
instrument_unit,scope_version, andscope_schema_urlcould be added later if use cases arise. These are rarely needed in practice.instrument_kindwas originally considered a high priority item / easy win, but feedback from @cijothomas on this issue raised a good point that we may not want to support it, at least for now.Alternatives Considered
N/A
Additional Context
instrument.rs