-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extend metrics library #2606
Extend metrics library #2606
Conversation
I pushed some commits with small fixes. I will squash the commits after the review, just didn't want to force push now. |
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.
Thanks for providing doc.go
, it was very helpful in trying to understand the intent of this PR.
Overall, the ideas make sense to me but the implementation is not easy to follow.
// - cardinality can be constrained | ||
// - support for configurable labels | ||
// - metric is initialized at startup for known label values | ||
// - metric is automatically included in generated docs |
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.
Is it the case then that granular metrics are metrics with the above properties?
18c500c
to
8fd8005
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks Anna, LGTM.
If it's not too much hassle, please fold the last commit (metrics: Simplify Group interface) with the second commit (Extend metrics library).
Sure, I think I'll squash all commits following "Extend metrics library" into it. I separated some code reshuffling into the first commit, so that it's clearer what code is new and what is just moved. |
8fd8005
to
4d945f8
Compare
I added two commits with fixes, will squash them too. |
a33529c
to
0f522fc
Compare
This commit is a preparation for the further extension of pkg/metrics. There are no functional changes, only moving code around: - moved helpers for creating metrics from metricwithpod.go and granularmetric.go to per-type files: counter.go, gauge.go and histogram.go - renamed labels.go to filteredlabels.go Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This is a general rewrite of pkg/metrics library, but it a fully backwards compatible way. Goals and key components are described in doc.go. Fixes: #2376 Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
0f522fc
to
e0284e8
Compare
This is a general rewrite of
pkg/metrics
library, but it a fully backwardscompatible way. Goals and key components are described in
doc.go
, so I wouldsuggest starting the review there :)
Here is the Tetragon metrics framework proposal, covering the bigger picture including future plans. The "Goals" and "Proposal/Library" sections are copied into
doc.go
.For usage examples see #2604 (defining health metrics group, migrating some custom metrics & collectors to the new interface).
Fixes: #2376