|
9 | 9 | from sentry_sdk.integrations import Integration, DidNotEnable
|
10 | 10 | from sentry_sdk.integrations._wsgi_common import RequestExtractor, _filter_headers
|
11 | 11 | from sentry_sdk.integrations.logging import ignore_logger
|
12 |
| -from sentry_sdk.tracing import TRANSACTION_SOURCE_COMPONENT, TRANSACTION_SOURCE_URL |
| 12 | +from sentry_sdk.tracing import TransactionSource |
13 | 13 | from sentry_sdk.utils import (
|
14 | 14 | capture_internal_exceptions,
|
15 | 15 | ensure_integration_enabled,
|
@@ -198,7 +198,7 @@ async def _context_enter(request):
|
198 | 198 | op=OP.HTTP_SERVER,
|
199 | 199 | # Unless the request results in a 404 error, the name and source will get overwritten in _set_transaction
|
200 | 200 | name=request.path,
|
201 |
| - source=TRANSACTION_SOURCE_URL, |
| 201 | + source=TransactionSource.URL, |
202 | 202 | origin=SanicIntegration.origin,
|
203 | 203 | )
|
204 | 204 | request.ctx._sentry_transaction = sentry_sdk.start_transaction(
|
@@ -235,7 +235,7 @@ async def _set_transaction(request, route, **_):
|
235 | 235 | with capture_internal_exceptions():
|
236 | 236 | scope = sentry_sdk.get_current_scope()
|
237 | 237 | route_name = route.name.replace(request.app.name, "").strip(".")
|
238 |
| - scope.set_transaction_name(route_name, source=TRANSACTION_SOURCE_COMPONENT) |
| 238 | + scope.set_transaction_name(route_name, source=TransactionSource.COMPONENT) |
239 | 239 |
|
240 | 240 |
|
241 | 241 | def _sentry_error_handler_lookup(self, exception, *args, **kwargs):
|
@@ -310,11 +310,11 @@ def _legacy_router_get(self, *args):
|
310 | 310 | sanic_route = sanic_route[len(sanic_app_name) + 1 :]
|
311 | 311 |
|
312 | 312 | scope.set_transaction_name(
|
313 |
| - sanic_route, source=TRANSACTION_SOURCE_COMPONENT |
| 313 | + sanic_route, source=TransactionSource.COMPONENT |
314 | 314 | )
|
315 | 315 | else:
|
316 | 316 | scope.set_transaction_name(
|
317 |
| - rv[0].__name__, source=TRANSACTION_SOURCE_COMPONENT |
| 317 | + rv[0].__name__, source=TransactionSource.COMPONENT |
318 | 318 | )
|
319 | 319 |
|
320 | 320 | return rv
|
|
0 commit comments