Skip to content

Commit

Permalink
[Metricbeat] Add state_statefulset replicas.ready
Browse files Browse the repository at this point in the history
Add a "replicas.ready" field to the state_statefulset metricset of the
Kubernetes module.

This is drawn from the "readyReplicas" value in the Kubernetes
StatefulSetStatus API response.
  • Loading branch information
ninaspitfire committed Jun 2, 2021
1 parent 55d33cd commit 5648c96
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add support for the MemoryPressure, DiskPressure, OutOfDisk and PIDPressure status conditions in state_node. {pull}23905[23905]
- Remove xpack enabled flag on ES, Logstash, Beats and Kibana {pull}24427[24427]
- Adjust host fields to adopt new names from 1.9.0 ECS. {pull}24312[24312]
- Add replicas.ready field to state_statefulset in Kubernetes module{pull}26088[26088]

*Packetbeat*

Expand Down
10 changes: 10 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37274,6 +37274,16 @@ type: long
The number of desired replicas per StatefulSet


type: long

--

*`kubernetes.statefulset.replicas.ready`*::
+
--
The number of ready replicas per StatefulSet


type: long

--
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"name": "mysql",
"replicas": {
"desired": 5,
"observed": 2
"observed": 2,
"ready": 2
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
type: long
description: >
The number of desired replicas per StatefulSet
- name: ready
type: long
description: >
The number of ready replicas per StatefulSet
- name: generation
type: group
description: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"name": "web",
"replicas": {
"desired": 2,
"observed": 2
"observed": 2,
"ready": 2
}
},
"Index": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,8 @@ kube_statefulset_status_observed_generation{namespace="custom",statefulset="mysq
kube_statefulset_status_replicas{namespace="default",statefulset="elasticsearch"} 1
kube_statefulset_status_replicas{namespace="default",statefulset="mysql"} 2
kube_statefulset_status_replicas{namespace="custom",statefulset="mysql"} 3
# HELP kube_statefulset_status_replicas_ready The number of ready replicas per StatefulSet.
# TYPE kube_statefulset_status_replicas_ready gauge
kube_statefulset_status_replicas_ready{namespace="default",statefulset="elasticsearch"} 1
kube_statefulset_status_replicas_ready{namespace="default",statefulset="mysql"} 2
kube_statefulset_status_replicas_ready{namespace="custom",statefulset="mysql"} 1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"name": "mysql",
"replicas": {
"desired": 5,
"observed": 2
"observed": 2,
"ready": 2
}
}
},
Expand Down Expand Up @@ -46,7 +47,8 @@
"name": "elasticsearch",
"replicas": {
"desired": 4,
"observed": 1
"observed": 1,
"ready": 1
}
}
},
Expand Down Expand Up @@ -76,7 +78,8 @@
"name": "mysql",
"replicas": {
"desired": 6,
"observed": 3
"observed": 3,
"ready": 1
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
"kube_statefulset_status_observed_generation": p.Metric("generation.observed"),
"kube_statefulset_replicas": p.Metric("replicas.desired"),
"kube_statefulset_status_replicas": p.Metric("replicas.observed"),
"kube_statefulset_status_replicas_ready": p.Metric("replicas.ready"),
},

Labels: map[string]p.LabelMap{
Expand Down

0 comments on commit 5648c96

Please sign in to comment.