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

KeyMetric Format

Guys, I'm extracting a decimal field from the bank, which returns, for example, 30.66666. I put keymetric and metrics in my code. The problem is that in KeyMetrics it returns 0 in the UI and in the metric I have the correct return, that is, 30.6. What do I need to do so that in KeyMetric's UI I also have the correct return? That's minutes.

 

RodrigoBiaggio_0-1635600158430.png

 

RodrigoBiaggio_1-1635600196595.png

RodrigoBiaggio_2-1635600677716.png

My Code:

 

 

   "ui": {
    "keymetrics": [
      {
        "key": "avg_consolidado",
        "aggregation": "count",
        "mergeaggregation": "max",
        "displayname": "AVG Cancelar Portabilidade"
      }
    ],
    "keycharts": [
      {
        "group": "Tempo Médio",
        "title": "Cancelar Portabilidade",
        "series": [
          {
            "key": "avg_consolidado",
            "displayname": "Tempo Médio",
            "seriestype": "area",
            "color": "#74cff7"
          }
        ]
      }
    ]
  },
  "metrics": [
    {
      "timeseries": {
        "key": "avg_consolidado",
        "unit": "Count",
        "displayname": "Tempo Médio - Cancelar Portabilidade",
        "aggregation": "MAX"
      },
      "entity": "CUSTOM_DEVICE",
      "alert_settings": [
        {
          "alert_id": "custom_consolidado_alert",
          "event_type": "ERROR_EVENT",
          "event_name": "Tempo Médio Acima do SLA!!",
          "description": "The {metricname} of {severity} is {alert_condition} the threshold of {threshold}",
          "threshold": 100.0,
          "alert_condition": "ABOVE",
          "samples": 5,
          "violating_samples": 1,
          "dealerting_samples": 5
        }
      ]
    }
  ]
}

 

 

Can anybody help me?

Dynatrace Professional
3 REPLIES 3

AntonioSousa
DynaMight Guru
DynaMight Guru

You have defined avg_consolidado with a unit "Count".

You probably want to use unit "second".

Please check the Timeseries section at:

https://www.dynatrace.com/support/help/extend-dynatrace/extensions/reference/json-reference/extensio...

 

Antonio Sousa

Hi, @AntonioSousa, I already change the unit, aggregation, mergeaggregation but nothing changes the key metric value. See this example. My metric brings the correct value of 5, however, my keyMetric remains at 0. I've made several changes and nothing makes the value return correctly. I don't know exactly what I'm doing wrong.

RodrigoBiaggio_0-1635682244488.png

 

RodrigoBiaggio_1-1635682259836.png

 

RodrigoBiaggio_2-1635682271958.png

 

 

Dynatrace Professional

I changed device.relative and device.group and now it's working.

Dynatrace Professional

Featured Posts