-
Notifications
You must be signed in to change notification settings - Fork 528
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
Include metrics for configured limit overrides #1089
Conversation
e88e046
to
9cf9b2a
Compare
dd82ad8
to
f210535
Compare
I've added a metric for default limits as well. |
91b548a
to
5c1d86f
Compare
I've made an update to implement the Overrides module as a Collector. We could adjust to have the exporter be its own module /package like is done in the cortex code, but I think that might be a little more than we need for this. What do you think? |
58e0c72
to
5a33173
Compare
modules/overrides/overrides.go
Outdated
@@ -71,6 +87,14 @@ func NewOverrides(defaults Limits) (*Overrides, error) { | |||
var manager *runtimeconfig.Manager | |||
subservices := []services.Service(nil) | |||
|
|||
metricDefaultsLimits.WithLabelValues("max_local_traces_per_user").Set(float64(defaults.MaxLocalTracesPerUser)) |
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.
make max_local_traces_per_user
, etc. constants
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.
This is addressed in the last commit.
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'm still seeing individual static strings.
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.
Oh sorry, I thought you meant prometheus.MustNewConstMetric
to make them constants. You mean make the metric name string a constant to be referenced by both the defaults and the overrides, right?
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.
yup. I just meant to make a constant string that they both use. I have no idea what MustNewConstMetric
is but let's just follow whatever Cortex does here.
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.
Yep that's what they are doing. This promehteus.Collector
pattern is new to me, but the const bit is document here: https://prometheus.io/docs/instrumenting/writing_exporters/#collectors
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.
In Cortex the exporter is also a module, but as it is now we aren't doing that. If we want to do that, I think we just need to make a limits/exporter
package and glue it up, but not sure how far to go with modules. It would be our first "exporter" module, but it could be a pattern if we want to structure the exporters as modules. Seems to me that they belong with the module they support, rather than a module in themselves. What do you think?
5faecd7
to
822c19c
Compare
822c19c
to
ef029c2
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.
nice! i think we're there!
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]