prometheus / client_python

Prometheus instrumentation library for Python applications
Apache License 2.0
3.93k stars 795 forks source link

real reference for API #1021

Open ShashankSureshRotti opened 5 months ago

ShashankSureshRotti commented 5 months ago

https://prometheus.github.io/client_python/

this is like a getting start hello world example

is there like a real API ref for the classes etc..

kakkoyun commented 5 months ago

Thanks for reaching out.

That's true; we can add more complicated real-life examples. However, the package is also used by a significant number of open-source Python applications that are publicly available.

Please let us know if you have anything particular you would like to see in the docs.

Azmisov commented 4 months ago

Yes, I would like to see API docs as well. Examples are fine, but you need to document the API. For example, creating a Gauge instance: the example given under the Gauge page doesn't document all the parameters that can be passed to the Gauge constructor, nor supplementary methods you can call like .labels.

Digicrat commented 3 months ago

Another vote for publishing a full API documentation (even just an auto-generated one).

More simply, I also suggest adding to the main "Getting Started" page links to a handful of those publicly available open-source applications using this API as real-world examples. The main Prometheus documentation includes links to many examples, but does not differentiate what language they are written in (most are in Go), making it difficult to find relevant Python-based examples.

funkyfuture commented 3 weeks ago

my current use case would be that i'm looking at scripts here: https://github.com/prometheus-community/node-exporter-textfile-collector-scripts and they use functions and classes that are not mentioned in the examples. a complete inventory of the API would enable me to find what i need to solve my problems w/o reading the source code.