Skip to content

Consider enum instead of boolean for owner_is_controller field #2793

@nmn3m

Description

@nmn3m

What would you like to be added:

Add owner_is_controller field back to owner metrics (or reconsider its implementation as an enum instead of boolean).

Why is this needed:

Currently, multiple owner metrics use owner_is_controller as a boolean label:

  • kube_pod_owner
  • kube_job_owner
  • kube_replicaset_owner
  • kube_replicationcontroller_owner
  • kube_secret_owner

During review of kube_deployment_owner metric, a question was raised: should this field use an enum instead of boolean to better represent different owner relationship types (e.g., "controller", "application", "custom resource")?

Describe the solution you'd like:

Option 1: Keep boolean implementation

  • Use owner_is_controller="true|false" (current implementation for existing metrics)
  • Simple and directly maps to Kubernetes OwnerReference.Controller field
  • Add this field back to kube_deployment_owner

Option 2: Change to enum

  • Use owner_type="controller|application|reference" (or similar)
  • More extensible for future owner relationship types
  • Requires migration for all existing owner metrics

Additional context:

The kube_deployment_owner metric (#2782) currently has this field removed pending this decision. Once resolved, all owner metrics should be updated consistently for a uniform API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions