Prometheus Endpoint of All Available Metrics
In Prometheus, you can access the endpoint that lists all available metrics by querying the /metrics
endpoint of your Prometheus server. Here’s how to access this information:
Accessing the Metrics Endpoint
Default Metrics Endpoint: The default endpoint for Prometheus metrics is:
http://<prometheus-server>:9090/metrics
Replace
<prometheus-server>
with the hostname or IP address of your Prometheus server. If you're accessing it locally, you can uselocalhost
.Accessing via a Web Browser or Curl: You can access the metrics endpoint in a web browser by entering the URL:
<http://localhost:9090/metrics>
Alternatively, you can use
curl
from the command line:curl <http://localhost:9090/metrics>
List of Available Metrics: Once you access the
/metrics
endpoint, you will see a plain text output containing all the metrics currently being scraped by Prometheus. The metrics will be listed in the following format:# HELP <metric_name> <help_text> # TYPE <metric_name> <type> <metric_name>{<label1>="<value1>",<label2>="<value2>"} <value>
Each metric is prefixed with
# HELP
and# TYPE
, which provide additional information about what the metric represents and its data type.
Additional Information
- Metrics from Exporters: If you are using exporters (like Node Exporter, Blackbox Exporter, etc.), each exporter will also expose its metrics at its configured endpoint, typically accessible in a similar manner.
- Filtering Metrics: If you have many metrics and need to filter them, you can use Prometheus queries in the Prometheus UI (usually accessible at
http://localhost:9090
):- Use the "Graph" or "Expression" tab to write queries. For example, you can type
up
to see the metric for the status of monitored targets.
- Use the "Graph" or "Expression" tab to write queries. For example, you can type
- Explore Metrics via Grafana: If you are using Grafana as a front end for Prometheus, you can also view available metrics by creating a new panel and exploring the metric selection dropdown, which will list available metrics.
Conclusion
Accessing the Prometheus metrics endpoint is straightforward and provides a comprehensive list of all the metrics being collected. This endpoint is essential for understanding what metrics are available for monitoring and alerting.
Make your mark
Join the writer's program
Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.
Write for usBuild on top of Better Stack
Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.
community@betterstack.comor submit a pull request and help us build better products for everyone.
See the full list of amazing projects on github