Skip to content

feat: Add httpcore based HTTP2Transport#3588

Merged
sentrivana merged 30 commits into
getsentry:masterfrom
BYK:byk/feat/http2
Oct 4, 2024
Merged

feat: Add httpcore based HTTP2Transport#3588
sentrivana merged 30 commits into
getsentry:masterfrom
BYK:byk/feat/http2

Conversation

@BYK

@BYK BYK commented Sep 30, 2024

Copy link
Copy Markdown
Member

All our ingest endpoints support HTTP/2 and some even HTTP/3 which are significantly more efficient compared to HTTP/1.1 with multiplexing and, header compression, connection reuse and 0-RTT TLS.

This patch adds an experimental HTTP2Transport with the help of httpcore library. It makes minimal changes to the original HTTPTransport that said with httpcore we should be able to implement asyncio support easily and remove the worker logic (see #2824).

This should also open the door for future HTTP/3 support (see encode/httpx#275).

@codecov

codecov Bot commented Sep 30, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.95575% with 17 lines in your changes missing coverage. Please review.

Project coverage is 84.33%. Comparing base (55d757a) to head (b292dc5).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/transport.py 84.82% 11 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3588      +/-   ##
==========================================
- Coverage   84.35%   84.33%   -0.03%     
==========================================
  Files         133      133              
  Lines       13929    13994      +65     
  Branches     2937     2951      +14     
==========================================
+ Hits        11750    11802      +52     
- Misses       1442     1450       +8     
- Partials      737      742       +5     
Files with missing lines Coverage Δ
sentry_sdk/client.py 83.49% <100.00%> (ø)
sentry_sdk/consts.py 99.50% <ø> (ø)
sentry_sdk/transport.py 85.19% <84.82%> (-0.13%) ⬇️

... and 1 file with indirect coverage changes

Comment thread tests/test_utils.py
@BYK
BYK marked this pull request as ready for review October 1, 2024 13:13

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥔 Thanks for this. Looks good, left some small comments, please take a look.

Comment thread sentry_sdk/transport.py
Comment thread sentry_sdk/transport.py
Comment thread sentry_sdk/transport.py Outdated
@sentrivana

Copy link
Copy Markdown
Contributor

Merging this as soon as CI allows. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants