Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prometheus endpoint of all available metrics

I was curious concerning the workings of Prometheus. Using the Prometheus interface I am able to see a drop-down list which I assume contains all available metrics. However, I am not able to access the metrics endpoint which lists all of the scraped metrics. The http://targethost:9090/metrics endpoint only displays the metrics concerning the Prometheus server itself. Is it possible to access a similar endpoint which lists all available metrics. I could perform a query based on {__name__=~".+"} but I would prefer to avoid this option. Maybe I should also add that accessing the endpoints listed in the targets section does not work for me with as "a connection cannot be established".

like image 955
Tony.H Avatar asked Oct 10 '19 09:10

Tony.H


People also ask

What is Prometheus metrics endpoint?

What Is Prometheus? Prometheus is a monitoring solution for recording and processing any purely numeric time-series. It gathers, organizes, and stores metrics along with unique identifiers and timestamps. Prometheus is open-source software that collects metrics from targets by "scraping" metrics HTTP endpoints.

How do you get all the metrics in Prometheus?

Getting all metric names Note: A more efficient, non-PromQL way to get the same information is to use Prometheus's label values metadata endpoint to get all values for the __name__ label, e.g.: https://demo.promlabs.com/api/v1/label/name/values.

Where does Prometheus store all its metric data?

Prometheus stores its on-disk time series data under the directory specified by the flag storage. local. path . The default path is ./data (relative to the working directory), which is good to try something out quickly but most likely not what you want for actual operations.

How many Prometheus metrics are there?

Prometheus uses a very simple metric model with four metric types that are only supported in the client libraries.


1 Answers

The endpoint for that is http://localhost:9090/api/v1/label/__name__/values

API Reference

like image 159
vinodk Avatar answered Sep 22 '22 06:09

vinodk