- Go to Settings > Cloud and virtualization > Kubernetes, open your cluster for editing, and turn on Enable monitoring and Monitor events.
Which Kubernetes events can be ingested?
Dynatrace provides a flexible way of ingesting Kubernetes events into your environment to enrich the existing monitoring data from OneAgents and ActiveGates with additional context information. Ingestion follows the Kubernetes-established format of field selectors, so events can be chosen based on event resource fields such as
Dynatrace version 1.214+
Davis analyzes all important Kubernetes events for nodes, namespaces, workloads, pods, and containers in the root cause analysis when applications, microservices or infrastructure problems occur. Enable Include all events relevant for Davis in your Dynatrace environment to make sure Dynatrace integrates the Kubernetes events for Davis analytics.
Set up event field selectors
You can set up multiple field selectors for every Kubernetes environment to get maximum flexibility and fine-grained control over the events you want to ingest from Kubernetes.
Note: You must specify at least one field selector. You can create a maximum of 20 event filter rules per Kubernetes cluster.
You can also define the event field selectors via Dynatrace API.
The field selector syntax is the same as the one used in Kubernetes.
An event field selector expression can have up to 10 selectors separated by commas. Events matching all comma-separated selectors will be ingested. The logical operator is
The expression shown in the above example will store all the events related to the namespace
hipster-shop that are of type
If you separate the expression into two independent field selectors, you'll get all events for namespace
hipster-shop and all events of type
Warning. The logical operator in this case is
|Events field selectors||Field selector expression|
|Get all Node events||
|Get all Warning events||
|Get all Pod events||
|Get all events of objects related to a specific namespace||
|Get all BackOff events for pods across all namespaces||
CLI equivalent command
Alternatively, you can select an event field from the CLI as shown in the example below.
kubectl get events --all-namespaces --field-selector involvedObject.namespace=hipster-shop,type=Warning