cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Metrics expression just for fun

henk_stobbe
DynaMight Champion
DynaMight Champion

Hello,

 

If you use a metric expression to get a ratio together with a default(0) option like:

var_total:default(0)/var_part:default(0)

Dynatrace will, if there is no measurement, do a 0/0! this will result in a "does not exist".

so you better use an extra default(0) to correct this?

KR Henk 

1 REPLY 1

JoseRomero
Dynatrace Helper
Dynatrace Helper

Hi henk_stobbe,

To avoid the 0/0 error you mentioned, you can use the default(1) option in the denominator instead of default(0). This way, if there is no measurement, the denominator will be 1, and any number divided by 1 will be that same number, while 0 divided by 1 will be 0 and will not cause an error.

Here is how you can adjust your metric:

var_total:default(0)/var_part:default(1)

 

JoseRomero_1-1717529567595.png

 

Featured Posts