-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(http): add config option to disable metrics endpoint in influxd #20963
Conversation
2689c32
to
aae02dd
Compare
what happens if someone does |
The |
@@ -68,34 +83,23 @@ func WithPprofEnabled(enabled bool) HandlerOptFn { | |||
} | |||
} | |||
|
|||
func WithHealthHandler(h http.Handler) HandlerOptFn { |
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.
Why are we dropping the health
and ready
handler code? They're just not called?
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.
Yes, unused.
aae02dd
to
561052a
Compare
http/handler_test.go
Outdated
w: httptest.NewRecorder(), | ||
}, | ||
{ | ||
name: "should record metrics when http handling", |
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.
nitpick: test name should be different?
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.
Ack, good catch
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
Closes #20755
NOTE: We wire up the
influxd
process with aprom.Registry
even when/metrics
is disabled, because the metrics are also used by our telemetry reporter. A follow-up improvement could avoid all the prometheus code paths when both metrics and reporting are disabled.