Log last Timestamp with label as name

I recently started using Grafana via the Grafana Cloud Stack (I guess that makes it version 9.5.1?)

I am pushing my data to the provided Prometheus endpoint and everything works smoothly as expected expect for one thing which I am currently struggling to figure out how to solve it.

I want to log how long the last log of my devices is ago (in minutes). And as the title for each single display I want the name of my device which is provided inside the label.

For that I am using a Stat visualization. and query any of the metrics I expect from my devices and choose the following options for the Stat visualization:

  • Calculation: Last
  • Fields: Time
  • Unit: From Now

Everything else is left to its default value.

This works as expected but as the name I get “Time” for each of my devices and I can’t figure out how to select a the device name.

Any help is appreciated

Welcome @phillipdiekmann to the Grafana forum.

Can you share what you have in these settings?

and also share your screen when the view is toggled to “Table view”?

Thanks @grant2 and cheers for your help.

Sure, those are my settings:


And this is the screen when toggled to “Table View”

I found a workaround by sending the timestamp as a metric itself. This way I can make it look like I want:

However, I am still wondering how to achieve this without sending a dedicated metric for it.

What other choices besides Time are here? If there is a choice for Device, how does selecting that change your panel display?

Also, in Table View, I was expecting to see a dropdown whereby you could select the field (device name) being displayed. Is there indeed no dropdown?

These are the selections in the dropdown of the Table View:

The are the other choices:


I had a look at the response of the Query I am using and this is what it looks like for a single device:

The issue I see is that the field “Time” does not include the labels which are only listed for the field “Value”. Until now I wasn’t able to add the labels to the filed “Time” which I think could solve the issue