Skip to content
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

feat: Add httpcore based HTTP2Transport #3588

Merged
merged 30 commits into from
Oct 4, 2024

Conversation

BYK
Copy link
Member

@BYK BYK commented Sep 30, 2024

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).

Copy link

codecov bot commented Sep 30, 2024

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

tests/test_utils.py Show resolved Hide resolved
@BYK BYK marked this pull request as ready for review October 1, 2024 13:13
Copy link
Contributor

@sentrivana sentrivana left a comment

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.

sentry_sdk/transport.py Show resolved Hide resolved
sentry_sdk/transport.py Show resolved Hide resolved
sentry_sdk/transport.py Outdated Show resolved Hide resolved
@sentrivana
Copy link
Contributor

Merging this as soon as CI allows. :)

@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Oct 4, 2024
@sentrivana sentrivana merged commit 2bfce50 into getsentry:master Oct 4, 2024
139 of 141 checks passed
@BYK BYK deleted the byk/feat/http2 branch October 4, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants