diff --git a/docs/node-metrics.md b/docs/node-metrics.md
index cc817caaa6..2ff3f1eab5 100644
--- a/docs/node-metrics.md
+++ b/docs/node-metrics.md
@@ -12,3 +12,4 @@
| kube_node_status_allocatable | Gauge | The allocatable for different resources of a node that are available for scheduling | `cpu`=<core>
`ephemeral_storage`=<byte>
`pods`=<integer>
`attachable_volumes_*`=<byte>
`hugepages_*`=<byte>
`memory`=<byte> |`node`=<node-address>
`resource`=<resource-name>
`unit`=<resource-unit>| STABLE |
| kube_node_status_condition | Gauge | The condition of a cluster node | |`node`=<node-address>
`condition`=<node-condition>
`status`=<true\|false\|unknown> | STABLE |
| kube_node_created | Gauge | Unix creation timestamp | seconds |`node`=<node-address>| STABLE |
+| kube_node_deletion_timestamp | Gauge | Unix creation timestamp | seconds |`node`=<node-address>| STABLE |
diff --git a/internal/store/node.go b/internal/store/node.go
index 09ec39140c..51827c8765 100644
--- a/internal/store/node.go
+++ b/internal/store/node.go
@@ -44,9 +44,10 @@ var (
func nodeMetricFamilies(allowAnnotationsList, allowLabelsList []string) []generator.FamilyGenerator {
return []generator.FamilyGenerator{
+ createNodeAnnotationsGenerator(allowAnnotationsList),
createNodeCreatedFamilyGenerator(),
+ createNodeDeletionTimestampFamilyGenerator(),
createNodeInfoFamilyGenerator(),
- createNodeAnnotationsGenerator(allowAnnotationsList),
createNodeLabelsGenerator(allowLabelsList),
createNodeRoleFamilyGenerator(),
createNodeSpecTaintFamilyGenerator(),
@@ -57,6 +58,29 @@ func nodeMetricFamilies(allowAnnotationsList, allowLabelsList []string) []genera
}
}
+func createNodeDeletionTimestampFamilyGenerator() generator.FamilyGenerator {
+ return *generator.NewFamilyGeneratorWithStability(
+ "kube_node_deletion_timestamp",
+ "Unix deletion timestamp",
+ metric.Gauge,
+ basemetrics.ALPHA,
+ "",
+ wrapNodeFunc(func(n *v1.Node) *metric.Family {
+ var ms []*metric.Metric
+
+ if n.DeletionTimestamp != nil && !n.DeletionTimestamp.IsZero() {
+ ms = append(ms, &metric.Metric{
+ Value: float64(n.DeletionTimestamp.Unix()),
+ })
+ }
+
+ return &metric.Family{
+ Metrics: ms,
+ }
+ }),
+ )
+}
+
func createNodeCreatedFamilyGenerator() generator.FamilyGenerator {
return *generator.NewFamilyGeneratorWithStability(
"kube_node_created",