Check if labelvalues is in _metrics before deletion in MetricWrapperBase.remove() by GlorifiedPig · Pull Request #1077 · prometheus/client_python

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@GlorifiedPig

Copy link

Contributor

Currently raises an error if labelvalues is not in _metrics. Since the labelvalues get removed anyways, there isn't really any point of this error, since we would want to assume that after running this function call labelvalues will not exist regardless of it existed beforehand or not.

Signed-off-by: GlorifiedPig <ryan@glorifiedstudios.com>
Copy link

Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable quality of life improvement. Thanks!

@csmarchbanks csmarchbanks merged commit 92b2397 into prometheus:master

Dec 6, 2024

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

Reviewers

@csmarchbanks csmarchbanks csmarchbanks approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@GlorifiedPig @csmarchbanks