30 Oct 2021 02:31 PM - last edited on 18 May 2023 12:35 PM by Michal_Gebacki
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.
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?
Solved! Go to Solution.
30 Oct 2021 06:07 PM
You have defined avg_consolidado with a unit "Count".
You probably want to use unit "second".
Please check the Timeseries section at:
31 Oct 2021 12:11 PM
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.
03 Nov 2021 04:59 PM
I changed device.relative and device.group and now it's working.