Skip to content

[Bug]: New workload types are not lowercase #1077

@rouke-broersma

Description

@rouke-broersma

What happened?

In #1052 support was added for 'custom' workload types, which is great because we now don't need our own custom relabels. However the new custom workload types use the original casing of the owner_kind whereas all other workload types are lowercase. We also built our own recording rules with lowercase as per the upstream method, this is now causing us duplicate records (one PascalCase and one lowercase) which break the kubernetes-mixin dashboards that use workload type.

Please provide any helpful snippets.

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule  
spec:
  groups:
    - name: k8s.rules.custom
      rules:
      - record: namespace_workload_pod:kube_pod_owner:relabel
        expr: max by (cluster, namespace, workload, pod) (label_replace(kube_pod_owner{job="kube-state-metrics", owner_kind="StrimziPodSet"},"workload", "$1", "owner_name", "(.*)"))
        labels:
            workload_type: strimzipodset

What parts of the codebase are affected?

Rules, Dashboards

I agree to the following terms:

  • I agree to follow this project's Code of Conduct.
  • I have filled out all the required information above to the best of my ability.
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have confirmed this bug exists in the default branch of the repository, as of the latest commit at the time of submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions