This commit adds the kube_*_deletion_timestamp metric for several Kubernetes resources:
- Deployments
- DaemonSets
- StatefulSets
- Services
- PodDisruptionBudgets
The deletion timestamp metric reports the Unix timestamp when a resource
was marked for deletion. This helps with monitoring resource lifecycle
and cleanup processes.
All metrics follow the same pattern:
- Help text: 'Unix deletion timestamp'
- Type: gauge
- Value: Unix timestamp in seconds when DeletionTimestamp is set,
otherwise the metric is not emitted
Updated documentation and tests are included for all affected resources.
* Add ReadyReplicas field in Deployment status to deployment metrics family
* Depicts number of readyReplicas across all replicas sets owned by the deployment
Signed-off-by: Akshit Grover <akshit.grover2016@gmail.com>
- To allow other external Stores, remove the `FamilyByteSlicer` interface
and give access directly to `metric.Family`.
- Move functions present in `pkg/metric/generator.go` to a dedicated package
`generator` in `pkg/metric_generator/generator.go`.
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
Deployments, like Nodes, have status conditions observing the
current state. While the state of Available and Progressing conditions
can likely be inferred by other metrics, the state of ReplicaFailure can
not be inferred.
This changelist adds a new metric `kube_deployment_status_condition`
that observes all the conditions on a deployment for each condition
status. This is analogous to the status conditions observed by nodes and
horizontal pod autoscalers, and allows kube-state-metrics to observe
status conditions added by third-parties.
As an example, for a deployment that has stalled, the following new
metrics observed would allow an operator to detect the condition:
kube_deployment_status_condition{deployment="example", namespace="default", condition="ReplicaFailure", status="true"} 1
kube_deployment_status_condition{deployment="example", namespace="default", condition="ReplicaFailure", status="false"} 0
kube_deployment_status_condition{deployment="example", namespace="default", condition="ReplicaFailure", status="unknown"} 0
Bug: #886
Signed-off-by: Terin Stock <terin@cloudflare.com>
Since the removal of collector, this introduces both the concept of the
store and the resources instead of collectors that the user passes in.
The user facing logs and flags were not changed as that would be a
regression.