Skip to content

Commit

Permalink
build(deps): Bump sentry-sdk to 2.13.0 (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana authored Sep 3, 2024
1 parent b08bc0c commit cb16549
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
8 changes: 3 additions & 5 deletions codecov/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,9 @@
],
environment=SENTRY_ENV,
traces_sample_rate=SENTRY_SAMPLE_RATE,
_experiments={
"profiles_sample_rate": float(
os.environ.get("SERVICES__SENTRY__PROFILE_SAMPLE_RATE", 0.01)
),
},
profiles_sample_rate=float(
os.environ.get("SERVICES__SENTRY__PROFILE_SAMPLE_RATE", 0.01)
),
)
if os.getenv("CLUSTER_ENV"):
sentry_sdk.set_tag("cluster", os.getenv("CLUSTER_ENV"))
Expand Down
8 changes: 4 additions & 4 deletions graphql_api/types/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ariadne import ObjectType
from django.conf import settings
from graphql import GraphQLResolveInfo
from sentry_sdk import configure_scope
from sentry_sdk import Scope

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

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


@query_bindable.field("me")
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pytz
redis
regex
requests
sentry-sdk>=1.40.0
sentry-sdk>=2.13.0
sentry-sdk[celery]
setproctitle
simplejson
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ rsa==4.7.2
# via google-auth
s3transfer==0.5.0
# via boto3
sentry-sdk[celery]==1.44.1
sentry-sdk[celery]==2.13.0
# via
# -r requirements.in
# shared
Expand Down
4 changes: 2 additions & 2 deletions utils/logging_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from logging import Filter

from pythonjsonlogger.jsonlogger import JsonFormatter
from sentry_sdk import Hub
from sentry_sdk import get_current_span


class BaseLogger(JsonFormatter):
Expand Down Expand Up @@ -44,7 +44,7 @@ def add_fields(self, log_record, record, message_dict):
else:
log_record["level"] = record.levelname

span = Hub.current.scope.span
span = get_current_span()
if span and span.trace_id:
log_record["sentry_trace_id"] = span.trace_id

Expand Down

0 comments on commit cb16549

Please sign in to comment.