Skip to content

Commit

Permalink
Update the OpenTelemetry SDK version to 1.37.0 (open-telemetry#11066)
Browse files Browse the repository at this point in the history
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Trask Stalnaker <[email protected]>
Co-authored-by: Lauri Tulmin <[email protected]>
  • Loading branch information
4 people committed Apr 12, 2024
1 parent 76b04cd commit 72d2d5d
Show file tree
Hide file tree
Showing 56 changed files with 1,388 additions and 147 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

// this line is managed by .github/scripts/update-sdk-version.sh
val otelSdkVersion = "1.36.0"
val otelSdkVersion = "1.37.0"
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")

// Need both BOM and groovy jars
Expand Down
5 changes: 2 additions & 3 deletions examples/distro/agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ tasks {
// exclude known bootstrap dependencies - they can't appear in the inst/ directory
dependencies {
exclude("io.opentelemetry:opentelemetry-api")
exclude("io.opentelemetry:opentelemetry-api-events")
exclude("io.opentelemetry:opentelemetry-context")
// metrics advice API
exclude("io.opentelemetry:opentelemetry-extension-incubator")
// events API and metrics advice API
exclude("io.opentelemetry:opentelemetry-api-incubator")
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subprojects {
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.35.0",
opentelemetrySdk : "1.37.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.33.1",
Expand Down
5 changes: 2 additions & 3 deletions examples/distro/testing/agent-for-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ tasks {
// exclude known bootstrap dependencies - they can't appear in the inst/ directory
dependencies {
exclude("io.opentelemetry:opentelemetry-api")
exclude("io.opentelemetry:opentelemetry-api-events")
exclude("io.opentelemetry:opentelemetry-context")
// metrics advice API
exclude("io.opentelemetry:opentelemetry-extension-incubator")
// events API and metrics advice API
exclude("io.opentelemetry:opentelemetry-api-incubator")
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version '1.0'
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.35.0",
opentelemetrySdk : "1.37.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.33.1",
Expand Down
2 changes: 1 addition & 1 deletion instrumentation-api-semconv/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group = "io.opentelemetry.instrumentation"
dependencies {
api("io.opentelemetry.semconv:opentelemetry-semconv")
api(project(":instrumentation-api"))
implementation("io.opentelemetry:opentelemetry-extension-incubator")
implementation("io.opentelemetry:opentelemetry-api-incubator")

compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value")
Expand Down
2 changes: 1 addition & 1 deletion instrumentation-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group = "io.opentelemetry.instrumentation"

dependencies {
api("io.opentelemetry:opentelemetry-api")
implementation("io.opentelemetry:opentelemetry-extension-incubator")
implementation("io.opentelemetry:opentelemetry-api-incubator")

compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
compileOnly("io.opentelemetry:opentelemetry-extension-incubator")
compileOnly("io.opentelemetry:opentelemetry-api-incubator")

library("io.micrometer:micrometer-core:1.5.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import io.micrometer.core.instrument.distribution.DistributionStatisticConfig;
import io.micrometer.core.instrument.util.TimeUtils;
import io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder;
import io.opentelemetry.api.metrics.DoubleHistogramBuilder;
import io.opentelemetry.extension.incubator.metrics.ExtendedDoubleHistogramBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.NavigableSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ public Span addEvent(
return this;
}

@Override
@CanIgnoreReturnValue
public Span addLink(SpanContext spanContext) {
agentSpan.addLink(Bridging.toAgent(spanContext));
return this;
}

@Override
@CanIgnoreReturnValue
public Span addLink(SpanContext spanContext, Attributes attributes) {
agentSpan.addLink(Bridging.toAgent(spanContext), Bridging.toAgent(attributes));
return this;
}

@Override
@CanIgnoreReturnValue
public Span setStatus(StatusCode status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ public ContextPropagators getPropagators() {
}

private static ApplicationMeterFactory getMeterFactory() {
// this class is defined in opentelemetry-api-1.32
// this class is defined in opentelemetry-api-1.37
ApplicationMeterFactory meterFactory =
getMeterFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_32.incubator.metrics.ApplicationMeterFactory132Incubator");
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_37.incubator.metrics.ApplicationMeterFactory137Incubator");
if (meterFactory == null) {
// this class is defined in opentelemetry-api-1.32
meterFactory =
getMeterFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_32.incubator.metrics.ApplicationMeterFactory132Incubator");
}
if (meterFactory == null) {
// this class is defined in opentelemetry-api-1.32
meterFactory =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ plugins {

dependencies {
compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_31"))
compileOnly("io.opentelemetry:opentelemetry-extension-incubator")
compileOnly("io.opentelemetry:opentelemetry-api-incubator")

implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.10:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.15:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.27:javaagent"))

testImplementation("io.opentelemetry:opentelemetry-extension-incubator")
testImplementation("io.opentelemetry:opentelemetry-extension-incubator:1.31.0-alpha")
}

configurations.configureEach {
if (name == "testRuntimeClasspath" || name == "testCompileClasspath") {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api:1.31.0")
force("io.opentelemetry:opentelemetry-extension-incubator:1.31.0-alpha")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_31;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static java.util.Collections.singletonList;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class OpenTelemetryApiInstrumentationModule extends InstrumentationModule {
Expand All @@ -27,4 +29,10 @@ public boolean isIndyModule() {
public List<TypeInstrumentation> typeInstrumentations() {
return singletonList(new OpenTelemetryInstrumentation());
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
return hasClassesNamed(
"application.io.opentelemetry.extension.incubator.metrics.ExtendedDoubleHistogramBuilder");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ApplicationDoubleCounterBuilder131 extends ApplicationDoubleCounterB

@Override
public ExtendedDoubleCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleCounterBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleCounterBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public LongGaugeBuilder ofLongs() {

@Override
public DoubleGauge build() {
io.opentelemetry.extension.incubator.metrics.DoubleGauge agentDoubleGauge =
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleGaugeBuilder) agentBuilder)
.build();
io.opentelemetry.api.incubator.metrics.DoubleGauge agentDoubleGauge =
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleGaugeBuilder) agentBuilder).build();
return new DoubleGauge() {

@Override
Expand All @@ -50,7 +49,7 @@ public void set(double value, Attributes attributes) {

@Override
public ExtendedDoubleGaugeBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleGaugeBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleGaugeBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ExtendedDoubleHistogramBuilder setExplicitBucketBoundariesAdvice(

@Override
public ExtendedDoubleHistogramBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleHistogramBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ApplicationDoubleUpDownCounterBuilder131 extends ApplicationDoubleUp

@Override
public ExtendedDoubleUpDownCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleUpDownCounterBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleUpDownCounterBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public DoubleCounterBuilder ofDoubles() {

@Override
public ExtendedLongCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedLongCounterBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedLongCounterBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ final class ApplicationLongGaugeBuilder131 extends ApplicationLongGaugeBuilder

@Override
public LongGauge build() {
io.opentelemetry.extension.incubator.metrics.LongGauge agentLongGauge =
((io.opentelemetry.extension.incubator.metrics.ExtendedLongGaugeBuilder) agentBuilder)
.build();
io.opentelemetry.api.incubator.metrics.LongGauge agentLongGauge =
((io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder) agentBuilder).build();
return new LongGauge() {
@Override
public void set(long value) {
Expand All @@ -43,7 +42,7 @@ public void set(long value, Attributes attributes) {

@Override
public ExtendedLongGaugeBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedLongGaugeBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ExtendedLongHistogramBuilder setExplicitBucketBoundariesAdvice(

@Override
public ExtendedLongHistogramBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedLongHistogramBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedLongHistogramBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public DoubleUpDownCounterBuilder ofDoubles() {

@Override
public ExtendedLongUpDownCounterBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedLongUpDownCounterBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedLongUpDownCounterBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_32"))
compileOnly("io.opentelemetry:opentelemetry-extension-incubator")
compileOnly("io.opentelemetry:opentelemetry-api-incubator")

implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent"))
Expand All @@ -18,7 +18,7 @@ testing {
suites {
val incubatorTest by registering(JvmTestSuite::class) {
dependencies {
implementation("io.opentelemetry:opentelemetry-extension-incubator")
implementation("io.opentelemetry:opentelemetry-extension-incubator:1.32.0-alpha")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ExtendedDoubleHistogramBuilder setExplicitBucketBoundariesAdvice(

@Override
public ExtendedDoubleHistogramBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedDoubleHistogramBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ExtendedLongHistogramBuilder setExplicitBucketBoundariesAdvice(

@Override
public ExtendedLongHistogramBuilder setAttributesAdvice(List<AttributeKey<?>> attributes) {
((io.opentelemetry.extension.incubator.metrics.ExtendedLongHistogramBuilder) agentBuilder)
((io.opentelemetry.api.incubator.metrics.ExtendedLongHistogramBuilder) agentBuilder)
.setAttributesAdvice(Bridging.toAgent(attributes));
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id("otel.javaagent-instrumentation")
}

dependencies {
compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_37"))
compileOnly("io.opentelemetry:opentelemetry-api-incubator")

implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.10:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.15:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.27:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.31:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.32:javaagent"))
}

testing {
suites {
val incubatorTest by registering(JvmTestSuite::class) {
dependencies {
implementation("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
}
}
}
}

tasks {
check {
dependsOn(testing.suites)
}
}
Loading

0 comments on commit 72d2d5d

Please sign in to comment.