Skip to content

Commit 7d4df1d

Browse files
art-of-domRomanR-dev
authored andcommitted
Use record.created for ts in EmitterV1+
1 parent 7bf0828 commit 7d4df1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logging_loki/emitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def build_payload(self, record: logging.LogRecord, line) -> dict:
135135
"""Build JSON payload with a log entry."""
136136
labels = self.build_tags(record)
137137
ns = 1e9
138-
ts = str(int(time.time() * ns))
138+
ts = str(int(record.created * ns))
139139
stream = {
140140
"stream": labels,
141141
"values": [[ts, line]],

0 commit comments

Comments
 (0)