Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add last_terminated_timestamp metric to state_container datastream
Signed-off-by: Tetiana Kravchenko <[email protected]>
  • Loading branch information
tetianakravchenko committed Jul 16, 2024
commit 37690b131a9e62c23d9dfc32ff4856aef43ef2a2
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/10213
- 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