Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom-resource-metrics non label conform annotation names #2123

Open
ulikl opened this issue Jul 21, 2023 · 3 comments
Open

Custom-resource-metrics non label conform annotation names #2123

ulikl opened this issue Jul 21, 2023 · 3 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@ulikl
Copy link

ulikl commented Jul 21, 2023

What happened:

When using the generic include of annotations in config for custom-resource-state , via

labelsFromPath:
       "**": [metadata, annotations]

with Objects having annotation key which contain characters, which are not allowed in Prometheus Metrics labels.
e.g.

  metadata:
    annotations:
      field.cattle.io/creatorId: u-5cl2zk65bl
      ownerBindingsCreated: "true"

They are just exported as is.
i.e.

custom_... {field.cattle.io/creatorId="u-5cl2zk65b", ...} 1

This leads to an "expected equal, got "INVALID"" error, when Prometheus tries to parse these metrics.

What you expected to happen:

I would expect the annotation names to be adapted analog to the standard kube_node_labels metrics,
e.g.

custom_... {field_cattle_io_creatorId="u-5cl2zk65b", ...} 1

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • kube-state-metrics version: 2.8.2
  • Kubernetes version (use kubectl version): 1.25.10
  • Cloud provider or hardware configuration: rke2
  • Other info:
@ulikl ulikl added the kind/bug Categorizes issue or PR as related to a bug. label Jul 21, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 21, 2023
@dashpole
Copy link

/assign @rexagod
/triage accepted

@dgrisonnet thinks you might have a PR out to fix this?

@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 Jul 27, 2023
@kchopra456
Copy link

Checking if there was any movement on this?, we have had this issue for a while now.

@rexagod
Copy link
Member

rexagod commented Feb 25, 2024

I believe this should've been addressed in v2.9+. @ulikl @kchopra456 Could you specify the KSM version you were experiencing this on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants