Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 15, 2021
Merged

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

merged 1 commit into from
Jun 15, 2021

Conversation

pietrodn
Copy link
Contributor

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

tests/test_core.py Outdated Show resolved Hide resolved
Signed-off-by: Pietro De Nicolao <pd@bendingspoons.com>
@csmarchbanks
Copy link
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
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