We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What would you like to be added: I need a labelFromKey for Info, not just Gauge.
Why is this needed: If a CR (eg. Foo) is like this,
kind: Foo apiVersion: myteam.io/vl metadata: annotations: bar: baz qux: quxx labels: foo: bar name: foo spec: version: v1.2.3 order: - id: 1 value: true - id: 3 value: false replicas: 1 status: phase: Pending active: type-a: 1 # focus on this type-b: 3 # focus on this
we can get the metric label using the following YAML:
kind: CustomResourceStateMetrics spec: resources: - groupVersionKind: group: myteam.io kind: "Foo" version: "v1" metrics: - name: "active" help: "Foo active" each: type: Gauge gauge: path: [status, active] labelFromKey: type
The output metrics are like this:
kube_xxx_active{type=type-a} 1 kube_xxx_active{type=type-b} 3
However, if a CR (eg. Foo) is like this:
kind: Foo apiVersion: myteam.io/vl metadata: annotations: bar: baz qux: quxx labels: foo: bar name: foo spec: version: v1.2.3 order: - id: 1 value: true - id: 3 value: false replicas: 1 status: phase: Pending active: type-a: running # focus on this type-b: failed # focus on this
Because the value of "type-a" is not a number, we need to use Info, not Gauge. How can I get a metric with the label "type=type-a"?
Describe the solution you'd like
The expected YAML is like this:
kind: CustomResourceStateMetrics spec: resources: - groupVersionKind: group: myteam.io kind: "Foo" version: "v1" metrics: - name: "active" help: "Foo active" each: type: Info info: path: [status, active] labelFromKey: type labelsFromPath: state: [???] # I don't know how to write it
The expected output metrics are like this:
kube_xxx_active{type=type-a, state=running} 1 kube_xxx_active{type=type-b, state=failed} 1
thanks~
Additional context
#1871 (comment)
The text was updated successfully, but these errors were encountered:
/assign
Sorry, something went wrong.
Allow labelFromKey field for all types
labelFromKey
70f2e4b
Allow `labelFromKey` field for all types: * Gauge: Done. * Info, StateSets: Pending. Fixes: kubernetes#1871 and kubernetes#1868.
rexagod
Successfully merging a pull request may close this issue.
What would you like to be added:
I need a labelFromKey for Info, not just Gauge.
Why is this needed:
If a CR (eg. Foo) is like this,
we can get the metric label using the following YAML:
The output metrics are like this:
However, if a CR (eg. Foo) is like this:
Because the value of "type-a" is not a number, we need to use Info, not Gauge. How can I get a metric with the label "type=type-a"?
Describe the solution you'd like
The expected YAML is like this:
The expected output metrics are like this:
thanks~
Additional context
#1871 (comment)
The text was updated successfully, but these errors were encountered: