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

Metrics to pull the k8s services with 0 Pods or returning to 503

Venkat8
Visitor

I'm trying to find a way in Dynatrace to check which Kubernetes services either have no pods running or are returning 503 errors. I’ve looked through the available service metrics, but they don’t seem to show any pod-level details. Any ideas on how I can get this info

1 REPLY 1

radek_jasinski
DynaMight Guru
DynaMight Guru

You can use DQL:

timeseries runningPods = sum(dt.kubernetes.pods),
filter: {pod_phase == "Running"},
by: {k8s.namespace.name, k8s.workload.name, pod_phase},
from: -5m
| filter arrayMax(runningPods) == 0

or

timeseries total503 = count(http.metric),
filter: {http.response.status == 503},
by: {dt.entity.service, k8s.namespace.name},
from: -5m
| sort arrayMax(total503) desc

 

Have a nice day!

Featured Posts