0

I am creating observability metrics which needs some variables. The variables I am looking for is currentDate or currentHour. I am adding Query type and Data Source is Prometheus, however I am not able to get result for hour() function. It is giving me some errors as mentioned in the screen shot. If I am trying this function in Prometheus console it is giving me expected output. What is a better way of using these functions ?

If it is not supported in Grafana so is there any way to define below variables: Todays date: 2022-11-08 Hour: 14 (2pm)

Thanks in advance Grafana console Prometheus console

Wanted support for Grafana charts

hakash
  • 1
  • 1

1 Answers1

1

You can't assign Prometheus function values (or metrics values) to variables in Grafana, but you can add a query in a panel and use it in calculations or other operations in the "Transform" tab.

Ex:

enter image description here