Skip to content

middleware(prom): add customizable label for http metrics#747

Merged
mmatczuk merged 2 commits intomainfrom
hg/metrics_http_req_label
Jun 11, 2024
Merged

middleware(prom): add customizable label for http metrics#747
mmatczuk merged 2 commits intomainfrom
hg/metrics_http_req_label

Conversation

@Choraden
Copy link
Contributor

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.

@Choraden Choraden force-pushed the hg/metrics_http_req_label branch from 8f0415f to 65aa050 Compare March 18, 2024 15:00
Comment on lines +58 to +59
label string
labeler func(*http.Request) string
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Choraden Choraden force-pushed the hg/metrics_http_req_label branch from 65aa050 to 45dab3f Compare March 19, 2024 09:50
http_proxy.go Outdated
ConnectTimeout time.Duration
ReadLimit SizeSuffix
WriteLimit SizeSuffix
PromHTTPOpts []middleware.PrometheusOpt
Copy link
Contributor

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

Copy link
Contributor Author

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.

@mmatczuk
Copy link
Contributor

What is the status of this PR?

@Choraden
Copy link
Contributor Author

Looks like it's good to go. Let's discuss it during our meeting.

@mmatczuk mmatczuk self-requested a review June 11, 2024 09:33
@mmatczuk mmatczuk force-pushed the hg/metrics_http_req_label branch from d4e27e2 to cb37672 Compare June 11, 2024 09:39
Choraden added 2 commits June 11, 2024 11:49
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.
@Choraden Choraden force-pushed the hg/metrics_http_req_label branch from cb37672 to 60845d8 Compare June 11, 2024 09:51
@mmatczuk mmatczuk merged commit 8efb92f into main Jun 11, 2024
@mmatczuk mmatczuk deleted the hg/metrics_http_req_label branch June 11, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants