diff --git a/disk-buffering/build.gradle.kts b/disk-buffering/build.gradle.kts index ef86e9043..f3089bf6a 100644 --- a/disk-buffering/build.gradle.kts +++ b/disk-buffering/build.gradle.kts @@ -22,6 +22,7 @@ val protos by configurations.creating dependencies { api("io.opentelemetry:opentelemetry-sdk") + implementation("io.opentelemetry:opentelemetry-api-incubator") compileOnly("com.google.auto.value:auto-value-annotations") annotationProcessor("com.google.auto.value:auto-value") signature("com.toasttab.android:gummy-bears-api-21:0.6.1:coreLib@signature") diff --git a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java index 9ff0f9410..1d309ff5f 100644 --- a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java +++ b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java @@ -9,15 +9,16 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.Value; +import io.opentelemetry.api.incubator.common.ExtendedAttributes; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.api.trace.SpanContext; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; -import io.opentelemetry.sdk.logs.data.LogRecordData; +import io.opentelemetry.sdk.logs.data.internal.ExtendedLogRecordData; import io.opentelemetry.sdk.resources.Resource; import javax.annotation.Nullable; @AutoValue -public abstract class LogRecordDataImpl implements LogRecordData { +public abstract class LogRecordDataImpl implements ExtendedLogRecordData { public static Builder builder() { return new AutoValue_LogRecordDataImpl.Builder(); @@ -31,6 +32,17 @@ public io.opentelemetry.sdk.logs.data.Body getBody() { : io.opentelemetry.sdk.logs.data.Body.string(valueBody.asString()); } + @Override + public ExtendedAttributes getExtendedAttributes() { + return ExtendedAttributes.builder().putAll(getAttributes()).build(); + } + + // It's only deprecated in the incubating interface for extended attributes, which are not yet + // supported in this module. + @SuppressWarnings("deprecation") + @Override + public abstract Attributes getAttributes(); + @Override @Nullable public abstract Value getBodyValue();