-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pkg/collectors: Renable white-/blacklisting and HELP text #577
pkg/collectors: Renable white-/blacklisting and HELP text #577
Conversation
batchv1 "k8s.io/api/batch/v1" | ||
batchv1beta1 "k8s.io/api/batch/v1beta1" | ||
extensions "k8s.io/api/extensions/v1beta1" | ||
// apps "k8s.io/api/apps/v1beta1" |
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.
I have done the refactor only for service.go for now. Thereby one can ignore this change.
2b6d84c
to
d72fb54
Compare
This pull request is still in a work-in-progress state. So far the refactoring was only applied to the I would like to welcome feedback on the overall architecture proposed here. |
As this is WIP and still needs a substantial amount of work, could we move forward with #575, and rebase these changes on top of that? |
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 and nice job on the GenerateFunc approach.
I'm not sure I'm happy with the amount of concerns in this PR. Could we split this into multiple? The PRs that I'm seeing in this (each individually a big improvements, but unless separated hard to review):
While I'm very much in favor of just accepting |
Yes, I would love that. Also 👍 for HELP and TYPE. |
d72fb54
to
e2c117d
Compare
Good point @brancz. I have split up the work into the three suggested parts.
Performance wise this patch includes multiple changes in the hot path that need benchmarking:
Thereby I would suggest including them before the first release candidate. I don't think we need to go through the same thorough testing as @beorn7 and I did before as the general architecture (caching, ...) stays the same. What do you think @brancz? |
That’s fair, let’s do them and do another round of benchmarking. While we are at it, what do you think of splitting the micro benchmarks into metric rendering into buffer, rendering the metrics request and one that does the whole thing (this one is essentially what we have today)? Plus it would be a nice detail to have the benchmarks show the byte throughout in addition to the Op/s. This would make it easier to see differences when optimizing. |
e2c117d
to
fc40ef3
Compare
@brancz what are you referring to with "micro benchmarks"? As of today we only have a single benchmark test. |
That’s what I meant, I should have put the micro in quotes :) |
Generally I understand the scheme and I think it makes sense, but could we think a bit about how we could reduce the amount of boilerplate that brings with it? I imagine the pod collector being very hard to read once converted. It seems there is a common theme for: value metrics, label metrics, condition metrics and boolean metrics. If we can somehow abstract those further so they're essentially one liners, I think I'd be happy with the approach. I haven't looked too much into that, but it feels like that should be possible. |
@brancz would you mind taking another look? I have added all discussed changes (split benchmark, dry out collectors code, ...). If this looks good to you I will:
|
5aaa995
to
55de851
Compare
Reenable feature to filter the exposition of metric families by their name. This is now done at startup time, thereby not slowing down the critical path.
This pull request is now targeting |
e9b1250
to
024ea1c
Compare
Instead of having one big pull request refactoring all collectors, we will separate the changes into multiple pull requests. As we don't want to break master too much, those pull requests are going into Please speak up if you have alternative suggestions. |
15abaf2
to
151d337
Compare
Once we refector each of them to the new style, they will be re-introduced. Deleting: - configmap.go - configmap_test.go - cronjob.go - cronjob_test.go - daemonset.go - daemonset_test.go - deployment.go - deployment_test.go - endpoint.go - endpoint_test.go - hpa.go - hpa_test.go - job.go - job_test.go - limitrange.go - limitrange_test.go - namespace.go - namespace_test.go - node.go - node_test.go - persistentvolume.go - persistentvolume_test.go - persistentvolumeclaim.go - persistentvolumeclaim_test.go - poddisruptionbudget.go - poddisruptionbudget_test.go - replicaset.go - replicaset_test.go - replicationcontroller.go - replicationcontroller_test.go - resourcequota.go - resourcequota_test.go - secret.go - secret_test.go - statefulset.go - statefulset_test.go
151d337
to
c49a15d
Compare
@brancz tests are green. Any further comments? |
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.
Let’s address my comment in a follow up.
/lgtm
@@ -40,6 +40,7 @@ import ( | |||
kcollectors "k8s.io/kube-state-metrics/pkg/collectors" | |||
"k8s.io/kube-state-metrics/pkg/options" | |||
"k8s.io/kube-state-metrics/pkg/version" | |||
"k8s.io/kube-state-metrics/pkg/whiteblacklist" |
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.
Can we already call this allow/deny list as planned for 2.0 and just keep the flags called as they are called today?
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.
@brancz I would prefer to do this in one go to avoid confusion. Is that also ok?
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.
also fine by me
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brancz, mxinden 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 |
What this PR does / why we need it:
Reenable feature to filter the exposition of metric families by their
name. This is now done at startup time, thereby not slowing down the
critical path.
Expose metrics grouped by their metric family and prefix each metric
family with their HELP text. In the future this can easily be extended
to also expose the TYPE text.
(- This also paved the path for sorting the exposed metrics in a
zero-cost manner if this is wanted (//CC @beorn7).)
Relates to #557