Skip to content

add k8s.container.status.state and k8s.container.status.reason metrics#1784

Merged
lmolkova merged 7 commits intoopen-telemetry:mainfrom
povilasv:container-status
May 29, 2025
Merged

add k8s.container.status.state and k8s.container.status.reason metrics#1784
lmolkova merged 7 commits intoopen-telemetry:mainfrom
povilasv:container-status

Conversation

@povilasv
Copy link
Contributor

@povilasv povilasv commented Jan 22, 2025

Fixes #1672

Changes

Adds k8s.container.status.state metric, it would allow us to alert and monitor containers in not ready state.

I'm still not sure if this should be multiple different metrics or a single one 🤔

The current problems, with single metric:

  • Running state doesn't have a reason, so we would set reason to empty.
  • Waiting state and Terminated state have different sets of reasons:

Waiting state - "ContainerCreating", "CrashLoopBackOff", "CreateContainerConfigError", "ErrImagePull", "ImagePullBackOff"

Terminated state - "OOMKilled", "Completed", "Error", "ContainerCannotRun"

Alternative approach would be to do what KSM does:

  • k8s.container.status.state metric without reason attribute.
  • k8s.container.status.waiting_reason metric for waiting reason enum.
  • k8s.container.status.terminated_reason metric for terminated reason enum.

This is not intended to merge, I would appreciate any feedback to see what we want to do here.

Merge requirement checklist

@povilasv povilasv force-pushed the container-status branch 4 times, most recently from 8de6ad2 to 726203e Compare January 22, 2025 07:47
@povilasv povilasv marked this pull request as ready for review January 22, 2025 07:48
@povilasv povilasv requested review from a team as code owners January 22, 2025 07:48
@ChrsMark ChrsMark requested a review from a team February 3, 2025 09:04
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 19, 2025
@github-actions
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Feb 27, 2025
@zwindler
Copy link

zwindler commented Mar 6, 2025

This PR was auto closed but I feel that this change would be useful (at least, for me, and there are 2 issues open for this)

Can this be re-opened? Is there anything I can do to help?

@ChrsMark ChrsMark reopened this Mar 6, 2025
@povilasv
Copy link
Contributor Author

povilasv commented Mar 6, 2025

Sorry got side tracked by other tasks, will try take a look at the feedback next week and see if we can push this forward :)

@zwindler
Copy link

zwindler commented Mar 6, 2025

I totally understand :)

Thank you

@lmolkova lmolkova removed the Stale label Mar 6, 2025
@povilasv povilasv force-pushed the container-status branch 3 times, most recently from 134c08f to 2d7e2dd Compare March 18, 2025 13:48
@povilasv povilasv requested review from ChrsMark, jinja2 and trask March 18, 2025 14:11
@povilasv povilasv force-pushed the container-status branch from 5d51a46 to 98d6186 Compare May 15, 2025 13:42
@lmolkova lmolkova moved this to Needs More Approval in Semantic Conventions Triage May 16, 2025
@github-actions github-actions bot added the enhancement New feature or request label May 19, 2025
@povilasv povilasv requested a review from lmolkova May 19, 2025 08:38
@lmolkova lmolkova enabled auto-merge May 23, 2025 14:47
@lmolkova lmolkova disabled auto-merge May 23, 2025 14:49
povilasv and others added 6 commits May 28, 2025 06:21
Co-authored-by: Christos Markou <chrismarkou92@gmail.com>
Co-authored-by: Jina Jain <jjain@splunk.com>
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
@povilasv povilasv force-pushed the container-status branch from bd59bd0 to bf2f0f7 Compare May 28, 2025 03:21
@povilasv povilasv requested a review from a team as a code owner May 28, 2025 03:40
@lmolkova lmolkova added this pull request to the merge queue May 29, 2025
Merged via the queue into open-telemetry:main with commit fb7b420 May 29, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in K8s SemConv SIG May 29, 2025
@povilasv povilasv deleted the container-status branch May 30, 2025 06:24
jherbage pushed a commit to jherbage/semantic-conventions that referenced this pull request Jul 1, 2025
open-telemetry#1784)

Co-authored-by: Christos Markou <chrismarkou92@gmail.com>
Co-authored-by: Jina Jain <jjain@splunk.com>
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:k8s enhancement New feature or request

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

Add k8s.container.status.waiting metric to semantic conventions

10 participants