How to convert Epoch time to date in prometheus

2,459 views
Skip to first unread message

Prajakta

unread,
Aug 29, 2019, 6:18:26 AM8/29/19
to Prometheus Users
Hello All,

I am receiving result of parameter "kube_cronjob_status_last_schedule_time" in epoch date. How I can convert this result in days/hours/minutes?

Can anybody please help?

Regards,

Prajakta

Stuart Clark

unread,
Aug 29, 2019, 6:27:54 AM8/29/19
to Prajakta, Prometheus Users
What are you using to display things? Grafana?


--
Stuart Clark

Prajakta

unread,
Aug 29, 2019, 6:36:39 AM8/29/19
to Prometheus Users
No, I want this result in Prometheus :(.

Julien Pivotto

unread,
Aug 29, 2019, 6:53:48 AM8/29/19
to Prajakta, Prometheus Users
On 29 Aug 03:18, Prajakta wrote:
> Hello All,
>
> I am receiving result of parameter "kube_cronjob_status_last_schedule_time"
> in epoch date. How I can convert this result in days/hours/minutes?

Do you want: day_of_month(process_start_time_seconds) ?


or time() - kube_cronjob_status_last_schedule_time / 3600 ?


>
> Can anybody please help?
>
> Regards,
>
> Prajakta
>
> --
> 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-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1c10ee98-ab95-473b-acb8-b0de06d40c21%40googlegroups.com.


--
(o- Julien Pivotto
//\ Open-Source Consultant
V_/_ Inuits - https://www.inuits.eu
signature.asc

Prajakta

unread,
Aug 29, 2019, 7:54:54 AM8/29/19
to Prometheus Users
Hey,

time() - kube_cronjob_status_last_schedule_time  this worked for me. Got time in seconds :)

Thank you so much.

On Thursday, August 29, 2019 at 4:23:48 PM UTC+5:30, Julien Pivotto wrote:
On 29 Aug 03:18, Prajakta wrote:
> Hello All,
>
> I am receiving result of parameter "kube_cronjob_status_last_schedule_time"
> in epoch date. How I can convert this result in days/hours/minutes?

Do you want: day_of_month(process_start_time_seconds) ?


or time() - kube_cronjob_status_last_schedule_time / 3600 ?


>
> Can anybody please help?
>
> Regards,
>
> Prajakta
>
> --
> 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 promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages