open-telemetry / open-telemetry/opentelemetry-python

Support for exclude list is missing in attributes

Open
#5,331 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe your environment

OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.10.0)
SDK version: (e.g., 1.25.0)
API version: (e.g., 1.25.0)

What happened?

The Metrics SDK spec says Implementations SHOULD support configuring an exclude-list of attribute keys. The exclude-list contains attribute keys that identify the attributes that MUST be excluded, all other attributes MUST be kept. (https://opentelemetry.io/docs/specs/otel/metrics/sdk/#instrument-selection-criteria)

In the current Python View API, the constructor exposes attribute_keys (allow-list style) but there is no corresponding exclude-list parameter.

Steps to Reproduce

Try to provide exclude attributes in View.

Expected Result

View Constructor should support exclude attributes parameter.

Actual Result

Support for exclude attributes is missing

Additional context

No response

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

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 the Python metrics SDK View constructor and compare its existing attribute_keys behavior with the Metrics SDK specification's instrument selection criteria. Done means View accepts an exclude-list parameter and excludes the listed attribute keys while retaining all others, with tests covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.