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

CRS metrics are hardcoded to "gauge" type #1886

Closed
rexagod opened this issue Nov 8, 2022 · 1 comment · Fixed by #1930
Closed

CRS metrics are hardcoded to "gauge" type #1886

rexagod opened this issue Nov 8, 2022 · 1 comment · Fixed by #1930
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@rexagod
Copy link
Member

rexagod commented Nov 8, 2022

What happened: CRS metrics are hard-coded to "gauge" as the their TYPE.

What you expected to happen: CRS metrics should be able to dynamically deduce the TYPE correctly.

How to reproduce it (as minimally and precisely as possible): PTAL at the example below.

Anything else we need to know?: Surfaced here: #1880 (comment).


Input
kind: CustomResourceStateMetrics
spec:
  resources:
    - groupVersionKind:
        group: "apps"
        version: "v1"
        kind: "Deployment"
      labelsFromPath:
        name: [metadata, name]
      metrics:
        - name: "test_metrics"
          help: "metrics for debugging"
          each:
            type: Info
            info:
              path: [metadata, annotations]
              labelFromKey: test
Output
# HELP kube_crd_test_metrics metrics for debugging
# TYPE kube_crd_test_metrics gauge (<--)
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="deployment.kubernetes.io/revision",version="v1"} 1
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="test-a",version="v1"} 1
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="test-b",version="v1"} 2
# HELP kube_crd_test_metrics metrics for debugging
# TYPE kube_crd_test_metrics gauge (<--)
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="deployment.kubernetes.io/revision",version="v1"} 1
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="test-a",version="v1"} 1
kube_crd_test_metrics{group="apps",kind="Deployment",name="nginx-deployment",test="test-b",version="v1"} 2

Environment:

  • kube-state-metrics version: HEAD
@rexagod rexagod added the kind/bug Categorizes issue or PR as related to a bug. label Nov 8, 2022
@rexagod
Copy link
Member Author

rexagod commented Nov 8, 2022

/assign
cc @mrueg

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant