Skip to content

Stop validating View-provided stream Name against instrument name syntax - #7300

Merged
martincostello merged 4 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/views-skip-name-validation
May 20, 2026
Merged

martincostello merged 4 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/views-skip-name-validation

Conversation

@cijothomas

@cijothomas cijothomas commented May 15, 2026 •

Copy link
Copy Markdown
Member

Per the OpenTelemetry specification clarification in open-telemetry/opentelemetry-specification#5094, the View-provided metric stream Name is NOT subject to the instrument name syntax and the SDK MUST NOT validate it against that syntax.

Removes name-syntax validation from MetricStreamConfiguration.Name setter, the AddView(instrumentName, name) overload, and the runtime check in MetricReaderExt (which now only validates names that originate from the instrument itself, not View-renamed names). Also removes the now-unused internal MeterProviderBuilderSdk.IsValidViewName. Direct instrument creation via Meter continues to enforce the syntax.

Spec PR: open-telemetry/opentelemetry-specification#5094

Update (2026-05-19): Spec PR open-telemetry/opentelemetry-specification#5094 has been merged.

@github-actions github-actions Bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label May 15, 2026
@codecov

codecov Bot commented May 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.92%. Comparing base (a7b3346) to head (a3e5d2a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rc/OpenTelemetry/Metrics/Reader/MetricReaderExt.cs 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7300      +/-   ##
==========================================
+ Coverage   89.87%   89.92%   +0.05%     
==========================================
  Files         276      276              
  Lines       14007    14001       -6     
==========================================
+ Hits        12589    12591       +2     
+ Misses       1418     1410       -8     
Flag Coverage Δ
unittests-Project-Experimental 89.82% <75.00%> (-0.02%) ⬇️
unittests-Project-Stable 89.83% <75.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../Metrics/Builder/MeterProviderBuilderExtensions.cs 98.52% <ø> (-0.03%) ⬇️
...lemetry/Metrics/Builder/MeterProviderBuilderSdk.cs 100.00% <ø> (ø)
...elemetry/Metrics/View/MetricStreamConfiguration.cs 100.00% <100.00%> (ø)
...rc/OpenTelemetry/Metrics/Reader/MetricReaderExt.cs 92.06% <66.66%> (+0.06%) ⬆️

... and 3 files with indirect coverage changes

Comment thread src/OpenTelemetry/CHANGELOG.md Resolved
@cijothomas

Copy link
Copy Markdown
Member Author

@martincostello could you re-review and merge if all okay?

@martincostello
martincostello added this pull request to the merge queue May 20, 2026
Merged via the queue into open-telemetry:main with commit b1dd8e8 May 20, 2026
68 checks passed
This was referenced Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants