Coder Social home page Coder Social logo

Comments (3)

csmarchbanks avatar csmarchbanks commented on June 12, 2024

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.

JinLisek avatar JinLisek commented on June 12, 2024

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.

csmarchbanks avatar csmarchbanks commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.