Search code examples
prometheusgrafana

Grafana table shows my label but automitically hide the starting "zero"


I have a metric looks like this:

my_metric{targetTime="0930"} 1

I'm showing it in grafana table with a transformgrouping to matrix and use targetTime as Row, so it looks like below:

enter image description here

What I'm tring to do is when I click on the value cell, it will link to another panel with a variable var-targetTime=0930 so I can see details about this targetTime.

Well, but as you can see, it neglect the starting zero in 0930 and shows as 930, so when I add a data link to the cell, it generates an url like var-targetTime=930 so if I use this variable in my promql, nothing matches.

Anyone knows how to solve this?


Solution

  • Just to close this question:

    Thanks to @markalex 's advice but to convert field type to String does not solve this at first, then I noticed that I added a Standard Option here as:

    enter image description here

    So I need to override the standard option of the targetTime column and set Unit as String. This solves it perfectly. FYI.