From 18708924dfb0e6f1a9b04d7e64d15d6e3e9c435d Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 10 Jan 2025 09:49:56 -0600 Subject: [PATCH] Add since annotations --- .../sdk/logs/ReadWriteLogRecord.java | 52 +++++++++++++++---- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java index 6ad913c1029..233b9970c3c 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java @@ -54,51 +54,85 @@ default ReadWriteLogRecord setAllAttributes(Attributes attributes) { /** * Returns the value of a given attribute if it exists. This is the equivalent of calling - * getAttributes().get(key) + * {@code getAttributes().get(key)}. + * + * @since 1.46.0 */ @Nullable default T getAttribute(AttributeKey key) { return toLogRecordData().getAttributes().get(key); } - /** Returns the instrumentation scope that generated this log. */ + /** + * Returns the instrumentation scope that generated this log. + * + * @since 1.46.0 + */ default InstrumentationScopeInfo getInstrumentationScopeInfo() { return toLogRecordData().getInstrumentationScopeInfo(); } - /** Returns the timestamp at which the log record occurred, in epoch nanos. */ + /** + * Returns the timestamp at which the log record occurred, in epoch nanos. + * + * @since 1.46.0 + */ default long getTimestampEpochNanos() { return toLogRecordData().getTimestampEpochNanos(); } - /** Returns the timestamp at which the log record was observed, in epoch nanos. */ + /** + * Returns the timestamp at which the log record was observed, in epoch nanos. + * + * @since 1.46.0 + */ default long getObservedTimestampEpochNanos() { return toLogRecordData().getTimestampEpochNanos(); } - /** Return the span context for this log, or {@link SpanContext#getInvalid()} if unset. */ + /** + * Return the span context for this log, or {@link SpanContext#getInvalid()} if unset. + * + * @since 1.46.0 + */ default SpanContext getSpanContext() { return toLogRecordData().getSpanContext(); } - /** Returns the severity for this log, or {@link Severity#UNDEFINED_SEVERITY_NUMBER} if unset. */ + /** + * Returns the severity for this log, or {@link Severity#UNDEFINED_SEVERITY_NUMBER} if unset. + * + * @since 1.46.0 + */ default Severity getSeverity() { return toLogRecordData().getSeverity(); } - /** Returns the severity text for this log, or null if unset. */ + /** + * Returns the severity text for this log, or null if unset. + * + * @since 1.46.0 + */ @Nullable default String getSeverityText() { return toLogRecordData().getSeverityText(); } - /** Returns the {@link Value} representation of the log body, of null if unset. */ + /** + * Returns the {@link Value} representation of the log body, of null if unset. + * + * @since 1.46.0 + */ @Nullable default Value getBodyValue() { return toLogRecordData().getBodyValue(); } - /** Returns the attributes for this log, or {@link Attributes#empty()} if unset. */ + /** + * Returns the attributes for this log, or {@link Attributes#empty()} if unset. + * + * @since 1.46.0 + */ default Attributes getAttributes() { return toLogRecordData().getAttributes(); }