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

[k8sclusterreceiver] add k8s.container.status_last_terminated_reason metric #31281

Conversation

povilasv
Copy link
Contributor

@povilasv povilasv commented Feb 15, 2024

Description:

Adding optional k8s.container.status_last_terminated_reason metric, which always has value of one if the container was terminated.

Would like to use this to track OOM kills / Evictions of pods.

Link to tracking Issue:
#31282

Testing:

  • unit tests
    Documentation:

@povilasv povilasv force-pushed the k8scluster/add-last-terminated-state branch from db808b8 to 56932bb Compare February 15, 2024 12:30
@povilasv povilasv marked this pull request as ready for review February 15, 2024 13:17
@povilasv povilasv requested a review from a team February 15, 2024 13:17
Comment on lines +215 to +216
reason:
description: "the container status terminated reason"
Copy link
Member

Choose a reason for hiding this comment

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

If this attribute is only ever going to be used for this specific status, the name should probably be more descriptive. If it may someday be used for more statuses, the description should be more generic.

@@ -274,6 +278,14 @@ metrics:
unit: ""
gauge:
value_type: int
k8s.container.status_last_terminated_reason:
enabled: false
description: Last terminated reason of container. The unit is always 1.
Copy link
Member

Choose a reason for hiding this comment

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

The unit is always 1.

I believe, from the other code being added, this should instead say the value will always be 1. Am I correct or do you mean something else here?

@povilasv povilasv closed this Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants