[prometheus-users] Re: Hisorical data

2022-09-26 Thread Brian Candler
On Monday, 26 September 2022 at 13:10:57 UTC+1 chembakay...@gmail.com wrote:

> *Query:*  up{instance=~"$unreachbale_instance"} and up
>
> This query is giving me some instances which were already removed from 
> promethues.yml
>
>
Is it still the same after waiting at least 5 minutes?

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/261f0592-5698-46e9-a586-10c53df40b6bn%40googlegroups.com.


Re: [prometheus-users] Re: Hisorical data

2022-09-26 Thread Stuart Clark

On 26/09/2022 14:33, BHARATH KUMAR wrote:

Thanks for your reply.

If I use deletion API will it delete all the stored data or will it 
delete the instances data I deleted in the Prometheus.yml file.


It will delete whatever you tell it to delete:

https://prometheus.io/docs/prometheus/latest/querying/api/#delete-series

--
Stuart Clark

--
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/a745eee2-58bf-06ce-ffcf-95fc96ab2c9b%40Jahingo.com.


Re: [prometheus-users] Re: Hisorical data

2022-09-26 Thread BHARATH KUMAR
Thanks for your reply.

If I use deletion API will it delete all the stored data or will it delete 
the instances data I deleted in the Prometheus.yml file.

Thanks & regards,
Bharath Kumar.

On Monday, 26 September 2022 at 18:33:12 UTC+5:30 Stuart Clark wrote:

> On 26/09/2022 13:10, BHARATH KUMAR wrote:
>
> *Query:*  up{instance=~"$unreachbale_instance"} and up
>
> This query is giving me some instances which were already removed from 
> promethues.yml
>
> That's expected.
>
> The jobs in prometheus.yaml and the targets referenced are just what 
> Prometheus should scrape "now". You can add and remove targets whenever you 
> want, which will change what new data is collected. However it has nothing 
> to do with the ongoing storage of data within the timeseries database. The 
> main configuration for local storage is the number of days (or total 
> storage) values, which default to storing 14 days of data. So by default if 
> you stop scraping something today it would continue to exist (with all 
> previous metrics) for another two weeks. Note also that any remote read 
> system could also continue to return data depending on how that external 
> system was configured.
>
> If you have something stored in the local Prometheus store (rather than 
> something you are using remote read with) and don't want to wait until it 
> expires (14 days or whatever you configured) you can use the deletion API.
>
> -- 
> Stuart Clark
>
>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/09fcd67d-ba8b-497c-aa15-b8000138a781n%40googlegroups.com.


Re: [prometheus-users] Re: Hisorical data

2022-09-26 Thread Stuart Clark

On 26/09/2022 13:10, BHARATH KUMAR wrote:

*Query:* up{instance=~"$unreachbale_instance"} and up

This query is giving me some instances which were already removed from 
promethues.yml


That's expected.

The jobs in prometheus.yaml and the targets referenced are just what 
Prometheus should scrape "now". You can add and remove targets whenever 
you want, which will change what new data is collected. However it has 
nothing to do with the ongoing storage of data within the timeseries 
database. The main configuration for local storage is the number of days 
(or total storage) values, which default to storing 14 days of data. So 
by default if you stop scraping something today it would continue to 
exist (with all previous metrics) for another two weeks. Note also that 
any remote read system could also continue to return data depending on 
how that external system was configured.


If you have something stored in the local Prometheus store (rather than 
something you are using remote read with) and don't want to wait until 
it expires (14 days or whatever you configured) you can use the deletion 
API.


--
Stuart Clark

--
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/042d05bd-173d-8af9-b44d-fe8c53df0547%40Jahingo.com.


[prometheus-users] Re: Hisorical data

2022-09-26 Thread BHARATH KUMAR
*Query:*  up{instance=~"$unreachbale_instance"} and up

This query is giving me some instances which were already removed from 
promethues.yml

Is there any mistake I am doing?
On Friday, 23 September 2022 at 22:05:51 UTC+5:30 Brian Candler wrote:

> https://www.robustperception.io/deleting-time-series-from-prometheus/
>
> However, it's still true that you *were* monitoring those servers, and 
> this history may be useful  You don't have to throw away the data.  Just 
> limit your query like this:
>
> max_over_time(up{instance=~"$instance",job="node_exporter"}[30d]) == 0 *and 
> up*
>
> "up" is a metric that's always present for any scrape job, and absent if 
> not.  So this query will filter out anything which is not actively being 
> scraped (within the last 5 minutes)
>
> On Friday, 23 September 2022 at 12:25:51 UTC+1 chembakay...@gmail.com 
> wrote:
>
>> Hello All,
>>
>> I deleted some instances from the prometheus.yml file. But still, I am 
>> able to see those servers' historical data. What should I do so that those 
>> instances which I removed, those instances historical data should not have 
>> appeared?
>>
>> Example:
>> I am finding the unreachable servers for 30 days
>>
>>  *Query :* 
>> max_over_time(up{instance=~"$instance",job="node_exporter"}[30d]) == 0
>>
>> There are some servers that were unreachable for the last 30 days. Among 
>> these servers, I deleted a few of them from prometheus.yml. But still, I am 
>> able to see those servers in the output. 
>>
>> What should I do so that I didn't get these servers' details?
>>
>> Thanks & regards,
>> Bharath Kumar.
>>
>>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/bb57a8f7-852b-41df-9e85-6fe918680d2cn%40googlegroups.com.


[prometheus-users] Re: Hisorical data

2022-09-23 Thread Brian Candler
https://www.robustperception.io/deleting-time-series-from-prometheus/

However, it's still true that you *were* monitoring those servers, and this 
history may be useful  You don't have to throw away the data.  Just limit 
your query like this:

max_over_time(up{instance=~"$instance",job="node_exporter"}[30d]) == 0 *and 
up*

"up" is a metric that's always present for any scrape job, and absent if 
not.  So this query will filter out anything which is not actively being 
scraped (within the last 5 minutes)

On Friday, 23 September 2022 at 12:25:51 UTC+1 chembakay...@gmail.com wrote:

> Hello All,
>
> I deleted some instances from the prometheus.yml file. But still, I am 
> able to see those servers' historical data. What should I do so that those 
> instances which I removed, those instances historical data should not have 
> appeared?
>
> Example:
> I am finding the unreachable servers for 30 days
>
>  *Query :* 
> max_over_time(up{instance=~"$instance",job="node_exporter"}[30d]) == 0
>
> There are some servers that were unreachable for the last 30 days. Among 
> these servers, I deleted a few of them from prometheus.yml. But still, I am 
> able to see those servers in the output. 
>
> What should I do so that I didn't get these servers' details?
>
> Thanks & regards,
> Bharath Kumar.
>
>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ed751cf7-e8f1-4f14-b3c9-c75b24ae35fdn%40googlegroups.com.