Count proxy.process.http.incoming_requests at transaction start #12823
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The proxy.process.http.incoming_requests metric was only incremented in HttpTransact::HandleRequest(), which is called late in the request processing pipeline. Requests that received error or redirect responses before reaching HandleRequest were never counted, causing significant underreporting during high-error-rate scenarios.
This fix moves the increment to HttpSM::attach_client_session(), which is called at the start of every transaction. This ensures all requests are counted, including those that fail header parsing, receive remap redirects, or hit early error conditions. This aligns with the documented behavior that incoming_requests should include errors and redirects (see doc/appendices/command-line/traffic_top.en.rst):