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

Not reporting a gauge value of zero #5

Open
isobit opened this issue Mar 14, 2023 · 2 comments · May be fixed by #11
Open

Not reporting a gauge value of zero #5

isobit opened this issue Mar 14, 2023 · 2 comments · May be fixed by #11

Comments

@isobit
Copy link

isobit commented Mar 14, 2023

There seems to be no exported metric when explicitly reporting a gauge value of 0, for example with metrics::gauge!("foo", 0 as f64).

I noticed there were a lot of "if 0, continue" conditions added in 85bd93b, maybe using zero to indicate idle is breaking explicit zero values?

@dialtone
Copy link
Owner

yeah, not exactly sure how to manage that differently though. Easiest obviously is to simply let it be a configuration parameter whether 0 is reported or not, although probably you want a low idle timeout when doing that so you don't report the 0 each time...

Do you have any opinion?

@ijc
Copy link

ijc commented Nov 15, 2024

This is affecting us too. I think the problem is that 0 is a completely valid value for a gauge or a counter (e.g. "number of active sessions" can easily be zero and is definitely distinct from1) and zero samples in a period is legit for a histrogram.

Shouldn't idleness be dealt with by setting idle_timeout to eventually discard those metrics? Why do they need to be dealt with any further with filtering after that?

ijc added a commit to ijc/metrics-exporter-dogstatsd that referenced this issue Nov 15, 2024
0 is a valid value for a gauge or a counter (e.g. "number of active sessions"
can easily be zero and that state is distinct from is distinct 1) and zero
samples in a period is legit for a histogram over an interval.

For gauges we should also not reset to zero on each render, but we should
continue to do so for counters.

Suppression of idle metrics should be done using `StatsdBuilder::idle_timeout`.

Fixes dialtone#5
@ijc ijc linked a pull request Nov 15, 2024 that will close this issue
kp-mariappan-ramasamy pushed a commit to kp-mariappan-ramasamy/metrics-exporter-dogstatsd that referenced this issue Nov 19, 2024
0 is a valid value for a gauge or a counter (e.g. "number of active sessions"
can easily be zero and that state is distinct from is distinct 1) and zero
samples in a period is legit for a histogram over an interval.

For gauges we should also not reset to zero on each render, but we should
continue to do so for counters.

Suppression of idle metrics should be done using `StatsdBuilder::idle_timeout`.

Fixes dialtone#5
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 a pull request may close this issue.

3 participants