-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
WFE: Track in-flight HTTP requests by endpoint using a gauge #7758
Conversation
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 think this would be better implemented in metrics/measured_http. That way we get automatic extraction of the endpoint, and the measurement code is more nicely separated from the WFE code. Also, we get the same benefit for other web servers in Boulder, i.e. the OCSP responder.
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.
(edit: never mind, see jsha's comment)
f464729
to
d39f4ba
Compare
Thanks! I wish I had noticed this existed earlier. |
}, "server", opts...) | ||
} | ||
|
||
func (h *MeasuredHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||
begin := h.clk.Now() | ||
rwws := &responseWriterWithStatus{w, 0} | ||
|
||
subHandler, pattern := h.Handler(r) | ||
if pattern != "/" { |
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 the exclusion for "/"
?
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.
We're mostly concerned about endpoints that dispatch RPCs, I knew we could safely discard "/". We could probably discard others as well.
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.
Fair enough. I think on balance, having fewer lines lines of code is slightly more appealing than economizing on the one timeseries, but I can really go either way on this one.
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.
Agreed. I think that excluding "/" makes sense if this were implemented in the WFE, where we could also exclude other endpoints we don't care about, like "/build". But here in this helper library that may be used by other webservers that do care about the root path, excluding it is likely to lead to confusion in the future.
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, with a slight preference for addressing Jacob's comment.
}, "server", opts...) | ||
} | ||
|
||
func (h *MeasuredHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||
begin := h.clk.Now() | ||
rwws := &responseWriterWithStatus{w, 0} | ||
|
||
subHandler, pattern := h.Handler(r) | ||
if pattern != "/" { |
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.
Agreed. I think that excluding "/" makes sense if this were implemented in the WFE, where we could also exclude other endpoints we don't care about, like "/build". But here in this helper library that may be used by other webservers that do care about the root path, excluding it is likely to lead to confusion in the future.
@aarongable I agree with this argument. I want to get this merged before our next tag, I'll write a follow-up that can be merged whenever. |
No description provided.