Prometheus is scraping from offline target

i'm using Docker cAdvisor to monitor docker containers and Prometheus to scrape the cAdvisor endpoint. However, if i turn off cAdvisor and all my docker containers, Prometheus is continiung to show me actual data from the offline targets for another 5 minutes. After those 5 minute the graph-line disappears. Is this behavior intentional? And how can i change it so that when the target endpoint is not reachable, Prometheus does not show any data?

I have added an image for better understanding: enter image description here

Prometheus is configured to scrape data every 5 seconds.

Thanks for help!

1 answer

  • answered 2022-04-25 19:10 Bennet L.

    The solution is to add --query.lookback-delta=XXs as a flag when running Prometheus.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum