24 Jun 2026 10:01 AM - edited 24 Jun 2026 10:01 AM
what api can be used to get events from all pods from a kubernetes cluster?
24 Jun 2026 10:56 AM
I tested the following API endpoint to retrieve Kubernetes-related events:
{{baseUrl}}/it_prod-dynatrace-environment-apac/v2/events?entitySelector=entityId(KUBERNETES_CLUSTER-0FB79669080C9DD5)&from=now-60d&to=now&pageSize=500
Observation:
The query successfully returns events for the Kubernetes cluster (KUBERNETES_CLUSTER-0FB79669080C9DD5).
However, no events for individual Kubernetes pods are included in the response.
24 Jun 2026 11:26 AM
Use DQL:
fetch events
| filter k8s.cluster.name == "mycluster"
| filter event.provider == "KUBERNETES_EVENT" or event.provider == "KUBERNETES_INFERRED_EVENT"
And use the platform /platform/storage/query/v1 API , see https://developer.dynatrace.com/develop/guides/access-platform-apis-from-outside/ on how to access it.
Or use dtctl insted which might be much easier to use.
24 Jun 2026 11:51 AM
@Julius_Loman I'm using dynatrace classic, how can I use this query?
24 Jun 2026 12:00 PM
With Dynatrace Classic or Dynatrace Managed you are left with the Events API that @AntonPineiro suggested.
You need to select events from workloads running in the kubernetes cluster and you must adjust entitySelector accordingly.
Featured Posts