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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user