I'm looking for information how "up" metrics is calculated by Prometheus
up{job="<job-name>", instance="<instance-id>"}: 1 if the instance is healthy, i.e. reachable, or 0 if the scrape failed.
How Prometheus calculate when
the instance is healthy
I'm using Apache Cassandra with Prometheus and from time to time "up" metrics showing "down". However Cassandra working OK.
From the docs:
up{job="<job-name>", instance="<instance-id>"}
:1
if the instance is healthy, i.e. reachable, or0
if the scrape failed.
i.e. it is a per scraper / exporter metric which means whether the exporter was available / reachable or not.
Prometheus automatically adds up
metric alongside a few other metrics (such as scrape_duration_seconds
, scrape_samples_scraped
, scrape_series_added
, etc.) when scraping metrics from each configured scrape target - see these docs for more details. The up
metric is set to 1
per each successful scrape. It is set to 0
otherwise. The up
metric can be set to 0
in the following cases:
scrape_timeout
option. By default it is set to 10 seconds. See more details about this option here.There may be other reasons for failed scrape. The last reason for failed scrape can be inspected at http://prometheus-host:9090/targets
page in the error
column. See, for example, http://demo.robustperception.io:9090/targets .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With