Skip to content

Clarify View name is not subject to instrument name syntax validation#5094

Merged
lmolkova merged 6 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/clarify-view-name-validation
May 19, 2026
Merged

Clarify View name is not subject to instrument name syntax validation#5094
lmolkova merged 6 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/clarify-view-name-validation

Conversation

@cijothomas
Copy link
Copy Markdown
Member

@cijothomas cijothomas commented May 15, 2026

The SDK spec is currently silent on whether the metric stream name provided via View stream configuration must conform to the instrument name syntax. Implementations have diverged on this: .NET and Rust validate the View-provided name against the instrument name syntax (and reject/drop the stream on mismatch), while Go, Java, Python, and C++ pass it through without validation.

This PR makes the spec explicit that View-provided names are not subject to instrument name syntax validation.

Discussion context: #5092 (comment) and follow-ups.

@dashpole
Copy link
Copy Markdown
Contributor

I also checked (using AI, with references):

  • Erlang: Doesn't validate the stream name. It validates instrument names, but doesn't enforce them (just logs).
  • Kotlin: Doesn't implement views.
  • PHP: Does not validate at instrument creation or view streams
  • Swift: Does not validate at instrument creation or view streams.

Copy link
Copy Markdown
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to use MUST NOT as long as the maintainers for .NET and Rust are on-board to change after this merges.

@cijothomas
Copy link
Copy Markdown
Member Author

I think it is fine to use MUST NOT as long as the maintainers for .NET and Rust are on-board to change after this merges.

@martincostello Could you check if .NET is okay? (I am okay, and can send the PR with the fix to adjust to this, if this is merged)

@martincostello
Copy link
Copy Markdown
Member

@cijothomas Sounds ok to me.

Copy link
Copy Markdown
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This matches current C++ SDK behavior: View-provided stream names are passed through without instrument-name syntax validation.

@cijothomas
Copy link
Copy Markdown
Member Author

@jack-berg could you review?

@jack-berg
Copy link
Copy Markdown
Member

PR to add a test to codify the opentelemetry-java behavior: open-telemetry/opentelemetry-java#8412

@cijothomas
Copy link
Copy Markdown
Member Author

cijothomas commented May 19, 2026

@carlosalberto Could you merge this in and include it part of release #5096 ?

@cijothomas cijothomas mentioned this pull request May 19, 2026
@lmolkova lmolkova added this pull request to the merge queue May 19, 2026
Merged via the queue into open-telemetry:main with commit 34ad904 May 19, 2026
8 of 9 checks passed
@cijothomas cijothomas deleted the cijothomas/clarify-view-name-validation branch May 19, 2026 13:49
pull Bot pushed a commit to CodeWeaver13/opentelemetry-specification that referenced this pull request May 20, 2026
### Metrics

- Add in-development `Bind` API to synchronous instruments.

([open-telemetry#5050](open-telemetry#5050))
- Clarify that View-provided metric stream `name` is not subject to
instrument
  name syntax validation.

([open-telemetry#5094](open-telemetry#5094))

### Common

- Define the Core packages term.

([open-telemetry#5046](open-telemetry#5046))
- Rework contributing guide to reflect current process.

([open-telemetry#5072](open-telemetry#5072))

### Compatibility

- Stabilize sections of Prometheus and OpenMetrics Compatibility.
- Stabilize translation of labels prefixed with `otel_scope_` to OTLP
Instrumentation Scope.

([open-telemetry#5004](open-telemetry#5004))
  - Stabilize OpenTelemetry Gauge and Sum to Prometheus transformations.

([open-telemetry#5034](open-telemetry#5034))
- Stabilize OpenTelemetry Instrumentation Scope to Prometheus labels
transformation.

([open-telemetry#5052](open-telemetry#5052))
- Stabilize sections of Prometheus Metrics Exporter.
  - Stabilize temporality.

([open-telemetry#5024](open-telemetry#5024))
  - Stabilize version and format.

([open-telemetry#5083](open-telemetry#5083))
  - Stabilize port configuration.

([open-telemetry#5026](open-telemetry#5026))
  - Stabilize `scope_info_enabled` configuration.

([open-telemetry#5056](open-telemetry#5056))
- Change Prometheus Metric Exporter config property recommended names
(`without_scope_info` -> `scope_info_enabled`, `without_target_info` ->
`target_info_enabled`,
  `with_resource_constant_labels` -> `resource_constant_labels`)

([open-telemetry#5071](open-telemetry#5071))
- Clarify that OTel SDKs should not use unofficial Prometheus clients.

([open-telemetry#5082](open-telemetry#5082))

### OTEPs

- Add OTEP for Semantic Convention Schema v2 with support for multiple
convention
  registries and resolved schema format

([open-telemetry#4815](open-telemetry#4815))

---------

Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants