Skip to content

Commit

Permalink
fixed Timestamp not being set for otel log signals
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris18230 authored and gsmet committed Nov 15, 2024
1 parent ccd4f3f commit 3c19050
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3c19050

Please sign in to comment.