Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kubernetes] Add last_terminated_timestamp metric to state_container datastream #10503

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/kubernetes/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: 1.65.0
changes:
- description: Add last_terminated_timestamp metric to the kubernetes.state_container datastream
type: enhancement
link: https://github.com/elastic/integrations/pull/10503
- version: 1.64.0
changes:
- description: Move namespace filter to the group level configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
type: keyword
description: >
The last reason the container was in terminated state (Completed, ContainerCannotRun, Error or OOMKilled).
- name: last_terminated_timestamp
type: double
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small question: how this field is displayed if you change the type to date ?

Because I see other timestamp fields are marked as such

Copy link
Contributor Author

@tetianakravchenko tetianakravchenko Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gizas If changed to date:

{"log.level":"warn","@timestamp":"2024-07-16T09:17:20.612Z","message":"Cannot index event (status=400): dropping event! Look at the event log to view the event and cause." ...

some of fields indeed are of type date, but some - long or double, I've listed it here - elastic/beats#39200 (comment)

description: Last terminated time (epoch) of the container
- name: cpu
type: group
fields:
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes/docs/kube-state-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ An example event for `state_container` looks as following:
| kubernetes.container.memory.request.bytes | Container requested memory in bytes | long | byte | gauge |
| kubernetes.container.name | Kubernetes container name | keyword | | |
| kubernetes.container.status.last_terminated_reason | The last reason the container was in terminated state (Completed, ContainerCannotRun, Error or OOMKilled). | keyword | | |
| kubernetes.container.status.last_terminated_timestamp | Last terminated time (epoch) of the container | double | | |
| kubernetes.container.status.phase | Container phase (running, waiting, terminated) | keyword | | |
| kubernetes.container.status.ready | Container ready status | boolean | | |
| kubernetes.container.status.reason | The reason the container is currently in waiting (ContainerCreating, CrashLoopBackoff, ErrImagePull, ImagePullBackoff) or terminated (Completed, ContainerCannotRun, Error, OOMKilled) state. | keyword | | |
Expand Down
2 changes: 1 addition & 1 deletion packages/kubernetes/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.1.2
name: kubernetes
title: Kubernetes
version: 1.64.0
version: 1.65.0
description: Collect logs and metrics from Kubernetes clusters with Elastic Agent.
type: integration
categories:
Expand Down