Comments (3)
Thank you for opening this discussion!
I believe the current behavior is correct, specifically there should be a histogram with 0 values for all of the buckets/sum/count in the file. This is to allow a user to initialize the histogram at service startup before any requests are received which allows continuous 0 values in graphs instead of missing data. See https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics for more information.
from client_python.
Hmm... It's still weird to me why the behaviour is different when there are labels vs no labels.
My main issue is with this:
Cron job runs every minute, it imports (indirectly) the metric, without using it. The disk is then flooded with empty databases...
After adding a label the problem disappears.
But I can imagine, someone in the future (not knowing this tricky behaviour) creating a new metric without a label and the problem comes back. It's difficult to keep it from happening this way.
I don't see a good solution though. :(
from client_python.
When no labels are specified the client already knows to create the metric without someone needing to call .labels()
on it so it automatically initializes it to zero to avoid the missing metrics issue.
From a Cron job do you need to be exporting metrics via multiprocess mode? It might make more sense to use something like the pushgateway and then have the metrics in memory only.
from client_python.
Related Issues (20)
- CustomCollector shows duplicate metrics HOT 1
- https://github.com/prometheus/client_python.git HOT 1
- Use of `MmapedDict` results in fd leaks (resource leaks) HOT 1
- installed package name doesnt match
- Using None as a label value breaks exposure of all metrics
- UTF-8: Implement support in Python client library
- Empty /metrics body using multiprocessing on FastAPI HOT 1
- ASGI mounted to FastAPI mounts metrics to `/metrics/` instead of `/metrics` HOT 6
- Gauge 'track_inprogress' function not working HOT 2
- Network scanners report issues because all HTTP methods are supported HOT 1
- tests/test_asgi.py failures with python 3.12 HOT 2
- real reference for API HOT 3
- _count Histogram metrics in multirprocess mode HOT 1
- Doc for disabling _created metrics out of date
- feat: remote_write support HOT 2
- Proposal: Rework metric instantiation to get-or-set from the registry HOT 1
- Provide a way to reset a Counter metric HOT 4
- Corrupted file error in multiprocessing mode HOT 2
- How to reset the Counter Variable to zero after it is changed to certain value.? HOT 1
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_python.