-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add metric to monitor common related objects #77
Add metric to monitor common related objects #77
Conversation
a7030a1
to
3caa5a1
Compare
I'm curious about the performance hit for this implementation and wondering whether there should be a flag to shut off this metric (or maybe all metrics...). |
2dd7bc9
to
4cbf4af
Compare
Sorry for the churn here. CI is passing and this PR is ready for review. |
I also wound up adding in a flag, |
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.
Only had a minor comment about a comment. Looks good.
82c2a18
to
98d1586
Compare
/hold |
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
This gauge records any related objects monitored by multiple policies. ref: stolostron/backlog#25357 Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
98d1586
to
9983e23
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, gparvin 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 |
I'm slightly worried about the performance impact of all our metrics, not just this one. So I'm glad this is configurable. From https://prometheus.io/docs/practices/naming/#labels :
Each of our metrics has a |
I agree--this definitely felt like a "square peg in a round hole" kind of thing since Prometheus isn't really designed for the goals of the metric. (We almost need a separate controller that can handle this sort of object duplication, but that might be a one-off at this point.) Hopefully this metric wouldn't occur frequently, but I definitely wanted to be able to turn it off if it became unruly. |
@JustinKuli @gparvin Are we prepared to unhold this PR, particularly given that it can be disabled? I think we might revisit this metric and ones like it in the future to see if we can generate them, potentially outside of Prometheus, in a manner more fitting to their intentions. |
I think it's acceptable. Maybe a future improvement would be to put the metrics we're worried about at a separate endpoint, so they could still be generated and scraped by some processes, but not the default prometheus configuration (which I assume gets everything at |
/unhold |
This adds a
common_related_objects
metric, which is a Gauge Vector sliced by the related object and the policy. Each policy and related object pair has a gauge set to the total number of instances of that related object. For example, if two policies point to a related object, there would be two gauges for each policy/related object pair, each set to2
. Gauges set to1
are ignored/cleaned up.ref: