On Thursday, 27 February 2020 18:40:38 UTC, adi garg wrote: > > Thanks a lot, Brian, that clears a lot of things for me. Just one more > doubt is there a way to look at the current scraped metrics as I am not > sure but I think that Prometheus stores metrics in 2 hours chunk in the > memory(Ram) and after then sends them to the storage(SSD). >
That's transparent to you. Queries will merge results from the head or the stored chunks automatically. > Like how can I confirm this that my Prometheus is scraping all those > targets? > The API can give you a list of targets being scraped: https://prometheus.io/docs/prometheus/latest/querying/api/#querying-target-metadata But in general, all you need to do is to perform an instant query for the metric "up". This is a metric generated by prometheus on every scrape attempt, and has value 1 for successful scrape or 0 for failed scrape. The instant query "up" will give you the most recent value of that metric. The query "timestamp(up)" will give you the time it was set, i.e. the time of the last scrape attempt, and "time() - timestamp(up)" will give you the age in seconds since the last scrape. See timestamp() <https://prometheus.io/docs/prometheus/latest/querying/functions/#timestamp> function. > Moreover, that querying part can either be done by promql locally or using > grafana right? > > Yes, grafana just sends promQL queries to the prometheus API - the same as promtool does, and indeed the same as prometheus' own GUI does. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/4f1f8587-8ca5-4fc5-a3e8-786adeb45e33%40googlegroups.com.

