22 Nov 2021 08:24 PM
Guys, I have two keymetrics and I need them to return values on my device.
How should I set device relative and group absolute?
Today no data is returned, the two metrics were not created.
device.relative(key='avg_time_cancelar_portabilidade_30_dias', value=avg_time_cancelar_portabilidade_30_dias)
group.absolute(key='avg_time_cancelar_portabilidade_mes_corrente', value=avg_time_cancelar_portabilidade_mes_corrente)
"configUI": {
"displayName": "DICT - Cancelar Portabilidade (Tempo Médio)"
},
"ui": {
"keymetrics": [
{
"key": "avg_time_cancelar_portabilidade_mes_corrente",
"aggregation": "max",
"mergeaggregation": "sum",
"displayname": "Mês Corrente"
},
{
"key": "avg_time_cancelar_portabilidade_30_dias",
"aggregation": "max",
"mergeaggregation": "sum",
"displayname": "Ultimos 30 dias"
}
],
"keycharts": [
{
"group": "ANS DICT",
"title": "Cancelar Portabilidade",
"series": [
{
"key": "avg_time_cancelar_portabilidade_mes_corrente",
"displayname": "Média em Minutos",
"seriestype": "area",
"color": "#4d4dff"
},
{
"key": "avg_time_cancelar_portabilidade_30_dias",
"displayname": "Média em Minutos",
"seriestype": "area",
"color": "#4d4dff"
}
]
}
]
},
"charts": [
{
"group": "ANS DICT",
"title": "Cancelar Portabilidade",
"series": [
{
"key": "avg_time_cancelar_portabilidade_mes_corrente",
"displayname": "Média em Minutos",
"seriestype": "area",
"color": "#4d4dff"
},
{
"key": "avg_time_cancelar_portabilidade_30_dias",
"displayname": "Média em Minutos",
"seriestype": "area",
"color": "#4d4dff"
}
]
}
],
"metrics": [
{
"timeseries": {
"key": "avg_time_cancelar_portabilidade_mes_corrente",
"unit": "Count",
"aggregation": "MAX",
"displayname": "Cancelar Portabilidade - Mês Corrente"
},
"entity": "CUSTOM_DEVICE_GROUP"
},
{
"timeseries": {
"key": "avg_time_cancelar_portabilidade_30_dias",
"unit": "Count",
"aggregation": "MAX",
"displayname": "Cancelar Portabilidade - Últimos 30 Dias"
},
"entity": "CUSTOM_DEVICE_GROUP"
}
]
}
Solved! Go to Solution.
23 Nov 2021 10:01 AM - edited 23 Nov 2021 10:01 AM
Hi, you'd have to send the absolute metric to the device as well and not to the group.
That being said, you should see the relative device metric if it constantly is increasing. Can you write avg_time_cancelar_portabilidade_30_dias to the logger just before the device.relative line to make sure that it's an ever increasing value?
Mike