Comments (14)
Yes, that is kind-of by design. Decay is only calculated upon observations. So if you do not observe anything, the current values will be 'frozen'. The next observation will completely flush anything (as it can even be seen in your graph, if looking closely).
It would be easy to also check for decay upon scrape. I'm just not sure what the better behavior is. A reset summary will return '0' for all quantiles, which is kind of wrong, too. 'NaN' would be more faithful, but probably confusing, too.
Arguably, no observations at all is a pathological state anyway. Perhaps returning the 'last known state' makes more sense...
Please let me know what you think.
@juliusv - do you have an opinion or historical state on this decision?
from client_golang.
It's a good point that this is a pathological state anyways. Except in circumstances where people take latencies of errors (but arguably you shouldn't do that unless errors are common, in which case you wouldn't have the problem).
0
is probably the worst option, as it has no basis in reality, but pretends to be "good". Keeping the last value could be ok. But NaN
seems to be the most correct form, and I would prefer it.
Historically (at least with the original client), when a summary didn't get any observations yet, it just didn't export anything yet - no quantiles at all. That's probably not possible anymore with the new client library? I guess it would be similar in effect (but less explicit) than NaN
.
from client_golang.
So you mean the metric should completely disappear if no observations happened in the decay period? Or only the quantiles? Either one should be easy to implement, we just have to be sure what's the most reasonable response.
from client_golang.
Biased by the old client, I was expecting at least the quantile metrics to disappear. I can't really comment on whether to omit the whole metric or just the quantiles.
from client_golang.
That's a good question. We currently never reset anything in the counters as long as any single sample comes in within MaxAge, right? I think for the counters it doesn't really make sense to reset them, as they were always meant as total counts/sums since instance start...
from client_golang.
Yeah, ..._count and ..._sum is never reset, and should probably not disappear. The quantiles could be left out. Just not sure if there are implications if that happens...
from client_golang.
Thinking through it, it should be fine. At least not worse than falsely reporting old quantiles.
from client_golang.
NaN is the best I think, that's what the equivalent for _sum/_count will return.
from client_golang.
@brian-brazil I don't understand. _sum/_count will never return NaN, will it? It's 0 if no observations have happened yet.
from client_golang.
Not sure about the latter part either, but NaN
sounds good to me as well.
from client_golang.
Following http://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics, we definitely want to keep the quantiles. As we concluded 0 would be misleading, let's use NaN in this case. (Perhaps that would be something to add to the docs above, as 0 might not be useful in all cases?)
from client_golang.
I don't understand. _sum/_count will never return NaN, will it? It's 0 if no observations have happened yet.
When go you to get the latency 0/0 will return NaN (or is it +Inf in go?)
from client_golang.
Ah, that makes sense. Yes, 0/0
is NaN
in Go.
from client_golang.
@brian-brazil I see, the '/' was actually a mathematical operator. My bad...
Yepp, all makes sense, title of this issue already adjusted.
from client_golang.
Related Issues (20)
- Changelog automation HOT 9
- Auto increment supported Go version HOT 4
- Locally reproducible CI/CD HOT 3
- [CI]: Add Concurrency Grouping to GitHub Workflows HOT 2
- API Mocks HOT 6
- Support the SetWriteDeadline and SetReadDeadline interfaces
- Prometheus exp. format: Detect and sort series with label values containing numbers numerically not lexicographically HOT 2
- Build break after updating HOT 6
- Client model `metrics.pb.go` init function is ruining benchmarks
- Q: Are you going to release a new version anytime soon? HOT 4
- promlint: Refine lintMetricTypeInName
- Is the godoc for MetricVec.GetMetricWithLabelValues() wrong? HOT 3
- Propose to add GetMetricWithLabelvaluesIfExist fuction to XXXVec struct HOT 2
- A potential goroutine memory leak HOT 1
- Consider support for testing exemplars in prometheus/testutil HOT 4
- The latest version of the package provides methods that are not compatible with version 1.12 HOT 1
- Remove go-spew dependency HOT 2
- Document the bridge that allows for client_golang instrumented code to push with OpenTelemetry OTLP HOT 3
- go_memstats_gc_cpu_fraction HOT 3
- Configure security vuln dependabot automation for latest image.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client_golang.