Repository navigation
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-10-23 22:18 UTC Move out of draft to request review. Status above doesn't look right?
|
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with HTTP server span generation for malformed requests
Trace Akka HTTP parser-generated error responses
Oct 23, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The supplied review evidence supports rejection detection, state cleanup, and focused regression coverage, with no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Addresses #5139 by extending Akka HTTP server instrumentation to trace parser-generated error responses that bypass application handlers, without duplicating spans for requests already delivered.
Changes:
- Detect pre-handler parsing failures and trace their response status through the shared HTTP instrumenter.
- Restore temporary rejection state on exceptional exits and reuse response customization.
- Add regression coverage for malformed requests, application-generated 400s, and entity-stream failures.
| File | Description |
|---|---|
AkkaHttpServerRouteTest.scala |
Adds application-generated 400 coverage. |
AkkaHttpServerInstrumentationTest.scala |
Verifies malformed requests produce a 400 and one server span. |
AbstractHttpServerInstrumentationTest.scala |
Clarifies the comment explaining unavailable request methods. |
MessageStartErrorInstrumentation.java |
Marks parser-generated request-start errors. |
HttpServerControllerInstrumentation.java |
Intercepts rejection responses and restores temporary state. |
AkkaHttpServerInstrumentationModule.java |
Registers the new instrumentation classes. |
AkkaHttpResponseMutator.java |
Extracts shared response customization. |
AkkaHttpParsingErrorSingletons.java |
Tracks parsing errors and manages response-span creation. |
AkkaHttpParsingErrorAttributesGetter.java |
Extracts response attributes without inventing request details. |
AkkaFlowWrapper.java |
Reuses the shared response customizer. |
AkkaHttpServerJavaRouteTest.java |
Covers malformed targets and entity failures through raw sockets. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Akka HTTP rejects malformed requests such as
GET /%% HTTP/1.1before invoking the application handler, bypassing server-span creation. This change traces the generated response without duplicating spans for requests already delivered to the handler.Fixes #5139.