Skip to content

Raise the correct exception if the metrics are not observable#666

Merged
csmarchbanks merged 1 commit into
prometheus:masterfrom
pietrodn:fix/not-observable
Jun 15, 2021
Merged

Raise the correct exception if the metrics are not observable#666
csmarchbanks merged 1 commit into
prometheus:masterfrom
pietrodn:fix/not-observable

Conversation

@pietrodn
Copy link
Copy Markdown
Contributor

Always check that a metric is observable before changing its value. Fixes #665.

Comment thread tests/test_core.py Outdated
Signed-off-by: Pietro De Nicolao <pd@bendingspoons.com>
@csmarchbanks
Copy link
Copy Markdown
Member

Hello, thank you for your PR and issue! I am taking a few days of time off, but plan to review it next week.

Copy link
Copy Markdown
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.

Thanks! Most of these would error already, but a message like ValueError: counter metric is missing label values is much nicer than AttributeError: 'Counter' object has no attribute '_value'.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No error on missing labels for Gauge.set_function()

4 participants