Skip to content

fix(sdk): detect character pattern wildcards in View instrument_name (#5664) - #5674

Merged
herin049 merged 6 commits into
open-telemetry:mainfrom
Dotify71:fix-view-wildcard-character-set-validation
Sep 29, 2026
Merged

herin049 merged 6 commits into
open-telemetry:mainfrom
Dotify71:fix-view-wildcard-character-set-validation

Conversation

@Dotify71

Copy link
Copy Markdown
Contributor

Description

Fixes #5664

According to the OpenTelemetry Metrics Specification, if name is provided, instrument_name MUST NOT contain wildcard characters (*, ?, [seq], [!seq]).

Previously, View.__init__ only checked for * and ?, missing [ (and ]). As a result, wildcard patterns like instrument_name="http_[0-9]" with a custom name passed initialization without raising an Exception and matched multiple instruments.

This PR updates the wildcard check in View.__init__ to check for [ as well, preventing character set wildcards when a custom View name is set.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Followed coding style guidelines
  • Added unit tests for new/changed behavior
  • All existing and new tests pass
  • Created changelog entry in .changelog/5664.fixed

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-29 22:27 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Sep 21, 2026
Comment thread .changelog/5674.fixed Resolved
@Dotify71
Dotify71 requested a review from herin049 September 25, 2026 20:35
@herin049
herin049 added this pull request to the merge queue Sep 29, 2026
Merged via the queue into open-telemetry:main with commit cee5f52 Sep 29, 2026
576 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[bug] View initialization fails to detect character pattern wildcards ('[', ']') in instrument_name when name is set

3 participants