Skip to content

opentelemetry-sdk: preserve metric instrument name casing - #5881

Open
mertefesensoy wants to merge 3 commits into
open-telemetry:mainfrom
mertefesensoy:fix/3207-preserve-metric-name-case
Open

mertefesensoy wants to merge 3 commits into
open-telemetry:mainfrom
mertefesensoy:fix/3207-preserve-metric-name-case

Conversation

@mertefesensoy

Copy link
Copy Markdown

Description

Preserves names such as RequestCount in collected and OTLP-encoded metrics. On main, the same input becomes requestcount for all seven instrument kinds; the local before/after probe verifies the original spelling after this change.

Fixes #3207, following the agreed direction to stop lowercasing names.

Registration still treats names case-insensitively and returns the first spelling. View selection and conflict detection compare names case-insensitively too. Registering another spelling emits the warning required by the SDK name-conflict rule.

Existing queries that depend on lowercase metric names may need updating. The changelog filename is a placeholder for now until this draft PR receives its number.

Type of change

Validation

Codex ran the new tests on unchanged main: 22 failed, 5 passed.

I ran these on Windows (Python 3.13.14) with this change:

tox -e py313-test-opentelemetry-sdk   959 passed, 20 skipped, 155 subtests
tox -e precommit                      all hooks passed
tox -e typecheck                      4 os.register_at_fork errors, same on main (Windows-only)
pyright --pythonplatform Linux        0 errors
tox -e lint-opentelemetry-sdk         6 findings in unchanged files (os.fork, one .pyi CRLF)

Checklist:

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run tox -e typecheck
  • I have run the relevant tests and linting tox environments
  • This requires the following PR in contrib:

AI-assisted with Codex. Validation commands and results are recorded above.

Fixes open-telemetry#3207. Preserve the first registered spelling while keeping registration, View selection, and conflict detection case-insensitive.

Assisted-by: Codex (GPT-6)
Signed-off-by: MERT EFE ŞENSOY <sensoymertefe@gmail.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mertefesensoy / name: MERT EFE ŞENSOY (99b0e07)

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-03 17:35 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.

mertefesensoy and others added 2 commits November 3, 2026 20:25
The changelog check requires .changelog/<PR_NUMBER>.<type>; the fragment was named after issue open-telemetry#3207.

Assisted-by: Claude Code (claude-opus-5-5)
Signed-off-by: MERT EFE ŞENSOY <sensoymertefe@gmail.com>
@mertefesensoy
mertefesensoy marked this pull request as ready for review November 3, 2026 17:31
@mertefesensoy
mertefesensoy requested a review from a team as a code owner November 3, 2026 17:31

This branch has not been deployed

No deployments
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.

Metric naming conventions reasoning

1 participant