From 3c1905096acc443e9ea93f267f40e6e5f01c5b50 Mon Sep 17 00:00:00 2001 From: Christian Ivanov Date: Thu, 14 Nov 2024 13:29:20 +0100 Subject: [PATCH] fixed Timestamp not being set for otel log signals --- .../opentelemetry/runtime/logs/OpenTelemetryLogHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/logs/OpenTelemetryLogHandler.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/logs/OpenTelemetryLogHandler.java index de673ab9c77db..9c4606ea68e99 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/logs/OpenTelemetryLogHandler.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/logs/OpenTelemetryLogHandler.java @@ -10,6 +10,7 @@ import java.io.PrintWriter; import java.io.StringWriter; +import java.time.Instant; import java.util.Map; import java.util.Optional; import java.util.logging.Handler; @@ -43,6 +44,7 @@ public void publish(LogRecord record) { final LogRecordBuilder logRecordBuilder = openTelemetry.getLogsBridge() .loggerBuilder(INSTRUMENTATION_NAME) .build().logRecordBuilder() + .setTimestamp(Instant.now()) .setObservedTimestamp(record.getInstant()); if (record.getLevel() != null) {