diff --git a/logging_loki/emitter.py b/logging_loki/emitter.py index 1c45d86..aeacea6 100644 --- a/logging_loki/emitter.py +++ b/logging_loki/emitter.py @@ -135,7 +135,7 @@ def build_payload(self, record: logging.LogRecord, line) -> dict: """Build JSON payload with a log entry.""" labels = self.build_tags(record) ns = 1e9 - ts = str(int(time.time() * ns)) + ts = str(int(record.created * ns)) stream = { "stream": labels, "values": [[ts, line]],