|
9 | 9 | from sentry_sdk.integrations import _check_minimum_version, 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,
|
@@ -192,7 +192,7 @@ async def _context_enter(request):
|
192 | 192 | op=OP.HTTP_SERVER,
|
193 | 193 | # Unless the request results in a 404 error, the name and source will get overwritten in _set_transaction
|
194 | 194 | name=request.path,
|
195 |
| - source=TRANSACTION_SOURCE_URL, |
| 195 | + source=TransactionSource.URL, |
196 | 196 | origin=SanicIntegration.origin,
|
197 | 197 | )
|
198 | 198 | request.ctx._sentry_transaction = sentry_sdk.start_transaction(
|
@@ -229,7 +229,7 @@ async def _set_transaction(request, route, **_):
|
229 | 229 | with capture_internal_exceptions():
|
230 | 230 | scope = sentry_sdk.get_current_scope()
|
231 | 231 | route_name = route.name.replace(request.app.name, "").strip(".")
|
232 |
| - scope.set_transaction_name(route_name, source=TRANSACTION_SOURCE_COMPONENT) |
| 232 | + scope.set_transaction_name(route_name, source=TransactionSource.COMPONENT) |
233 | 233 |
|
234 | 234 |
|
235 | 235 | def _sentry_error_handler_lookup(self, exception, *args, **kwargs):
|
@@ -304,11 +304,11 @@ def _legacy_router_get(self, *args):
|
304 | 304 | sanic_route = sanic_route[len(sanic_app_name) + 1 :]
|
305 | 305 |
|
306 | 306 | scope.set_transaction_name(
|
307 |
| - sanic_route, source=TRANSACTION_SOURCE_COMPONENT |
| 307 | + sanic_route, source=TransactionSource.COMPONENT |
308 | 308 | )
|
309 | 309 | else:
|
310 | 310 | scope.set_transaction_name(
|
311 |
| - rv[0].__name__, source=TRANSACTION_SOURCE_COMPONENT |
| 311 | + rv[0].__name__, source=TransactionSource.COMPONENT |
312 | 312 | )
|
313 | 313 |
|
314 | 314 | return rv
|
|
0 commit comments