Is it possible that timeseries can get replaced with a new scrapped one

17 views
Skip to first unread message

Prince

unread,
Sep 15, 2021, 7:38:23 AM9/15/21
to Prometheus Developers
HI everyone,
I am new t Prometheus, can anyone let me know:
Is it possible to replace the existing time series with new scrapped data.
For example:
at metric end:
metric_example(name:"abc") 1
metric_example(name:"xyz") 2

So for this Prometheus server will have two timeseries as:
 metric_example{instance:"192.168.47.53",job:"example",name:"abc"} 1
metric_example{instance:"192.168.47.53",job:"example",name:"xyz"} 2

is it possible that on prometheus the first timeseries get replaced with the second one, when the second one gets scrapped from metric end?

Stuart Clark

unread,
Sep 15, 2021, 7:43:27 AM9/15/21
to Prince, Prometheus Developers
On 2021-09-15 12:38, Prince wrote:
> HI everyone,
> I am new t Prometheus, can anyone let me know:
> Is it possible to replace the existing time series with new scrapped
> data.
> For example:
> at metric end:
> metric_example(name:"abc") 1
> metric_example(name:"xyz") 2
>
> So for this Prometheus server will have two timeseries as:
> metric_example{instance:"192.168.47.53",job:"example",name:"abc"} 1
> metric_example{instance:"192.168.47.53",job:"example",name:"xyz"} 2
>
> IS IT POSSIBLE THAT ON PROMETHEUS THE FIRST TIMESERIES GET REPLACED
> WITH THE SECOND ONE, WHEN THE SECOND ONE GETS SCRAPPED FROM METRIC
> END?
>

Each combinations of labels (including the metric name) is stored as a
separate time series. So in your example there are two time series, as
the "name" label is different. You are free to stop (or start) sending a
particular label combination (or even a whole metric). After 5 minutes a
time series that is no longer being presented during the scrapes will be
marked as "stale" and would stop appearing on graphs, alerts, etc.
(unless you do a query which covers a period before it goes stale).

--
Stuart Clark

TECHAX

unread,
Sep 15, 2021, 8:10:06 AM9/15/21
to Stuart Clark, Prometheus Developers
Thank you so much. Can you please tell me,Is it possible to change this 5 minutes to less time?

Stuart Clark

unread,
Sep 15, 2021, 10:22:16 AM9/15/21
to TECHAX, Prometheus Developers
On 2021-09-15 13:09, TECHAX wrote:
> Thank you so much. Can you please tell me,Is it possible to change
> this 5 minutes to less time?
>

It is possible but that isn't generally advised. Why are you wanting to
adjust that value?

--
Stuart Clark
Reply all
Reply to author
Forward
0 new messages