We are excited that you joined our OSS community. Please read about some of the FAQs in the community
NOTE:
Grafana’s current latest stable version is 9.4.7 and the version you are using is a bit older now. Also, there are numerous bug fixes and improvements had been made along the releases (see Changelog)
The recommendation would be to test this in the recent stable version and if that does not work then feel free to report it here. (for now, I will now close this issue).
Coming back to your question:
Can you please try to reproduce this same issue on https://play.grafana.org/ and then share the dashboard link so that we can view it?
Thank you for responding.
I am using metric to see load avg for a device. So it would be able to see it in a panel.
But do you a way to get it in any other way?
Here the actual timestamp has been passed as the label. The loadavg 41.49 was at timestamp value: 1679493780000 (Wednesday, March 22, 2023 2:03:00 PM)
I would like to plot a graph with 41.49 against timestamp Wednesday, March 22, 2023 2:03:00 PM.
Thanks for the explanation. I checked and it is possible in Prometheus by using the time series panel. Here is a demo link which shows the timestamp on X-axis and the metric on Y-axis
This is however not possible using the Gauge Panel as it supports single-value visualization.
Thanks a lot for your message. Really appreciate your help. Can you please tell me how can I use in time series grafana panel to convert label to x-axis time.?
I am not expert with the PromQL but AFAIK it should work without any custom settings, as Prometheus records metrics in a time series database and uses HTTP pull request model.
Just use the Time Series Panel and define your PromQL and should see the time scale on x-axis.
Hi Usman, I am looking to do the same thing as this user. The link you provided previously does not work anymore. Do you know if it has moved, or could you otherwise help instruct me on how to use timestamp provided in label as the time value in a Grafana panel with Prometheus data source?
Thank you for the updated links, I looked through but didn’t see where in the panel or query configs the portion where it uses a label as the timestamp value?
I’m a bit confused, are you trying to create a gauge or a time-series panel?
For a gauge, maybe you’re looking for:
Options > Legend : {{ timestamp }} in the PromQL query editor.
For time-series panels, It’s not possible as far as I know.
I would still recommend to upgrade to Grafana 9 or 10 (you mentioned Grafana 7)
Also, storing timestamps in a label seems like a bad idea, as it will probably generate high-cardinality metrics, but I guess it depends on what you’re trying to achieve.
@mikhailvolkov
Thanks for your inputs. I was waiting for the shared instance of grafana to be upgraded. Now that the grafana is upgraded I was able to use the label to fields transformation to extract the timestamp how do I set this timestamp as the x axis in the Time series panel?