Commit Graph

23 Commits

Author SHA1 Message Date
Igor Ignatev 53ec1de81a
feat: add deletion timestamp metrics for multiple resources
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.
2025-08-18 08:57:17 +03:00
Rishab87 012b46d220 adding empty string in reasons 2025-08-14 18:32:48 +05:30
Rishab87 547afad282 adding reasons from deployment_utils.go 2025-08-13 22:35:44 +05:30
Rishab87 b5820387c0 adding empty reason in allowedList 2025-08-11 20:50:42 +05:30
Rishab87 bc1e7f8965 fixing empty reasons and adding tests 2025-08-11 20:16:08 +05:30
Rishab87 b30335fa54 changing empty reasons to unkown 2025-08-08 21:46:48 +05:30
Rishab87 0a50cabaf9 added reason label 2025-08-05 16:35:42 +05:30
opeco17 6de105ebbe feat: disable labels and annotations metrics when metric-annotations-allowlist and metric-labels-allowlist are not provided 2023-08-14 14:38:23 +00:00
Catherine Fang 5995c1e2cf Add all stable metrics 2022-10-14 08:25:39 -04:00
Sylvain Rabot 96d08df5d0
Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
Akshit Grover f8be5e1e2e Fix deployment ready replicas metric name
Signed-off-by: Akshit Grover <akshit.grover2016@gmail.com>
2021-07-22 20:27:00 +05:30
Akshit Grover 1c538a26f3 Add ReadyReplicas metric to deployment metric family
* 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>
2021-07-19 22:55:22 +05:30
Sylvain Rabot 65bc62af5c
Add kube_*_annotations metrics
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-04-29 16:04:16 +02:00
Lili Cosic 0b76e7d4f4 internal/store: Rework label allow list for label metrics 2020-11-20 15:31:35 +01:00
Quentin Bisson 7250bc2b5c
Update go module path to k8s.io/kube-state-metrics/v2
Signed-off-by: Quentin Bisson <quentin@giantswarm.io>
2020-09-21 10:58:08 +02:00
Greg Lyons 89856b8945 Fix maxUnavailable to round down instead up 2020-02-24 09:52:28 -08:00
cedric lamoriniere 72ad3cb412 Remove FamilyByteSlicer interface
- 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>
2019-12-13 10:50:19 +01:00
Terin Stock 8c7cf669e0 deployment status conditions
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>
2019-09-18 19:05:12 -07:00
Tariq Ibrahim 1b42e7c450
lint: enforce goimports local prefixes 2019-08-20 10:33:05 -07:00
Tariq Ibrahim 9799ac0e61
Merge release-1.7 into upstream/master 2019-08-05 10:46:00 -07:00
Lili Cosic 684293930a internal/store/*: Enable metric headers in tests 2019-07-26 13:31:20 +02:00
Andrey Sidorov 5ae00bb93f add kube_*_annotations metrics for all objects 2019-06-25 22:29:27 +03:00
Lili Cosic 68aea02d26 Makefile,internal/collector: Rename collector -> store
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.
2019-06-11 16:18:53 +02:00