From 8e87460ffa843301b62aef9a3d9f98e5a2b74c70 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 24 Oct 2024 22:19:15 +0100 Subject: [PATCH 1/3] feat(sentry-sdk): Enable HTTP2 transport This reverts commit e88eae1ae5b0060de68780aeab3423e600179dc7 and fixes the issue by adding `sentry-sdk[http2]` as a dependency. Retake of #79278. --- requirements-base.txt | 3 ++- requirements-frozen.txt | 17 ++++++----------- src/sentry/utils/sdk.py | 3 +++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/requirements-base.txt b/requirements-base.txt index 0b47c84e5b4fa0..7393aa0415860c 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -3,6 +3,7 @@ beautifulsoup4>=4.7.1 boto3>=1.34.128 botocore>=1.34.8 +brotli>=1.1.0 cachetools>=5 celery>=5 click>=8.1 @@ -70,7 +71,7 @@ sentry-ophio==1.0.0 sentry-protos>=0.1.26 sentry-redis-tools>=0.1.7 sentry-relay>=0.9.2 -sentry-sdk>=2.17.0 +sentry-sdk[http2]>=2.17.0 slack-sdk>=3.27.2 snuba-sdk>=3.0.43 simplejson>=3.17.6 diff --git a/requirements-frozen.txt b/requirements-frozen.txt index a268112a2b61c5..415f9d8f819d2b 100644 --- a/requirements-frozen.txt +++ b/requirements-frozen.txt @@ -1,11 +1,5 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# make freeze-requirements -# ---index-url https://pypi.devinfra.sentry.io/simple - +# This file was autogenerated by uv via the following command: +# uv pip compile --allow-unsafe --no-annotate --strip-extras requirements-base.txt requirements-getsentry.txt -o requirements-frozen.txt amqp==5.2.0 anyio==3.7.1 asgiref==3.8.1 @@ -60,9 +54,12 @@ grpc-stubs==1.53.0.5 grpcio==1.60.1 grpcio-status==1.60.1 h11==0.14.0 +h2==4.1.0 hiredis==2.3.2 +hpack==4.0.0 httpcore==1.0.2 httpx==0.25.2 +hyperframe==6.0.1 idna==3.7 inflection==0.5.1 iso3166==2.1.1 @@ -130,6 +127,7 @@ sentry-redis-tools==0.1.7 sentry-relay==0.9.2 sentry-sdk==2.17.0 sentry-usage-accountant==0.0.10 +setuptools==70.0.0 simplejson==3.17.6 six==1.16.0 slack-sdk==3.27.2 @@ -155,6 +153,3 @@ vine==5.1.0 wcwidth==0.2.10 xmlsec==1.3.13 zstandard==0.18.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==70.0.0 diff --git a/src/sentry/utils/sdk.py b/src/sentry/utils/sdk.py index 2d4be960d70c3f..1d0a6c05462aed 100644 --- a/src/sentry/utils/sdk.py +++ b/src/sentry/utils/sdk.py @@ -280,6 +280,9 @@ def _get_sdk_options() -> tuple[SdkConfig, Dsns]: sdk_options["release"] = ( f"backend@{sdk_options['release']}" if "release" in sdk_options else None ) + sdk_options.setdefault("_experiments", {}).update( + transport_http2=True, + ) # Modify SENTRY_SDK_CONFIG in your deployment scripts to specify your desired DSN dsns = Dsns( From fbe644476d995f653a460a4b3dc03f32dfa2ef62 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:10:28 +0000 Subject: [PATCH 2/3] :snowflake: re-freeze requirements --- requirements-dev-frozen.txt | 3 +++ requirements-frozen.txt | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/requirements-dev-frozen.txt b/requirements-dev-frozen.txt index d0dc5ef94ce369..915016c02e2e14 100644 --- a/requirements-dev-frozen.txt +++ b/requirements-dev-frozen.txt @@ -72,10 +72,13 @@ grpc-stubs==1.53.0.5 grpcio==1.60.1 grpcio-status==1.60.1 h11==0.13.0 +h2==4.1.0 hiredis==2.3.2 honcho==2.0.0 +hpack==4.0.0 httpcore==1.0.2 httpx==0.25.2 +hyperframe==6.0.1 identify==2.6.1 idna==3.7 inflection==0.5.1 diff --git a/requirements-frozen.txt b/requirements-frozen.txt index 415f9d8f819d2b..da774a9e2f5622 100644 --- a/requirements-frozen.txt +++ b/requirements-frozen.txt @@ -1,5 +1,11 @@ -# This file was autogenerated by uv via the following command: -# uv pip compile --allow-unsafe --no-annotate --strip-extras requirements-base.txt requirements-getsentry.txt -o requirements-frozen.txt +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# make freeze-requirements +# +--index-url https://pypi.devinfra.sentry.io/simple + amqp==5.2.0 anyio==3.7.1 asgiref==3.8.1 @@ -127,7 +133,6 @@ sentry-redis-tools==0.1.7 sentry-relay==0.9.2 sentry-sdk==2.17.0 sentry-usage-accountant==0.0.10 -setuptools==70.0.0 simplejson==3.17.6 six==1.16.0 slack-sdk==3.27.2 @@ -153,3 +158,6 @@ vine==5.1.0 wcwidth==0.2.10 xmlsec==1.3.13 zstandard==0.18.0 + +# The following packages are considered to be unsafe in a requirements file: +setuptools==70.0.0 From 240be67aeb5c071f3796d717c9169a958a6cdb34 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 25 Oct 2024 15:58:01 +0100 Subject: [PATCH 3/3] remove duplicate brotli def, alphasort --- requirements-base.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements-base.txt b/requirements-base.txt index 7393aa0415860c..7ebe614cc48059 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -86,7 +86,6 @@ typing-extensions>=4.9.0 ua-parser>=0.10.0 unidiff>=0.7.4 urllib3[brotli]>=2.2.2 -brotli>=1.1 pyuwsgi==2.0.27a1 zstandard>=0.18.0 sentry-usage-accountant==0.0.10