sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Impossible to configure keep-alive in Sentry-Java

Open mjet-plane opened this issue 8 months ago • 1 comments

Problem Statement

In Sentry-Java, it doesn’t seem possible to configure HTTP keep-alive. When the SDK sends data to the collector, it explicitly sets the Connection: close header (source).

Because of this forced behavior, the SDK establishes a new connection for every request, which could introduce unnecessary overhead under high load.

Is there a specific reason why keep alive is disabled? The code that disables it seems to be written at least four years ago.

Other Sentry SDKs — like the one for Python — provide options to enable keep-alive (docs).

Solution Brainstorm

  • Introduce keep alive option to Sentry-java.

mjet-plane avatar Apr 23 '25 04:04 mjet-plane

@mjet-plane Thanks for letting us know, we'll look into this. The implementation has been like this for a while now, but your concern sounds valid.

markushi avatar Apr 23 '25 07:04 markushi