open-telemetry / open-telemetry/opentelemetry-python

[TC Review] Some Metric View Conflict error messages are missing

Open
#3,043 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug metrics
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

The conflict detection code for metric views in python is lacking a few features / could use some cleanup for user friendliness.

First - this code checks for conflicting definitions of views. However, it's still useful to give users a warning when two views are defined with mismatched descriptions. You still that case to work, but you want to tell the user they have mismatched descriptions in case there's some underlying error.

Second - The code today only looks for conflicts after selecting on instrument. It would fail to detect view conflicts from instrument renames.

For example:

  • Instrument Counter "foo", w/ View rename to "foo_bar"
  • Instrument Histogram "foo_bar"

I have an actual conflict here, but I'll never get an error message.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py around line 62, where conflicting view definitions are checked. Trace how instrument selection and view renames are handled, then verify that mismatched descriptions produce a warning and that renamed instruments are included in conflict detection. Done means both cases report useful diagnostics without preventing valid operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.