24 Mar 2022 10:39 AM - last edited on 25 Mar 2022 09:23 AM by MaciejNeumann
I have a problem trying to configure alerting (custom anomaly detection) where the calculation includes one dimensionless metric and another with the wished dimensions. The same metric expression works great in Data explorer and dashboards but not in alerting because the metrics API tries to apply the filter also to the dimensionless metric.
The metric expression uses Prometheus metrics exposed by cert-manager like this:
(certmanager_certificate_renewal_timestamp_seconds:splitBy("name","namespace","k8s.deployment.name","dt.entity.kubernetes_cluster")/86400)-(certmanager_clock_time_seconds_gauge:splitBy()/86400)
I have checked the Dynatrace server logs and the actual alerting component queries metrics API for each combination with selector as this:
((certmanager_certificate_renewal_timestamp_seconds:splitBy(name,namespace,\"k8s.deployment.name\",\"dt.entity.kubernetes_cluster\")/86400)-(certmanager_clock_time_seconds_gauge:splitBy()/86400)):filter(eq(\"dt.entity.kubernetes_cluster\",KUBERNETES_CLUSTER-4F32D9E28C22C7F1),eq(\"k8s.deployment.name\",cert-manager),eq(name,test-cert),eq(namespace,test-namespace))
If I try that query in Data explorer it fails because it tries to apply the filter also to that dimensionless metric "certmanager_clock_time_seconds_gauge:splitBy()" - it's made dimensionless with that empty splitBy.
I'm just wondering why does Dynatrace even try to apply a filter to a dimensionless metric because it would always fail?
Solved! Go to Solution.
24 Mar 2022 11:34 AM
Yes that is a bug we recently encountered in the alerting module. We are working on a fix.
24 Mar 2022 01:12 PM
I understand that this can be fixed in the alerting module also but I think there should be a fix in the metrics API as well.
The documentation basically says that a fixed number and a dimensionless metric behave similarly (creating tuples etc.) except that a dimensionless metric is a series. They still don't behave the same regarding that filter transformation. I think they should both be excluded from filter transformation and it might have solved the issue also in this other topic: https://community.dynatrace.com/t5/Dashboarding/I-can-t-create-latency-SLO-using-calculated-metric/m...
24 Mar 2022 03:03 PM
Yes sorry I was not precise enough. We are working on a fix at the moment and the fix is done in the metric query subsystem that includes a fix on API as well as on alerting.
Best greetings,
Wolfgang
02 May 2022 09:10 AM
Hi, @wolfgang_beer . Could you tell in which version of a Managed Dynatrace can we expect the fix?
02 May 2022 10:01 AM
Hi @ext-Antti_Elonh there are 2 topics still upcoming for DT Managed support which are:
- View the list of problems (precondition is Managed Release 240)
- Push notifications for Managed Environments (expect that in Mai)
Best greetings,
Wolfgang
03 May 2022 11:09 AM
Hi,
I was wondering about the fix to metric query problem in anomaly detection.
10 May 2022 09:15 AM
According to what I see from dev side, this reported issue was fixed with Dynatrace release 239.
Best greetings,
Wolfgang
25 May 2022 02:56 PM
Our managed cluster was updated to v1.240 last night and these custom alerts started to work as expected.
30 May 2022 06:51 AM
@ext-Antti_Elonh Excellent, many thanks for sharing this confirmation with us!
Best greetings,
Wolfgang