Skip to content

Commit 90358dd

Browse files
committed
Improvements to enum
1 parent 28cef3d commit 90358dd

File tree

27 files changed

+62
-59
lines changed

27 files changed

+62
-59
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ By: @mgaligniana (#1773)
23482348
await ctx['session'].aclose()
23492349

23502350
async def main():
2351-
with sentry_sdk.start_transaction(name="testing_arq_tasks", source=TransactionSource.COMPONENT.value):
2351+
with sentry_sdk.start_transaction(name="testing_arq_tasks", source=TransactionSource.COMPONENT):
23522352
redis = await create_pool(RedisSettings())
23532353
for url in ('https://facebook.com', 'https://microsoft.com', 'https://github.com', "asdf"
23542354
):
@@ -2434,7 +2434,7 @@ By: @mgaligniana (#1773)
24342434
traces_sample_rate=1.0,
24352435
)
24362436

2437-
with sentry_sdk.start_transaction(name="testing_huey_tasks", source=TransactionSource.COMPONENT.value):
2437+
with sentry_sdk.start_transaction(name="testing_huey_tasks", source=TransactionSource.COMPONENT):
24382438
r = add_numbers(1, 2)
24392439

24402440
if __name__ == "__main__":

sentry_sdk/integrations/aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async def sentry_app_handle(self, request, *args, **kwargs):
129129
# If this transaction name makes it to the UI, AIOHTTP's
130130
# URL resolver did not find a route or died trying.
131131
name="generic AIOHTTP request",
132-
source=TransactionSource.ROUTE.value,
132+
source=TransactionSource.ROUTE,
133133
origin=AioHttpIntegration.origin,
134134
)
135135
with sentry_sdk.start_transaction(

sentry_sdk/integrations/arq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def _sentry_run_job(self, job_id, score):
102102
name="unknown arq task",
103103
status="ok",
104104
op=OP.QUEUE_TASK_ARQ,
105-
source=TransactionSource.TASK.value,
105+
source=TransactionSource.TASK,
106106
origin=ArqIntegration.origin,
107107
)
108108

sentry_sdk/integrations/asgi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ def event_processor(self, event, hint, asgi_scope):
270270
already_set = event["transaction"] != _DEFAULT_TRANSACTION_NAME and event[
271271
"transaction_info"
272272
].get("source") in [
273-
TransactionSource.COMPONENT.value,
274-
TransactionSource.ROUTE.value,
275-
TransactionSource.CUSTOM.value,
273+
TransactionSource.COMPONENT,
274+
TransactionSource.ROUTE,
275+
TransactionSource.CUSTOM,
276276
]
277277
if not already_set:
278278
name, source = self._get_transaction_name_and_source(
@@ -310,7 +310,7 @@ def _get_transaction_name_and_source(self, transaction_style, asgi_scope):
310310
name = transaction_from_function(endpoint) or ""
311311
else:
312312
name = _get_url(asgi_scope, "http" if ty == "http" else "ws", host=None)
313-
source = TransactionSource.URL.value
313+
source = TransactionSource.URL
314314

315315
elif transaction_style == "url":
316316
# FastAPI includes the route object in the scope to let Sentry extract the
@@ -322,11 +322,11 @@ def _get_transaction_name_and_source(self, transaction_style, asgi_scope):
322322
name = path
323323
else:
324324
name = _get_url(asgi_scope, "http" if ty == "http" else "ws", host=None)
325-
source = TransactionSource.URL.value
325+
source = TransactionSource.URL
326326

327327
if name is None:
328328
name = _DEFAULT_TRANSACTION_NAME
329-
source = TransactionSource.ROUTE.value
329+
source = TransactionSource.ROUTE
330330
return name, source
331331

332332
return name, source

sentry_sdk/integrations/aws_lambda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs):
153153
headers,
154154
op=OP.FUNCTION_AWS,
155155
name=aws_context.function_name,
156-
source=TransactionSource.COMPONENT.value,
156+
source=TransactionSource.COMPONENT,
157157
origin=AwsLambdaIntegration.origin,
158158
)
159159
with sentry_sdk.start_transaction(

sentry_sdk/integrations/celery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _inner(*args, **kwargs):
319319
headers,
320320
op=OP.QUEUE_TASK_CELERY,
321321
name="unknown celery task",
322-
source=TransactionSource.TASK.value,
322+
source=TransactionSource.TASK,
323323
origin=CeleryIntegration.origin,
324324
)
325325
transaction.name = task.name

sentry_sdk/integrations/chalice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def wrapped_view_function(**function_args):
6767
configured_time = app.lambda_context.get_remaining_time_in_millis()
6868
scope.set_transaction_name(
6969
app.lambda_context.function_name,
70-
source=TransactionSource.COMPONENT.value,
70+
source=TransactionSource.COMPONENT,
7171
)
7272

7373
scope.add_event_processor(

sentry_sdk/integrations/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def _set_transaction_name_and_source(scope, transaction_style, request):
398398

399399
if transaction_name is None:
400400
transaction_name = request.path_info
401-
source = TransactionSource.URL.value
401+
source = TransactionSource.URL
402402
else:
403403
source = SOURCE_FOR_STYLE[transaction_style]
404404

sentry_sdk/integrations/fastapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _set_transaction_name_and_source(scope, transaction_style, request):
6161

6262
if not name:
6363
name = _DEFAULT_TRANSACTION_NAME
64-
source = TransactionSource.ROUTE.value
64+
source = TransactionSource.ROUTE
6565
else:
6666
source = SOURCE_FOR_STYLE[transaction_style]
6767

sentry_sdk/integrations/gcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def sentry_func(functionhandler, gcp_event, *args, **kwargs):
8888
headers,
8989
op=OP.FUNCTION_GCP,
9090
name=environ.get("FUNCTION_NAME", ""),
91-
source=TransactionSource.COMPONENT.value,
91+
source=TransactionSource.COMPONENT,
9292
origin=GcpIntegration.origin,
9393
)
9494
sampling_context = {

0 commit comments

Comments
 (0)