You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-11-03 17:13:17 +03:00
Fixed Sentry transaction continuation
This commit is contained in:
committed by
Leonid Fedorov
parent
9821f14d0f
commit
3ca5a2e6bb
@@ -82,8 +82,10 @@ class SentryBackend(TracerBackend):
|
|||||||
@swallow_exceptions
|
@swallow_exceptions
|
||||||
def on_incoming_request(self, headers: Dict[str, str], method: str, path: str) -> None:
|
def on_incoming_request(self, headers: Dict[str, str], method: str, path: str) -> None:
|
||||||
name = f"{method} {path}" if method or path else "http.server"
|
name = f"{method} {path}" if method or path else "http.server"
|
||||||
transaction = sentry_sdk.continue_trace(headers or {}, op='http.server', name=name)
|
# Continue from incoming headers, then START the transaction per SDK v2
|
||||||
# Store transaction in context var to ensure we can finish it later
|
continued = sentry_sdk.continue_trace(headers or {}, op='http.server', name=name)
|
||||||
|
transaction = sentry_sdk.start_transaction(transaction=continued)
|
||||||
|
# Store started transaction in context var and make current (enter)
|
||||||
self._current_transaction.set(transaction)
|
self._current_transaction.set(transaction)
|
||||||
transaction.__enter__()
|
transaction.__enter__()
|
||||||
scope = sentry_sdk.Hub.current.scope
|
scope = sentry_sdk.Hub.current.scope
|
||||||
|
|||||||
Reference in New Issue
Block a user