-
Notifications
You must be signed in to change notification settings - Fork 439
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
fix and cleanup the Content-Length
handling in transport
#2954
Conversation
Content-Length
handling in transport
BenchmarksBenchmark execution time: 2024-10-30 12:38:57 Comparing candidate commit be5f2ea in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 1 unstable metrics. |
/merge |
@darccio thanks for the review, please feel free to merge this (I don't have the rights) |
@paulcacheux Sure, give me a moment. |
What does this PR do?
This PR cleans up the
Content-Length
header in the request made to the agent. In the case of civisibility the request is made with a*bytes.Buffer
and as indicated in the documentation the content length is computed automatically here (cf doc).In the case of the default/regular trace transport, the
Content-Length
was set manually through the header. My investigation from the agent side is that we receive a fair amount of traces from dd-trace-go withoutContent-Length
, so this PR moves the content length back to the actual request field, as suggested in the documentation.Here is a playground example showing how setting the header manually is not working as expected https://go.dev/play/p/AGdBGGZ7IgY
Motivation
Reviewer's Checklist
Unsure? Have a question? Request a review!