Kubernetes.statefulset.generation.* what are these fields meaning?

Hi,

the two exported fields:
kubernetes.statefulset.generation.desired
kubernetes.statefulset.generation.observed

What do they mean in detail?
I understand the replicas.desired and observed, but what is generation?

Thanks, Andreas

Some kubernetes objects (mainly those that affect underlying pods) have a generation field that increments as the spec changes. At the status of that object you can find the observedGeneration field.

It looks like metricbeat rename generation to generation.desired. The generation field is used internally at kubernetes so that it knows when some action is required at that object.