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

Tracing fixes:

Don't log trace_params in tracing logger, because it already has all this data
Don't print span attrs, it can contain lots of headers
Save small part of the response into the span, if the response was a JSON string
Added JSON logging of trace details into a separate file (to not spam the main log with machine readable stuff)
Record part of the response into the span
Set duration attribute in server spans
Log 404 errors
Colorize the traces (each span slightly changes the color of the parent span)
Improve trace visualization with duration formatting and notes for request/response pairs
This commit is contained in:
Alexander Presnyakov
2025-09-04 17:21:25 +00:00
parent 194e7ccbdc
commit 151903cd18
13 changed files with 962 additions and 39 deletions

View File

@@ -43,4 +43,12 @@ class TraceSpan:
def record_exception(self, exc: BaseException) -> None:
self.tracer._notify_exception(self, exc)
def to_flat_dict(self) -> Dict[str, Any]:
fd = self.__dict__.copy()
fd['span_name'] = fd.pop('name') # name field is reserved in log records
# Remove non-serializable references
fd.pop('tracer', None)
attributes = fd.pop("attributes")
fd.update(attributes)
return fd