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

Cherry-pick to 7.2: Ignore prometheus metrics when their values are NaN or Inf (#12084) #12295

Merged
merged 2 commits into from
May 27, 2019
Merged

Cherry-pick to 7.2: Ignore prometheus metrics when their values are NaN or Inf (#12084) #12295

merged 2 commits into from
May 27, 2019

Conversation

kaiyan-sheng
Copy link
Contributor

Cherry-pick of PR #12084 to 7.2 branch. Original message:

When prometheus report metrics with value NaN or +Inf or -Inf, metricbeat will fail with error like "Failed to serialize the event: unsupported float value: NaN". This PR is to add the logic to ignore prometheus metrics with NaN/Inf value in collector metricset.

This PR also added a metrics-with-naninf.plain test data with NaN/Inf as metric value. From the output metrics-with-naninf.plain-expected.json you can see, the metrics with NaN/Inf value are not there.

(cherry picked from commit 9244477)

* Ignore prometheus metrics when their values are NaN or Inf
* Avoid NaN/Inf in prometheus helper
* Add checks on Gauge, Summary and Counter
* Add NaN/Inf check on histogram values

(cherry picked from commit 9244477)
@kaiyan-sheng kaiyan-sheng requested review from a team as code owners May 25, 2019 03:05
@kaiyan-sheng kaiyan-sheng self-assigned this May 25, 2019
@kaiyan-sheng kaiyan-sheng merged commit 88c2f6e into elastic:7.2 May 27, 2019
@kaiyan-sheng kaiyan-sheng deleted the backport_12084_7.2 branch May 27, 2019 14:32
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…aN or Inf (elastic#12084) (elastic#12295)

* Ignore prometheus metrics when their values are NaN or Inf (elastic#12084)

* Ignore prometheus metrics when their values are NaN or Inf
* Avoid NaN/Inf in prometheus helper
* Add checks on Gauge, Summary and Counter
* Add NaN/Inf check on histogram values

(cherry picked from commit 6810e31)

* Fix changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants