From 979e5411eb0fa7a5878986e20b2674ba834584fc Mon Sep 17 00:00:00 2001 From: Dom Postorivo Date: Thu, 4 Dec 2025 10:30:49 -0500 Subject: [PATCH] Use record.created for ts in EmitterV1+ --- logging_loki/emitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]],