09 Sep 2024 03:34 PM - last edited on 10 Sep 2024 07:45 AM by MaciejNeumann
Hi guys,
Customer asked to show metric that holds information in seconds in day:hours:minuts:secounds format
We used toUnit format and with in the data explorer its look grate 🤗
However when saving it to tile on dashboard its mess the format we waited for 🤔
This is a managed site running version 1.296.83
In SaaS (299.83) the same format is not working in data explorer 🙄
Can any one helps and explain if this is a bug in dashboard or data explorer or may be you have another why to show seconds in different format?
Thanks in advance for your inputs
Yos
10 Sep 2024 03:54 PM
Hey @Yosi_Neuman , I once again find myself trying to do something, finding the same difficulties and looking up answers on the community to find your post 😅
I was trying to do something similar with some query times, and the easiest way I've found to do this is just to duplicate the metric and use the "Unit" option to set it to what I needed. So in your case I think you'd remove the 'tounit' on the query itself and use the options on the right:
These options depend on the data type received. Mine was in seconds and these options were available. Maybe you'll have them too?
Mine looks like this:
And the query is just the same, duplicated for how many formats I want:
It ends up producing this in the data explorer (picture of partial table):
And then I just pinned it to the dashboard and it worked:
This is on a SaaS environment. See if it helps you?
11 Sep 2024 06:45 AM - edited 11 Sep 2024 08:53 AM
Hi @PedroSantos
Small community with good guys and information in it 🤗
First of all thanks for the detailed explanation.
In our case customer asks to see downtime from month begin till now.
We calculate a metric that hold a number which is the seconds of downtime from month begin.
We need to show this metric on dashboard in format of D:HH:MM:SS
IMO Because this is a calculate metric, its got no unit assign, hence we do need the toUnit in order to ask dynatrace to show the number in seconds for start.
With out toUnit
And the unit is not set
With toUnit
Now when getting to the unit we can see that dynatrace understand that we dealing with time metric
Each format we will pick will convert the number
And so on....
Actually now I understand that we are missing a format of DD HH:MM:SS .... maybe a product idea.
And as the old song says "we will meet again" 🤓
Thanks
Yos
24 Sep 2024 04:27 PM
Hi again
Had some time to try and reproduce the issue and hope some one can help me here....
Don't ask how but I figure out that when I use: (1-(builtin:service.response.time)):splitby():setUnit(second) as metric expression the data explorer shows the the output as -8 d -11 h -42 min -40 s
And when I use ((builtin:service.response.time)-1):splitby():setUnit(second) the output is 7.4 d
First question is why when subtracting the format is dd:hh:mm:ss ?
Second question is why when saving the tile to dashboard the format is disappearing?
Any clue on what is going on here and why?
Yos