Skip to content

Commit cb16549

Browse files
authored
build(deps): Bump sentry-sdk to 2.13.0 (#623)
1 parent b08bc0c commit cb16549

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

codecov/settings_base.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,9 @@
395395
],
396396
environment=SENTRY_ENV,
397397
traces_sample_rate=SENTRY_SAMPLE_RATE,
398-
_experiments={
399-
"profiles_sample_rate": float(
400-
os.environ.get("SERVICES__SENTRY__PROFILE_SAMPLE_RATE", 0.01)
401-
),
402-
},
398+
profiles_sample_rate=float(
399+
os.environ.get("SERVICES__SENTRY__PROFILE_SAMPLE_RATE", 0.01)
400+
),
403401
)
404402
if os.getenv("CLUSTER_ENV"):
405403
sentry_sdk.set_tag("cluster", os.getenv("CLUSTER_ENV"))

graphql_api/types/query/query.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ariadne import ObjectType
44
from django.conf import settings
55
from graphql import GraphQLResolveInfo
6-
from sentry_sdk import configure_scope
6+
from sentry_sdk import Scope
77

88
from codecov.commands.exceptions import UnauthorizedGuestAccess
99
from codecov.db import sync_to_async
@@ -26,9 +26,9 @@ def configure_sentry_scope(query_name: str):
2626
# we're configuring this here since it's the main entrypoint into GraphQL resolvers
2727

2828
# https://docs.sentry.io/platforms/python/enriching-events/transaction-name/
29-
with configure_scope() as scope:
30-
if scope.transaction:
31-
scope.transaction.name = f"GraphQL [{query_name}]"
29+
scope = Scope.get_current_scope()
30+
if scope.transaction:
31+
scope.transaction.name = f"GraphQL [{query_name}]"
3232

3333

3434
@query_bindable.field("me")

requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pytz
4545
redis
4646
regex
4747
requests
48-
sentry-sdk>=1.40.0
48+
sentry-sdk>=2.13.0
4949
sentry-sdk[celery]
5050
setproctitle
5151
simplejson

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ rsa==4.7.2
411411
# via google-auth
412412
s3transfer==0.5.0
413413
# via boto3
414-
sentry-sdk[celery]==1.44.1
414+
sentry-sdk[celery]==2.13.0
415415
# via
416416
# -r requirements.in
417417
# shared

utils/logging_configuration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from logging import Filter
33

44
from pythonjsonlogger.jsonlogger import JsonFormatter
5-
from sentry_sdk import Hub
5+
from sentry_sdk import get_current_span
66

77

88
class BaseLogger(JsonFormatter):
@@ -44,7 +44,7 @@ def add_fields(self, log_record, record, message_dict):
4444
else:
4545
log_record["level"] = record.levelname
4646

47-
span = Hub.current.scope.span
47+
span = get_current_span()
4848
if span and span.trace_id:
4949
log_record["sentry_trace_id"] = span.trace_id
5050

0 commit comments

Comments
 (0)