metricbeat/module/kubernetes/util/enrichers.md
The metadata enrichment process involves associating contextual information, such as Kubernetes metadata (e.g., labels, annotations, resource names), with metrics and events collected by Elastic Agent and Beats in Kubernetes environments. This process enhances the understanding and analysis of collected data by providing additional context.
Metricsets:
Enrichers:
Watchers:
Metadata Generators:
Initialization:
Watcher Creation:
Metadata Generation:
Enrichment Generation Process:
Association with Events:
Initialization Sequence:
Configuration Updates:
In the following diagram, an example of different metricsets leveraging the same watchers is depicted. Metricsets have their own enrichers but share watchers. The watchers monitor the Kubernetes API for specific resource updates. metadata diag
The following table demonstrates which watchers are needed for each metricset by default. Note that no watcher monitoring the same resource kind will be created twice.
| Metricset | Namespace watcher | Node watcher | Resource watcher | Notes |
|---|---|---|---|---|
| API Server | ✕ | ✕ | ✕ | |
| Container | ✓ | ✓ | ✓ | |
| Controller manager | ✕ | ✕ | ✓ | |
| Event | ✓ | ✕ | ✓ | |
| Node | ✕ | ✓ | ✓ | Resource watcher should be the same as node watcher. |
| Pod | ✓ | ✓ | ✓ | |
| Proxy | ✕ | ✕ | ✕ | |
| Scheduler | ✕ | ✕ | ✕ | |
| State container | ✓ | ✓ | ✓ | |
| State cronjob | ✓ | ✕ | ✓ | |
| State daemonset | ✓ | ✕ | ✓ | |
| State deployment | ✓ | ✕ | ✓ | |
| State job | ✓ | ✕ | ✓ | |
| State namespace | ✓ | ✕ | ✓ | Resource watcher should be the same as namespace watcher. |
| State node | ✕ | ✓ | ✓ | Resource watcher should be the same as node watcher. |
| State PV | ✕ | ✕ | ✓ | |
| State PVC | ✓ | ✕ | ✓ | |
| State pod | ✓ | ✓ | ✓ | |
| State replicaset | ✓ | ✕ | ✓ | |
| State resource quota | ✓ | ✕ | ✓ | |
| State service | ✓ | ✕ | ✓ | |
| State statefulset | ✓ | ✕ | ✓ | |
| State storage class | ✕ | ✕ | ✓ | |
| System | ✕ | ✕ | ✕ | |
| Volume | ✕ | ✕ | ✕ |