Convert epoch metric to datetime

Hi,

I want to have a dashboard where I can see what was the last date/time a record was processed. I created a metric that is exposed to Grafana by Prometheus that has Epoch time of last date/time a record was processed

I want to convert the timestamp to date/time (eg. DD-MM-YYYY HH:MM:SS), can someone tell me how to do it? I searched for some ways of doing it but none of them worked

Thank you

Depending on your Grafana version it should be an option to convert to time:

I tried but No Data appeared

could you toggle table view to see the raw data? also which panel type are you using and what options have you selected on? is it single stat? did you selected which values to show? I believe by default shows all numeric or _value values, and you are trying to show other, in this case “time” or maybe should be “string” ? (not sure how it is managed on Grafana UI)

This is table view

Hello,

have you tried changing the unit?

Either via Standard Options

Or, override only the unit of that field

image

1 Like

It worked by changing the unit :slight_smile:


Thank you for your help

1 Like

Glad it worked!