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

Metric counters don't report 0 to Prometheus #374

Closed
risinger opened this issue Feb 25, 2021 · 6 comments
Closed

Metric counters don't report 0 to Prometheus #374

risinger opened this issue Feb 25, 2021 · 6 comments
Labels
Priority: Medium This issue will be seen by about half of users Type: Bug Something isn't working

Comments

@risinger
Copy link

NTH does not report 0 when a metric has not been observed during runtime. Prometheus expects counters to report 0 when they are 0. If they are simply not reported, rate will report 0 when the metric is first reported, no matter the value. Because the first value is an observation, any alerting or visualization in Prometheus will either miss all errors/actions in the first scrape that has that metric or the alert/graphing needs to use the raw total number of observations during an NTH pod's lifetime.

I realize this may well be a bug in OpenTelemetry, but it also seems possible the counters are not properly initialized in NTH.

Here's a grafana graph to visualize the problem (increase is syntactic sugar for rate times the range selector):

image

@jillmon jillmon added the Type: Question All types of questions to/from customers label Feb 25, 2021
@haugenj
Copy link
Contributor

haugenj commented Mar 2, 2021

From reading around, it looks like ideally we would initialize these metrics at the beginning when we set up the metrics server. We can do that for the error metrics, but the node metrics are trickier because they use labels with the node name which we don't know ahead of time.

Perhaps we can init the error metrics early, and for the node metrics do a lookup to see if they're initialized before the first increment?

@haugenj haugenj added Status: Help Wanted Type: Bug Something isn't working and removed Type: Question All types of questions to/from customers labels Mar 2, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.

@github-actions github-actions bot added the stale Issues / PRs with no activity label Oct 15, 2021
@jillmon jillmon added Priority: Medium This issue will be seen by about half of users stalebot-ignore To NOT let the stalebot update or close the Issue / PR and removed stale Issues / PRs with no activity labels Oct 19, 2021
@drstevens
Copy link

Bump here per @bwagner5's suggestion in slack

@stevehipwell
Copy link
Contributor

@bwagner5 we're using the (rate(actions_node{job="aws-node-termination-handler",node_status!="success"}[5m])) query to trigger alerts and are getting our alerts replayed every 12 hours.

@stevehipwell
Copy link
Contributor

@bwagner5 have you been able to look into this?

@bwagner5 bwagner5 mentioned this issue Jun 2, 2023
@cjerad cjerad added the Pending-Release Pending an NTH or eks-charts release label Jun 21, 2023
@cjerad
Copy link
Contributor

cjerad commented Jun 22, 2023

This has been released in v1.20.0, chart version 0.22.0

@cjerad cjerad closed this as completed Jun 22, 2023
@cjerad cjerad removed Pending-Release Pending an NTH or eks-charts release Status: Help Wanted stalebot-ignore To NOT let the stalebot update or close the Issue / PR labels Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This issue will be seen by about half of users Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants