-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow labelFromKey field for all applicable types #1880
Conversation
Allow `labelFromKey` field for the following types: * Gauge: Done. * Info: Done. * StateSet: N/A (redundant use case, see doc changes for more info). Signed-off-by: Pranshu Srivastava <[email protected]>
Inputkind: 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 (<-- this is a bug, I've added a TODO for this)
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 (<-- this is a bug, I've added a TODO for this)
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 |
labelFromKey
field for all typeslabelFromKey
field for all applicable types
labelFromKey
field for all applicable types
Ready for review. |
Wondering if it's possible to have an E2E test for CRD metrics. |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/lgtm /hold cancel Thanks for your contribution @rexagod ! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logicalhan, mrueg, rexagod The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Allow
labelFromKey
field for the following types:Fixes: #1871 and #1868.
How does this change affect the cardinality of KSM: Increases (we are adding labels from keys, which may increase cardinality).