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

Fixes New metric for deployment revision #746 #747

Closed
wants to merge 4 commits into from

Conversation

bvoss
Copy link

@bvoss bvoss commented May 9, 2019

Add metric for deployment revision based on the annotation 'deployment.kubernetes.io/revision'

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 9, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 9, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bvoss
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: mxinden

If they are not already assigned, you can assign the PR to them by writing /assign @mxinden in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 9, 2019
internal/collector/deployment.go Outdated Show resolved Hide resolved
internal/collector/deployment_test.go Outdated Show resolved Hide resolved
internal/collector/deployment.go Outdated Show resolved Hide resolved
@tariq1890
Copy link
Contributor

I am not sure how I feel about exposing metrics from annotations. Thoughts @brancz @mxinden ?

@mxinden
Copy link
Contributor

mxinden commented May 10, 2019

Instead of exposing specific annotations, I would advocate towards exposing all annotations like we do with Kubernetes labels.

This has been raised in #574 before. The cardinality increase introduced through this metric could have a high impact on big clusters, thus I think making the metric optional and disabled by default is the way forward.

@tariq1890 @bvoss @brancz what do you think?

@bvoss
Copy link
Author

bvoss commented May 10, 2019

@mxinden @tariq1890 @brancz
Actual we have the problem with a large cluster, so all annotations isn't an option for us.

I understood, that the annotation and its value is essential for kubectl rollout --revision and so more likely part of the API and stable.
Honestly I don't know why it's not a property like in StatefulSetStatus.

So I thought it would be ok - in this special case - to expose this annotation value.

Nevertheless the general annotation approach is also fine for me, if it's possible to configure a white-list for annotations to be contained in the metric.

@@ -14,3 +14,4 @@
| kube_deployment_metadata_generation | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_labels | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_created | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_revision | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have some docs that show that this annotation is indeed considered stable? I'm only asking because I wonder why this is not a real field.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2019
@k8s-ci-robot
Copy link
Contributor

@bvoss: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tariq1890
Copy link
Contributor

I think this can be closed since the kube annotations PR was merged.

@tariq1890 tariq1890 closed this Jun 26, 2019
@tariq1890
Copy link
Contributor

Thanks for the feature request and taking a stab at this @bvoss :).

@brancz
Copy link
Member

brancz commented Jun 26, 2019

I think there was a distinction here. The value of the annotation was actually parsed and exposed as the metric's value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants