Skip to content
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

outbound: Log and remove l5d-proxy-error from responses #2694

Merged
merged 1 commit into from Feb 5, 2024

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Feb 2, 2024

When an outbound client reads a response from a remote peer that includes the l5d-proxy-error header, it doesn't communicate this error state in logs, and it (incorrectly, according to the comments) leaves the l5d-proxy-error header on the response.

Furthermore, we currently always emit a DEBUG log message "Remote proxy error", even when no error header is present.

This change updates the error handler to:

  1. Emit 'Remote proxy error' messages at INFO level when the header is validly set;
  2. Strip these headers when they are logged (i.e. to eliminate ambiguity and potential for double-logging).

Tests are updated to exercise the header removal logic.

When an outbound client reads a response from a remote peer that
includes the l5d-proxy-error header, it doesn't communicate this error
state in logs, and it (incorrectly, according to the comments) leaves
the l5d-proxy-error header on the response.

Furthermore, we currently _always_ emit a DEBUG log message "Remote proxy
error", even when no error header is present.

This change updates the error handler to:

1. Emit 'Remote proxy error' messages at INFO level when the header is
   validly set;
2. Strip these headers when they are logged (i.e. to eliminate ambiguity
   and potential for double-logging).

Tests are updated to exercise the header removal logic.
@olix0r olix0r requested a review from a team as a code owner February 2, 2024 16:45
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Merging #2694 (fe211c5) into main (fc9ae35) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2694      +/-   ##
==========================================
- Coverage   67.66%   67.64%   -0.02%     
==========================================
  Files         332      332              
  Lines       15152    15149       -3     
==========================================
- Hits        10252    10247       -5     
- Misses       4900     4902       +2     
Files Coverage Δ
...pp/outbound/src/http/handle_proxy_error_headers.rs 87.17% <66.66%> (-0.92%) ⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc9ae35...fe211c5. Read the comment docs.

@olix0r olix0r merged commit 28b2d83 into main Feb 5, 2024
17 checks passed
@olix0r olix0r deleted the ver/remote-proxy-error-logs branch February 5, 2024 22:17
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Feb 16, 2024
---

* build(deps): bump rcgen from 0.11.3 to 0.12.0 (linkerd/linkerd2-proxy#2677)
* build(deps): bump jobserver from 0.1.26 to 0.1.27 (linkerd/linkerd2-proxy#2679)
* build(deps): bump bumpalo from 3.12.0 to 3.14.0 (linkerd/linkerd2-proxy#2678)
* outbound: Log and remove l5d-proxy-error from responses (linkerd/linkerd2-proxy#2694)
* http: Parameterize NewServeHttp (linkerd/linkerd2-proxy#2696)
* gateway: Avoid double http prefixing in metric names (linkerd/linkerd2-proxy#2701)

Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Feb 19, 2024
---

* build(deps): bump rcgen from 0.11.3 to 0.12.0 (linkerd/linkerd2-proxy#2677)
* build(deps): bump jobserver from 0.1.26 to 0.1.27 (linkerd/linkerd2-proxy#2679)
* build(deps): bump bumpalo from 3.12.0 to 3.14.0 (linkerd/linkerd2-proxy#2678)
* outbound: Log and remove l5d-proxy-error from responses (linkerd/linkerd2-proxy#2694)
* http: Parameterize NewServeHttp (linkerd/linkerd2-proxy#2696)
* gateway: Avoid double http prefixing in metric names (linkerd/linkerd2-proxy#2701)

Signed-off-by: Oliver Gould <ver@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant