-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix Zipkin receiver keep-alive flag not being applied to HTTP server #7389
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
base: main
Are you sure you want to change the base?
Fix Zipkin receiver keep-alive flag not being applied to HTTP server #7389
Conversation
Signed-off-by: Parship Chowdhury <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7389 +/- ##
==========================================
- Coverage 96.44% 96.44% -0.01%
==========================================
Files 375 375
Lines 22871 22922 +51
==========================================
+ Hits 22058 22106 +48
- Misses 615 617 +2
- Partials 198 199 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Parship Chowdhury <[email protected]>
Signed-off-by: Parship Chowdhury <[email protected]>
Signed-off-by: Parship Chowdhury <[email protected]>
@yurishkuro could you please take a look and let me know if the approach seems correct? |
return errors.New("receiver is nil") | ||
} | ||
|
||
receiverValue := reflect.ValueOf(w.Traces) |
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.
it seems like you're trying to unwrap the zipkin receiver internals and set a flag. Why not just create a PR in OTEL contrib to expose the keepalive (assuming it's not exposed now)?
Which problem is this PR solving?
Description of the changes
Issue is the
--collector.zipkin.keep-alive
flag was not being applied to the HTTP server created by the OpenTelemetry Zipkin receiver. While the flag existed in the collector configuration (options.Zipkin.KeepAlive
), it was never used to control the actual HTTP server's keep alive behavior.Root Cause:
confighttp.ServerConfig.ToServer()
, but theKeepAlive
setting from Jaeger's configuration was stored separately and never applied to the server.My solution:
zipkinReceiverWrapper
that wraps the OpenTelemetry Zipkin receiver--collector.zipkin.keep-alive=false
, the wrapper callsSetKeepAlivesEnabled(false)
on the HTTP server--collector.zipkin.keep-alive=true
(default) then no action takes place and keep alive remains enabledImplementation:
server
field in the OpenTelemetry zipkin receiver*http.Server
http.Server.SetKeepAlivesEnabled()
How was this change tested?
TestZipkinReceiverKeepAlive
that verifies the wrapper correctly applies keep-alive settings--collector.zipkin.keep-alive=false
and--collector.zipkin.keep-alive=true
keep-alive=false
: HTTP responses includeconnection: close
keep-alive=true
: HTTP connections are kept alive (noconnection: close
header)curl -v
to see the HTTP connection behaviorChecklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test