Skip to content

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

Open
Dotify71 wants to merge 3 commits into
open-telemetry:mainfrom
Dotify71:fix-view-wildcard-character-set-validation
Open

Dotify71 wants to merge 3 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

Waiting on reviewers · refreshed 2026-09-19 06:28 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

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

1 participant