Skip to content

Safely handle null keys/values in metrics tags #19

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

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

hugocf
Copy link
Contributor

@hugocf hugocf commented Jan 9, 2019

In the payments-tax service we accidentally passed null to a metrics tag value and it raised a NullPointerException.

The value was coming from a Throwable exception which happened to have no message (e.g. tag "reason" -> exception.getMessage where exception.getMessage = null).

This PR prevents NullPointerException from being thrown if any of the key/value of a metrics tag is null.

@hugocf hugocf requested a review from mkleymenov January 9, 2019 14:45
Copy link
Contributor

@mkleymenov mkleymenov left a comment

Choose a reason for hiding this comment

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

LGTM

@hugocf hugocf merged commit 5fa8e61 into master Jan 10, 2019
@hugocf hugocf deleted the handle-null-metrics-tags branch January 10, 2019 14:03
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