-
Notifications
You must be signed in to change notification settings - Fork 154
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
Kanister Prometheus metrics skeleton framework #2163
Conversation
Thanks for submitting this pull request 🎉. The team will review it soon and get back to you. If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document. |
da871d3
to
6dd98fb
Compare
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 tried to look into the PR but don't have much valuable inputs. Someone else needs to review the PR.
513c0bb
to
a45e0b1
Compare
1. Create a consistent interface for all methods - instead of passing just labels []string, pass BoundedLabels 2. Based on Point 1, to represent unbounded label values, add sentinel markers a) For countervecs, panic if sentinel values are passed 3. In TestInitCounterVec, check if a default registerer has no registered counters initially. 4. Switch the assert checks in TestInitCounterVec
a45e0b1
to
fba4fb4
Compare
@mellon-collie Good job. If we needed to ship this today, I would approve it. But I'd like to discuss with you (via this ticket for future reference) my comments. |
a4743c1
to
0257445
Compare
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.
Looks good overall. Minor suggestions.
Thanks for the review. I've addressed all the review 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.
Looks great! Just a few nits 😃
a98b800
to
a02bae6
Compare
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.
Missing license on the test file. Looks great otherwise.
The CI failure might be due to a change @r4rajat introduced. The fix is in progress.
Thanks for pointing that out @pavannd1 . It looks like across the project we're a little bit inconsistent with adding licenses on test files - so of them do have it, while some don't. I've added it for |
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.
@mellon-collie You're right!
We need to educate both contributors and reviewers about it. We could find a linter to enforce it too.
@mellon-collie I'll be reverting this PR in the interest of unblocking the release. Let's re-merge post release. |
Sure, thanks @pavannd1 |
Change Overview
Basic framework for instrumenting Kanister with Prometheus metrics and exporting them. This framework is based on the design document mentioned in this PR: #2151
This PR creates a new "metrics" package that exports methods to initialize and register different Prometheus metrics: CounterVec, GaugeVec, HistogramVec, Counter, Gauge and Histogram. It also exposes a BoundedLabel struct type that allows consumers to specify the bounded number of labels and label values to prevent label cardinality bombs.
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan
a) TestGetLabelCombinations: This method tests the backtracking algorithm that generates the label combinations that are to be initialized for either a CounterVec, a GaugeVec or a HistogramVec.
b) TestInitCounterVec: This method tests if whether the initialized the Counters within a newly created CounterVec has been set to 0.