1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

Created a separate package for tracing-related stuff

Added mirroring of spans into Sentry
Tracer is a facade that redirects actions to tracing backends
This commit is contained in:
Alexander Presnyakov
2025-08-29 23:04:24 +00:00
committed by Leonid Fedorov
parent a0b4bcd1ce
commit 9b98c5c20a
22 changed files with 681 additions and 514 deletions

37
cmapi/tracing/backend.py Normal file
View File

@@ -0,0 +1,37 @@
from abc import ABC, abstractmethod
from typing import Any, Dict, Optional
from tracing.span import TraceSpan
class TracerBackend(ABC):
@abstractmethod
def on_span_start(self, span: TraceSpan) -> None:
raise NotImplementedError
@abstractmethod
def on_span_end(self, span: TraceSpan, exc: Optional[BaseException]) -> None:
raise NotImplementedError
def on_span_event(self, span: TraceSpan, name: str, attrs: Dict[str, Any]) -> None:
return
def on_span_status(self, span: TraceSpan, code: str, description: str) -> None:
return
def on_span_exception(self, span: TraceSpan, exc: BaseException) -> None:
return
def on_span_attribute(self, span: TraceSpan, key: str, value: Any) -> None:
return
def on_inject_headers(self, headers: Dict[str, str]) -> None:
return
def on_incoming_request(self, headers: Dict[str, str], method: str, path: str) -> None:
return
def on_request_finished(self, status_code: Optional[int]) -> None:
return