reverseproxy: Add per-upstream metrics#7574
reverseproxy: Add per-upstream metrics#7574simonhammes wants to merge 3 commits intocaddyserver:masterfrom
Conversation
| // Guard for test cases that bypass Provision() | ||
| if reverseProxyMetrics.upstreamRequests == nil { | ||
| return | ||
| } |
There was a problem hiding this comment.
Not sure whether this is the best approach?
TestDialErrorBodyRetry fails with a SEGV if I remove this check.
|
Have you run the result? Can you share the resulting metrics output? |
Yes: I just noticed that I should probably add the |
Done: fba858e |
| const ns, sub = "caddy", "reverse_proxy" | ||
|
|
||
| upstreamsLabels := []string{"upstream"} | ||
| upstreamRequestLabels := []string{"upstream", "code", "method"} |
There was a problem hiding this comment.
Next question: Do we also want a server label? 🤷
There was a problem hiding this comment.
And host if per_host is enabled?
Good point, this could indeed cause issues in environments with frequently changing IP addresses (e.g. K8S). This is the result of using Maybe the "new" metrics (or just the |
|
That comment was from an AI agent that spammed hundreds of repos. We blocked and reported. But make of it as you will. |
Thanks for letting me know, that's what I assumed. I still think there's some truth to the (albeit AI-generated) comment |
This PR implements per-upstream metrics for
reverse_proxy.Fixes #4140
Assistance Disclosure
The code was generated by OpenCode (GLM-5). I manually verified the correctness.