From 317aa33dcb2eff83b2c1339ccdc9222f55cdfc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=5Bgithub=5D=E2=80=9D?= Date: Thu, 19 Feb 2026 21:15:50 +0530 Subject: [PATCH 1/3] docs(logs): clarify setTimestamp javadoc for event timestamp behavior --- .../java/io/opentelemetry/api/logs/LogRecordBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java index a8ac9d4d203..e4e998f0652 100644 --- a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java +++ b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java @@ -31,16 +31,16 @@ public interface LogRecordBuilder { /** * Set the epoch {@code timestamp}, using the timestamp and unit. * - *

The {@code timestamp} is the time at which the log record occurred. If unset, it will be set - * to the current time when {@link #emit()} is called. + *

Note: If the event timestamp is unset, it will NOT be automatically populated when + * {@link #emit()} is called. Only the observed timestamp receives a default value. */ LogRecordBuilder setTimestamp(long timestamp, TimeUnit unit); /** * Set the epoch {@code timestamp}, using the instant. * - *

The {@code timestamp} is the time at which the log record occurred. If unset, it will be set - * to the current time when {@link #emit()} is called. + *

Note: If the event timestamp is unset, it will NOT be automatically populated when + * {@link #emit()} is called. Only the observed timestamp receives a default value. */ LogRecordBuilder setTimestamp(Instant instant); From 5b0b36ace643f66cc8a1f475f334ffd11c8d8ddd Mon Sep 17 00:00:00 2001 From: Ruturaj Jadhav Date: Fri, 20 Feb 2026 09:11:02 +0530 Subject: [PATCH 2/3] Update api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java Co-authored-by: Jack Berg <34418638+jack-berg@users.noreply.github.com> --- .../main/java/io/opentelemetry/api/logs/LogRecordBuilder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java index e4e998f0652..cbd5cca3b06 100644 --- a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java +++ b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java @@ -31,8 +31,7 @@ public interface LogRecordBuilder { /** * Set the epoch {@code timestamp}, using the timestamp and unit. * - *

Note: If the event timestamp is unset, it will NOT be automatically populated when - * {@link #emit()} is called. Only the observed timestamp receives a default value. + *

Note: If not set, the emitted log will not have a timestamp. */ LogRecordBuilder setTimestamp(long timestamp, TimeUnit unit); From a2b41342aa348844802006fcc6695ea7e6065f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=5Bgithub=5D=E2=80=9D?= Date: Sat, 21 Feb 2026 08:48:41 +0530 Subject: [PATCH 3/3] docs(logs): simplify setTimestamp javadoc note --- .../opentelemetry/api/logs/LogRecordBuilder.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java index cbd5cca3b06..0fd54349e73 100644 --- a/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java +++ b/api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java @@ -5,18 +5,19 @@ package io.opentelemetry.api.logs; +import java.time.Instant; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Nullable; + +import io.opentelemetry.api.common.AttributeKey; import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.doubleKey; import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; - -import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.Value; import io.opentelemetry.context.Context; -import java.time.Instant; -import java.util.concurrent.TimeUnit; -import javax.annotation.Nullable; /** * Used to construct and emit log records from a {@link Logger}. @@ -38,8 +39,7 @@ public interface LogRecordBuilder { /** * Set the epoch {@code timestamp}, using the instant. * - *

Note: If the event timestamp is unset, it will NOT be automatically populated when - * {@link #emit()} is called. Only the observed timestamp receives a default value. + *

Note: If not set, the emitted log will not have a timestamp. */ LogRecordBuilder setTimestamp(Instant instant);