-
Notifications
You must be signed in to change notification settings - Fork 13
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
middleware(prom): add customizable label for http metrics #747
Conversation
8f0415f
to
65aa050
Compare
middleware/prometheus.go
Outdated
label string | ||
labeler func(*http.Request) string |
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.
It would be better as a type.
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.
ok
65aa050
to
45dab3f
Compare
http_proxy.go
Outdated
@@ -94,6 +94,7 @@ type HTTPProxyConfig struct { | |||
ConnectTimeout time.Duration | |||
ReadLimit SizeSuffix | |||
WriteLimit SizeSuffix | |||
PromHTTPOpts []middleware.PrometheusOpt |
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'd add it to PromConfig tbh
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.
Adding it here makes no sense. It is very specific, while PromConfig is widely used across all components.
What is the status of this PR? |
Looks like it's good to go. Let's discuss it during our meeting. |
d4e27e2
to
cb37672
Compare
It can be used to partition the metrics by custom conditions. e.g. Label direct/tunnel mode in SC5. PrometheusOpt was chosen to ensure compatibility with existing prom instances.
cb37672
to
60845d8
Compare
It can be used to partition the metrics by custom conditions. e.g. Label direct/tunnel mode in SC5.
PrometheusOpt was chosen to ensure compatibility with existing prom instances.