Skip to content

Introduce new job metric kube_job_status_suspend #2511

@ThusharaSampath

Description

@ThusharaSampath

What would you like to be added:

As of now kube job metrics have kube_job_status_failed, kube_job_status_succeeded, kube_job_status_active to track status of a job.
With https://kubernetes.io/docs/concepts/workloads/controllers/job/#suspending-a-job jobs can be suspended. So having a status metric to track suspended jobs would be valuable.

Following are status parts of a suspended job

status:
  conditions:
  - lastProbeTime: "2024-09-26T11:25:42Z"
    lastTransitionTime: "2024-09-26T11:25:42Z"
    message: Job suspended
    reason: JobSuspended
    status: "True"
    type: Suspended

Why is this needed:

As of now there is no way to monitor suspended jobs via kube-state-metrics (via prometheus)

Describe the solution you'd like

Implement new metric similar other jobs status metrics for suspended status

Additional context

https://kubernetes.io/blog/2021/04/12/introducing-suspended-jobs/

https://github.com/kubernetes/kube-state-metrics/blob/7995d5fd23bcff7ae24ab6849f7c393d262fb025/docs/metrics/workload/job-metrics.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions