Skip to content

Conversation

onasser1
Copy link
Contributor

@onasser1 onasser1 commented Aug 27, 2025

What this PR does / why we need it: Init Containers do not have timestamps for LastTerminated and state_started Unlike Containers, so we provide them

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
increases
Which issue(s) this PR fixes: (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged)
Fixes #2627

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: onasser1
Once this PR has been reviewed and has the lgtm label, please assign dgrisonnet for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 27, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Instrumentation Aug 27, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 27, 2025
func createPodInitContainerStateStartedFamilyGenerator() generator.FamilyGenerator {
return *generator.NewFamilyGeneratorWithStability(
"kube_pod_init_container_state_started",
"Start time in unix timestamp for an_init_pod container.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Start time in unix timestamp for an_init_pod container.",
"Start time in unix timestamp for an init container inside the pod.",

"kube_pod_init_container_state_started",
"Start time in unix timestamp for an_init_pod container.",
metric.Gauge,
basemetrics.STABLE,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
basemetrics.STABLE,
basemetrics.ALPHA,

func createPodInitContainerStatusLastTerminatedTimestampFamilyGenerator() generator.FamilyGenerator {
return *generator.NewFamilyGeneratorWithStability(
"kube_pod_init_container_status_last_terminated_timestamp",
"Last terminated time for a pod init container in unix timestamp.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Last terminated time for a pod init container in unix timestamp.",
"Last terminated time for an init container inside a pod in unix timestamp.",

@onasser1 onasser1 requested a review from mrueg August 28, 2025 13:30
@CatherineF-dev
Copy link
Contributor

/triage accepted
/assign @mrueg

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

Add support for InitContainer create/termination timestamps in Pod Metrics
4 participants