Thank you all for replying. Very crystal clear answers.

On Friday, February 28, 2020 at 2:16:46 AM UTC+5:30, Brian Candler wrote:
>
> 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/71c60279-5930-4e27-b2c1-f8e9a8251853%40googlegroups.com.

Reply via email to