Skip to content

Commit eb42d82

Browse files
MichaelKatsoulisgizas
authored andcommitted
Add status.last_terminated_exitcode field in state_container metricset (#47968)
* Add status.last_terminated_exitcode field in state_container metricset * Update metricbeat/module/kubernetes/state_container/_meta/fields.yml Co-authored-by: Andrew Gizas <[email protected]> * Add changelog and update documentation example * Update changelog/fragments/1765359658-k8s_status_last_terminated_exitcode.yaml Co-authored-by: Andrew Gizas <[email protected]> --------- Co-authored-by: Andrew Gizas <[email protected]> (cherry picked from commit 71fb391)
1 parent 6ea75fa commit eb42d82

File tree

118 files changed

+3582
-4028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3582
-4028
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: enhancement
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Add `last_terminated_exitcode` to `kubernetes.container.status`
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: metricbeat
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

docs/reference/metricbeat/exported-fields-kubernetes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,12 @@ kubernetes container metrics
15411541
type: double
15421542

15431543

1544+
**`kubernetes.container.status.last_terminated_exitcode`**
1545+
: The exit code for the last container in terminated state.
1546+
1547+
type: integer
1548+
1549+
15441550
**`kubernetes.container.cpu.limit.cores`**
15451551
: Container CPU cores limit
15461552

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_container.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Here is an example document generated by this metricset:
2121
{
2222
"@timestamp": "2019-03-01T08:05:34.853Z",
2323
"container": {
24-
"id": "054b424625a7c22c210e3fe0aae55069d4f3e18ce8bc802a9a96ce87bb7a2483",
24+
"id": "fed1a0f0adeb312c82caea61cf5b46f0a6d81bd4ae891dad54f88d99a822fb3d",
2525
"image": {
26-
"name": "docker.io/library/busybox:latest"
26+
"name": "docker.io/kindest/kindnetd:v20241212-9f82dd49"
2727
},
2828
"runtime": "containerd"
2929
},
@@ -34,21 +34,39 @@ Here is an example document generated by this metricset:
3434
},
3535
"kubernetes": {
3636
"container": {
37-
"id": "054b424625a7c22c210e3fe0aae55069d4f3e18ce8bc802a9a96ce87bb7a2483",
38-
"name": "hello",
37+
"cpu": {
38+
"limit": {
39+
"cores": 0.1
40+
},
41+
"request": {
42+
"cores": 0.1
43+
}
44+
},
45+
"id": "fed1a0f0adeb312c82caea61cf5b46f0a6d81bd4ae891dad54f88d99a822fb3d",
46+
"memory": {
47+
"limit": {
48+
"bytes": 52428800
49+
},
50+
"request": {
51+
"bytes": 52428800
52+
}
53+
},
54+
"name": "kindnet-cni",
3955
"status": {
40-
"phase": "terminated",
41-
"ready": false,
42-
"reason": "Completed",
43-
"restarts": 0
56+
"last_terminated_exitcode": 255,
57+
"last_terminated_reason": "Unknown",
58+
"last_terminated_timestamp": 1744109218,
59+
"phase": "running",
60+
"ready": true,
61+
"restarts": 1
4462
}
4563
},
46-
"namespace": "default",
64+
"namespace": "kube-system",
4765
"node": {
4866
"name": "kind-control-plane"
4967
},
5068
"pod": {
51-
"name": "hello-28564555-zdfjz"
69+
"name": "kindnet-gzkxz"
5270
}
5371
},
5472
"metricset": {

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_cronjob.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ Here is an example document generated by this metricset:
3939
"count": 0
4040
},
4141
"created": {
42-
"sec": 1713862291
42+
"sec": 1744115807
4343
},
4444
"is_suspended": false,
4545
"last_schedule": {
46-
"sec": 1713873360
46+
"sec": 1744115820
4747
},
4848
"name": "hello",
4949
"next_schedule": {
50-
"sec": 1713873420
50+
"sec": 1744115880
5151
}
5252
},
5353
"namespace": "default"

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_daemonset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Here is an example document generated by this metricset:
2727
},
2828
"kubernetes": {
2929
"daemonset": {
30-
"name": "kube-proxy",
30+
"name": "kindnet",
3131
"replicas": {
3232
"available": 1,
3333
"desired": 1,

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Here is an example document generated by this metricset:
2727
},
2828
"kubernetes": {
2929
"deployment": {
30-
"name": "kube-state-metrics",
30+
"name": "local-path-provisioner",
3131
"paused": false,
3232
"replicas": {
3333
"available": 1,
@@ -40,7 +40,7 @@ Here is an example document generated by this metricset:
4040
"progressing": "true"
4141
}
4242
},
43-
"namespace": "kube-system"
43+
"namespace": "local-path-storage"
4444
},
4545
"metricset": {
4646
"name": "state_deployment",

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_horizontalpodautoscaler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ Here is an example document generated by this metricset:
3030
"name": "cpu",
3131
"replicas": {
3232
"current": 1,
33-
"desired": 1,
34-
"max": 5,
33+
"desired": 0,
34+
"max": 2,
3535
"min": 1
3636
},
3737
"status": {
38-
"condition": "scalinglimited"
38+
"condition": "scalingactive"
3939
}
4040
},
4141
"namespace": "default"

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_job.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Here is an example document generated by this metricset:
3030
"completions": {
3131
"desired": 1
3232
},
33-
"name": "hello-28564554",
33+
"name": "hello-29068597",
3434
"owner": {
3535
"is_controller": "true",
3636
"kind": "CronJob",
@@ -48,8 +48,8 @@ Here is an example document generated by this metricset:
4848
"complete": "true"
4949
},
5050
"time": {
51-
"completed": "2024-04-23T11:54:02.000Z",
52-
"created": "2024-04-23T11:54:00.000Z"
51+
"completed": "2025-04-08T12:37:03.000Z",
52+
"created": "2025-04-08T12:37:00.000Z"
5353
}
5454
},
5555
"namespace": "default"

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_node.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ Here is an example document generated by this metricset:
2929
"node": {
3030
"cpu": {
3131
"allocatable": {
32-
"cores": 16
32+
"cores": 32
3333
},
3434
"capacity": {
35-
"cores": 16
35+
"cores": 32
3636
}
3737
},
3838
"kubelet": {
39-
"version": "v1.29.1"
39+
"version": "v1.32.0"
4040
},
4141
"memory": {
4242
"allocatable": {
43-
"bytes": 16769380352
43+
"bytes": 67285303296
4444
},
4545
"capacity": {
46-
"bytes": 16769380352
46+
"bytes": 67285303296
4747
}
4848
},
4949
"name": "kind-control-plane",

docs/reference/metricbeat/metricbeat-metricset-kubernetes-state_persistentvolumeclaim.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ Here is an example document generated by this metricset:
2929
"namespace": "default",
3030
"persistentvolumeclaim": {
3131
"access_mode": "ReadWriteOnce",
32-
"created": "2024-04-23T08:51:31.000Z",
33-
"name": "task-pv-claim",
32+
"created": "2025-04-08T12:36:47.000Z",
33+
"name": "mnt-basic-sts-0",
3434
"phase": "Bound",
3535
"request_storage": {
36-
"bytes": 1024
36+
"bytes": 1048576
3737
},
38-
"storage_class": "generic",
39-
"volume_name": "task-pv-volume"
38+
"storage_class": "standard",
39+
"volume_name": "pvc-bdf9afc1-c19e-44db-b169-fdcb423338d2"
4040
}
4141
},
4242
"metricset": {

0 commit comments

Comments
 (0)