Skip to content

Commit

Permalink
fix(deps): update opentelemetry-java monorepo to v1.42.0 (#579)
Browse files Browse the repository at this point in the history
* fix(deps): update opentelemetry-java monorepo to v1.42.0

* update for breaking changes

* update deps and fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jason Plumb <[email protected]>
  • Loading branch information
renovate[bot] and breedx-splk authored Sep 10, 2024
1 parent e691739 commit c354146
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
import io.opentelemetry.android.internal.services.applifecycle.ApplicationStateListener;
import io.opentelemetry.android.internal.services.visiblescreen.VisibleScreenService;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.KeyValue;
import io.opentelemetry.api.common.Value;
import io.opentelemetry.api.incubator.events.EventLogger;
import io.opentelemetry.api.incubator.logs.AnyValue;
import io.opentelemetry.api.incubator.logs.KeyAnyValue;
import io.opentelemetry.api.logs.Logger;
import io.opentelemetry.api.logs.LoggerBuilder;
import io.opentelemetry.api.logs.LoggerProvider;
Expand All @@ -61,7 +61,6 @@
import io.opentelemetry.sdk.logs.data.LogRecordData;
import io.opentelemetry.sdk.logs.export.LogRecordExporter;
import io.opentelemetry.sdk.logs.export.SimpleLogRecordProcessor;
import io.opentelemetry.sdk.logs.internal.AnyValueBody;
import io.opentelemetry.sdk.logs.internal.SdkEventLoggerProvider;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions;
Expand Down Expand Up @@ -185,10 +184,10 @@ public void shouldBuildLogRecordProvider() {
equalTo(stringKey("mega"), "hit"))
.hasResource(resource);

AnyValue<?> bodyValue = ((AnyValueBody) logs.get(0).getBody()).asAnyValue();
List<KeyAnyValue> payload = (List<KeyAnyValue>) bodyValue.getValue();
Value<?> bodyValue = logs.get(0).getBodyValue();
List<KeyValue> payload = (List<KeyValue>) bodyValue.getValue();
assertThat(payload).hasSize(1);
KeyAnyValue expected = KeyAnyValue.of("body.field", AnyValue.of("foo"));
KeyValue expected = KeyValue.of("body.field", Value.of("foo"));
assertThat(payload.get(0)).isEqualTo(expected);
}

Expand Down
2 changes: 1 addition & 1 deletion demo-app/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
opentelemetry = "1.41.0"
opentelemetry = "1.42.0"
opentelemetry-alpha = "1.39.0-alpha"
junit = "5.11.0"
spotless = "6.25.0"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
opentelemetry = "1.41.0"
opentelemetry-alpha = "1.41.0-alpha"
opentelemetry = "1.42.1"
opentelemetry-alpha = "1.42.1-alpha"
opentelemetry-instrumentation = "2.7.0"
opentelemetry-instrumentation-alpha = "2.7.0-alpha"
opentelemetry-semconv = "1.25.0-alpha"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.opentelemetry.android.internal.initialization.InitializationEvents
import io.opentelemetry.api.OpenTelemetry
import io.opentelemetry.api.common.AttributeKey
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.incubator.logs.AnyValue
import io.opentelemetry.api.common.Value
import io.opentelemetry.sdk.logs.internal.SdkEventLoggerProvider
import io.opentelemetry.sdk.trace.export.SpanExporter
import java.time.Instant
Expand Down Expand Up @@ -78,7 +78,7 @@ class SdkInitializationEvents(private val clock: Supplier<Instant> = Supplier {
private fun addEvent(
name: String,
attr: Attributes? = null,
body: AnyValue<*>? = null,
body: Value<*>? = null,
) {
events.add(Event(clock.get(), name, attr, body))
}
Expand All @@ -87,6 +87,6 @@ class SdkInitializationEvents(private val clock: Supplier<Instant> = Supplier {
val timestamp: Instant,
val name: String,
val attributes: Attributes?,
val body: AnyValue<*>? = null,
val body: Value<*>? = null,
)
}

0 comments on commit c354146

Please sign in to comment.