prometheus / prometheus/client_python

Publically expose immutable attributes on MetricWrapperBase

Open
#844 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.4k
Forks
876
Avg merge
8d 4h
Merged PRs (30d)
1

Description

things like MetricWrapperBase._labelnames are immutable, but are passed in as parameters when instantiating MetricWrapperBase objects. These would be useful if they were exposed?

@property
def labelnames(self) -> Tuple[str, ...]:
    return self._labelnames

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

Locate MetricWrapperBase and inspect the immutable attributes passed during construction, using _labelnames and the proposed labelnames property as the starting point. Determine which similar attributes should be publicly readable without mutation, then run the relevant test suite and confirm those values are exposed consistently.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.