Add metrics to back(old) time in Prometheus

1,229 views
Skip to first unread message

Sagar

unread,
Nov 1, 2021, 3:04:26 AM11/1/21
to Prometheus Users
Hi ,
I want to add metrics to older timestamp in Prometheus . 
I am receiving few metrics on weekly basis in CSV and then I want to add to previous dates .

Eg . 

Alert-triggered, date created , date closed , status 
Alert123, 10 Oct 2021 10:03 AM, 10 Oct 2021 12:26 PM , closed 

Thanks 

Brian Candler

unread,
Nov 1, 2021, 4:09:39 AM11/1/21
to Prometheus Users
This is called "backfilling":
https://medium.com/tlvince/prometheus-backfilling-a92573eb712c

However, it's critical that you remember that all metrics are in Prometheus are numeric float64 values.  Strings like "Alert-triggered" can only exist as labels on a timeseries.  You definitely *don't* want timestamps as labels, as this will cause a cardinality explosion - since the unique combination of labels defines a timeseries, you'll end up with a new timeseries for every data point.  If you don't understand this, then probably prometheus is not the database for you: you need an event database like Loki or Elasticsearch.

However it would be OK to represent date created and date closed as *numeric* values on a metric, the number of seconds since the epoch.
Reply all
Reply to author
Forward
0 new messages