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

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

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