# How to use Prometheus value as Timestamp

**URL:** <https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848>\
**Category:** Prometheus\
**Created:** [July 26, 2023, 6:08pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848 "2023-07-26T18:08:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvsmoove](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kvsmoove](https://community.grafana.com/u/kvsmoove)\
**Post date:** [July 26, 2023, 6:08pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848/1 "2023-07-26T18:08:41Z")

</div>

Hi, does anyone know if it is possible to use a Prometheus metric value that happens to be a timestamp as the timestamp when that metric is graphed in Grafana?

Our metric returns a value such as 1690396973. We can convert this into a time value by changing the unit to date/time, however I am unable to see a way to use this returned value as the primary timestamp in the panel.

 ![timestamp](https://us1.discourse-cdn.com/grafana/original/3X/d/3/d34c782732b2e48a2e2de59d6f794f985baac03d.png)

This is the best I could come up with, where the returned metric value time is on the Y axis and the native Prometheus timestamp is on the X axis. We would really like to be able to use the results of that query as the timestamp on the X axis and disregard the Prometheus timestamp entirely. Is something like that possible?

My query currently is something like this:

test\_metric{label=“label”} \* 1000

---

<div class="post-metadata">

**Author:** ![sanpraka](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sanpraka](https://community.grafana.com/u/sanpraka)\
**Post date:** [November 7, 2024, 12:40pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848/2 "2024-11-07T12:40:41Z")

</div>

@kvsmoove Is your issue resolved? Please let me know how did you achieve that? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kvsmoove](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kvsmoove](https://community.grafana.com/u/kvsmoove)\
**Post date:** [November 7, 2024, 2:15pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848/3 "2024-11-07T14:15:40Z")

</div>

It was not able to be resolved, we ended up moving to a different data source for that product that had strict timestamp requirements.

---

<div class="post-metadata">

**Author:** ![dawiddebowski](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/dawiddebowski/32/49435_2.png) [@dawiddebowski](https://community.grafana.com/u/dawiddebowski)\
**Post date:** [November 21, 2024, 9:13pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848/4 "2024-11-21T21:13:20Z")

</div>

Hi, you could theoretically go into transformations and do:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/4/d47a17ae4acfcf701b8e2583e19ace131a4edfdd.png)

but the problem is - you don’t have anything to plot (no numbers). I can hardly imagine such a scenario (as long as you don’t need “that thing happened here”, where you `Add field from caluclation` to just mark the point).

---

<div class="post-metadata">

**Author:** ![mustaphakt610](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@mustaphakt610](https://community.grafana.com/u/mustaphakt610)\
**Post date:** [February 27, 2025, 2:00pm UTC](https://community.grafana.com/t/how-to-use-prometheus-value-as-timestamp/99848/5 "2025-02-27T14:00:19Z")

</div>

![111](https://us1.discourse-cdn.com/grafana/original/3X/1/5/153f92e6ea4a0db23f56ba7cbee7804faf399a98.png)  
Please, if you can help me, I was able to display the first time the condition occurred (any server’s utilization rate reaches above 85%) using functions such as  
min\_over\_time(), timestamp()  
I was able to display the time correctly as you can see, but I notice that the time and date increases by a minute with each refresh and this weakens the accuracy of the date and I want to prove the value of the date, can you please help me?
