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

Prevent crashing if a metric value is None #39

Merged
merged 1 commit into from
Oct 2, 2022

Conversation

M0r13n
Copy link
Contributor

@M0r13n M0r13n commented Oct 1, 2022

Hey @akpw,

it's me again. A user reported a crash that occurs if a metric value is None. This seems to have happened before, because some logic already exists that prevents such crashes. See.

I generalized this approach and patched relevant places.

Copy link
Owner

@akpw akpw left a comment

Choose a reason for hiding this comment

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

Looks good. There was indeed a check for this in the info_collector, however it was missing in the other collector types and it definitely needs to be there

@akpw akpw merged commit d959d5f into akpw:main Oct 2, 2022
@akpw
Copy link
Owner

akpw commented Oct 2, 2022

@M0r13n OK there seemed to be a bug in the patch.

generalized this approach and patched relevant places.

since unlike info_collector, the label values for other collector types needed to be added as an [] and not a {}.

I therefore reverted to the previous version, adding the checks as needed. Thanks much for pointing this out, obviously was an important catch.

@M0r13n
Copy link
Contributor Author

M0r13n commented Oct 2, 2022

@akpw

Argh, I did not see that. Thanks for fixing it! :-)

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.

2 participants