open-telemetry / open-telemetry/opentelemetry-ruby

Add missing View selection/stream-config fields (`meter_schema_url`, `description`, `exemplar_reservoir`) and a conflicting-identity warning

Open
#2,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement metrics spec-compliance spec:stable
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

Spec requirement

View instrument-selection criteria MUST accept meter_schema_url alongside name/type/unit/meter_name/meter_version (sdk.md:285-358, Instrument selection criteria). Stream configuration MUST accept description and exemplar_reservoir overrides (sdk.md:359-461). Custom ExemplarReservoirs also must be configurable per-View (sdk.md:1378-1385). Measurement processing SHOULD warn on conflicting metric identities when multiple Views collide on the same stream name (sdk.md:462-523, Measurement processing).

Current behavior

view/registered_view.rb:26-32 (permalink) implements name (with wildcard support), type, unit, meter_name, meter_version as additive selection criteria, but meter_schema_url isn't read. The same file has no description or exemplar_reservoir accessor, so those stream-config overrides can only be set at instrument-creation time, not per-View. Independent-mode View application (state/metric_stream.rb:56-64 (permalink)) emits no warning when multiple Views would collide on the same stream name.

Suggested fix

Add meter_schema_url as an additive selection criterion, and description/exemplar_reservoir as stream-config overrides, to RegisteredView. Add a warning log when MetricStream construction detects more than one matching View producing the same stream name.

Related rows in SPEC_COMPLIANCE_METRICS.md

SDK-12, SDK-13, SDK-53, SDK-14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with metrics_sdk/lib/opentelemetry/sdk/metrics/view/registered_view.rb and state/metric_stream.rb, then compare their behavior with the linked metrics SDK specification sections. Confirm that View selection accepts meter_schema_url, stream configuration supports description and exemplar_reservoir, and conflicting stream names produce a warning during MetricStream construction.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.