Skip to content

Commit

Permalink
Update to otel 1.18.0 (open-telemetry#6575)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored and LironKS committed Oct 31, 2022
1 parent fb2e7bd commit 880f269
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 80 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

// this line is managed by .github/scripts/update-sdk-version.sh
val otelVersion = "1.17.0"
val otelVersion = "1.18.0"

rootProject.extra["otelVersion"] = otelVersion

Expand Down
4 changes: 2 additions & 2 deletions examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ subprojects {
ext {
versions = [
// these lines are managed by .github/scripts/update-sdk-version.sh
opentelemetry : "1.17.0",
opentelemetryAlpha : "1.17.0-alpha",
opentelemetry : "1.18.0",
opentelemetryAlpha : "1.18.0-alpha",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.18.0-SNAPSHOT",
Expand Down
4 changes: 2 additions & 2 deletions examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ version '1.0'
ext {
versions = [
// these lines are managed by .github/scripts/update-sdk-version.sh
opentelemetry : "1.17.0",
opentelemetryAlpha : "1.17.0-alpha",
opentelemetry : "1.18.0",
opentelemetryAlpha : "1.18.0-alpha",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.18.0-SNAPSHOT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void instrumentationVersion_default() {

// see the test-instrumentation.properties file
InstrumentationScopeInfo expectedLibraryInfo =
InstrumentationScopeInfo.create("test-instrumentation", "1.2.3", /* schemaUrl= */ null);
InstrumentationScopeInfo.builder("test-instrumentation").setVersion("1.2.3").build();

otelTesting
.assertTraces()
Expand Down Expand Up @@ -529,8 +529,9 @@ void instrumentationVersion_custom() {
span ->
span.hasName("span")
.hasInstrumentationScopeInfo(
InstrumentationScopeInfo.create(
"test", "1.0", /* schemaUrl= */ null))));
InstrumentationScopeInfo.builder("test")
.setVersion("1.0")
.build())));
}

@Test
Expand All @@ -547,7 +548,9 @@ void schemaUrl() {
instrumenter.end(context, Collections.emptyMap(), Collections.emptyMap(), null);

InstrumentationScopeInfo expectedLibraryInfo =
InstrumentationScopeInfo.create("test", null, "https://opentelemetry.io/schemas/1.0.0");
InstrumentationScopeInfo.builder("test")
.setSchemaUrl("https://opentelemetry.io/schemas/1.0.0")
.build();
otelTesting
.assertTraces()
.hasTracesSatisfyingExactly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ void longCounter() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasLongSumSatisfying(
sum ->
sum.isMonotonic()
Expand Down Expand Up @@ -102,8 +103,9 @@ void observableLongCounter() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasLongSumSatisfying(
sum ->
sum.isMonotonic()
Expand Down Expand Up @@ -142,8 +144,9 @@ void doubleCounter() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasDoubleSumSatisfying(
sum ->
sum.isMonotonic()
Expand Down Expand Up @@ -176,8 +179,9 @@ void observableDoubleCounter() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasDoubleSumSatisfying(
sum ->
sum.isMonotonic()
Expand Down Expand Up @@ -216,8 +220,9 @@ void longUpDownCounter() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasLongSumSatisfying(
sum ->
sum.isNotMonotonic()
Expand Down Expand Up @@ -249,8 +254,9 @@ void observableLongUpDownCounter() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasLongSumSatisfying(
sum ->
sum.isNotMonotonic()
Expand Down Expand Up @@ -289,8 +295,9 @@ void doubleUpDownCounter() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasDoubleSumSatisfying(
sum ->
sum.isNotMonotonic()
Expand Down Expand Up @@ -323,8 +330,9 @@ void observableDoubleUpDownCounter() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasDoubleSumSatisfying(
sum ->
sum.isNotMonotonic()
Expand Down Expand Up @@ -363,8 +371,9 @@ void longHistogram() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down Expand Up @@ -393,8 +402,9 @@ void doubleHistogram() {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down Expand Up @@ -426,8 +436,9 @@ void longGauge() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasLongGaugeSatisfying(
gauge ->
gauge.hasPointsSatisfying(
Expand Down Expand Up @@ -467,8 +478,9 @@ void doubleGauge() throws InterruptedException {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationScope(
InstrumentationScopeInfo.create(
instrumentationName, "1.2.3", /* schemaUrl= */ null))
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
gauge.hasPointsSatisfying(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ dependencies {
implementation(project(":instrumentation:spring:spring-web-3.1:library"))
implementation(project(":instrumentation:spring:spring-webmvc-5.3:library"))
implementation(project(":instrumentation:spring:spring-webflux-5.0:library"))
implementation("io.opentelemetry:opentelemetry-micrometer1-shim") {
// just get the instrumentation, without micrometer itself
exclude("io.micrometer", "micrometer-core")
}
implementation(project(":instrumentation:micrometer:micrometer-1.5:library"))

compileOnly("org.springframework.kafka:spring-kafka:2.9.0")
compileOnly("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
Expand Down Expand Up @@ -79,7 +76,8 @@ tasks.withType<Test>().configureEach {

// disable tests on openj9 18 because they often crash JIT compiler
val testJavaVersion = gradle.startParameter.projectProperties["testJavaVersion"]?.let(JavaVersion::toVersion)
val testOnOpenJ9 = gradle.startParameter.projectProperties["testJavaVM"]?.run { this == "openj9" } ?: false
val testOnOpenJ9 = gradle.startParameter.projectProperties["testJavaVM"]?.run { this == "openj9" }
?: false
if (testOnOpenJ9 && testJavaVersion?.majorVersion == "18") {
enabled = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.MeterRegistry;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.micrometer1shim.OpenTelemetryMeterRegistry;
import io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistry;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.micrometer.core.instrument.MeterRegistry;
import io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistry;
import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration;
import io.opentelemetry.micrometer1shim.OpenTelemetryMeterRegistry;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
Expand Down
3 changes: 2 additions & 1 deletion javaagent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies {
implementation("io.opentelemetry:opentelemetry-extension-aws")
implementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
implementation("io.opentelemetry:opentelemetry-sdk-extension-resources")
implementation("io.opentelemetry:opentelemetry-sdk-extension-metric-incubator")
// the incubator's ViewConfigCustomizer is used to support loading yaml-based metric views
implementation("io.opentelemetry:opentelemetry-sdk-extension-incubator")

// Exporters with dependencies
implementation("io.opentelemetry:opentelemetry-exporter-jaeger")
Expand Down
Loading

0 comments on commit 880f269

Please sign in to comment.