From 17563521069571e97561e9cf2e1d94e4ae6e012a Mon Sep 17 00:00:00 2001 From: Kaslo Date: Fri, 19 Dec 2025 22:08:00 -0600 Subject: [PATCH] fix: remove timestamp rounding in TerseJsonFormatter The round(record.created, 2) call limits timestamps generated by TerseJsonFormatter to 10ms precision. This can cause log ordering issues in log aggregators like Loki when multiple events occur within the same 10ms window. The rounding was introduced in the original structured logging PR and, to my knowledge, has no technical benefit. --- synapse/logging/_terse_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/logging/_terse_json.py b/synapse/logging/_terse_json.py index d9ff70b252..5afa4c5fa9 100644 --- a/synapse/logging/_terse_json.py +++ b/synapse/logging/_terse_json.py @@ -89,7 +89,7 @@ class TerseJsonFormatter(JsonFormatter): "log": record.getMessage(), "namespace": record.name, "level": record.levelname, - "time": round(record.created, 2), + "time": record.created, } return self._format(record, event)