GithubHelp home page GithubHelp logo

Comments (2)

trallnag avatar trallnag commented on September 22, 2024

Hi @zdets, bad news, this is actually not supported by the official Prometheus client library that is used by this package. In previous versions of this package the /metrics endpoint in multi process mode was implemented incorrectly. So while these "created" metrics were available, there were most likely not correct.

Please see this example highlighting the behavior: https://github.com/trallnag/prometheus-fastapi-instrumentator/tree/master/devel/examples/prom-multi-proc-gunicorn

Also see the documentation: https://github.com/prometheus/client_python#multiprocess-mode-eg-gunicorn

To handle this the client library can be put in multiprocess mode. This comes with a number of limitations:

  • Registries can not be used as normal, all instantiated metrics are exported
  • Registering metrics to a registry later used by a MultiProcessCollector may cause duplicate metrics to be exported
  • Custom collectors do not work (e.g. cpu and memory metrics)
  • Info and Enum metrics do not work
  • The pushgateway cannot be used
  • Gauges cannot use the pid label
  • Exemplars are not supported

Not sure if there is a workaround.

from prometheus-fastapi-instrumentator.

zdets avatar zdets commented on September 22, 2024

Thanks for the clarification.

from prometheus-fastapi-instrumentator.

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.