Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the OpenTelemetry SDK version to 1.47.0 #13250

Merged
merged 12 commits into from
Feb 13, 2025
3 changes: 3 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ targets:
- type: gradle
path: ./
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.42:javaagent'
- type: gradle
path: ./
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.47:javaagent'
- type: gradle
path: ./
target: ':instrumentation:pekko:pekko-actor-1.0:javaagent'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
cache-read-only: ${{ inputs.cache-read-only }}

- name: Generate license report
run: ./gradlew generateLicenseReport ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
# with the build cache enabled occasionally produces outdated results
run: ./gradlew generateLicenseReport --no-build-cache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen this has happened at least once before where generateLicenseReport produces an old version of the license file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think I've seen this too 👍


- name: Check licenses
run: |
Expand Down
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
data class DependencySet(val group: String, val version: String, val modules: List<String>)

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

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.46.0",
opentelemetrySdk : "1.47.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "2.13.0-SNAPSHOT",
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.46.0",
opentelemetrySdk : "1.47.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "2.13.0-SNAPSHOT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,18 @@ private static ApplicationMeterFactory getMeterFactory(String className) {
}

private static ApplicationLoggerFactory getLoggerFactory() {
// this class is defined in opentelemetry-api-1.42
// this class is defined in opentelemetry-api-1.47
ApplicationLoggerFactory loggerFactory =
getLoggerFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.incubator.logs.ApplicationLoggerFactory142Incubator");
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_47.incubator.logs.ApplicationLoggerFactory147Incubator");
if (loggerFactory == null) {
// this class is defined in opentelemetry-api-1.42
loggerFactory =
getLoggerFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.incubator.logs.ApplicationLoggerFactory142Incubator");
}
if (loggerFactory == null) {
// this class is defined in opentelemetry-api-1.42
loggerFactory =
getLoggerFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.logs.ApplicationLoggerFactory142");
Expand All @@ -147,10 +154,16 @@ private static ApplicationLoggerFactory getLoggerFactory(String className) {
}

private static ApplicationTracerFactory getTracerFactory() {
// this class is defined in opentelemetry-api-1.40
// this class is defined in opentelemetry-api-1.47
ApplicationTracerFactory tracerFactory =
getTracerFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_40.incubator.trace.ApplicationTracerFactory140Incubator");
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_47.incubator.trace.ApplicationTracerFactory147Incubator");
if (tracerFactory == null) {
// this class is defined in opentelemetry-api-1.40
tracerFactory =
getTracerFactory(
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_40.incubator.trace.ApplicationTracerFactory140Incubator");
}
if (tracerFactory == null) {
tracerFactory = new ApplicationTracerFactory127();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ configurations.configureEach {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api:1.32.0")
}
if (name.equals("testRuntimeClasspath")) {
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.DoubleHistogram;
Expand Down Expand Up @@ -44,6 +45,15 @@ void setupMeter(TestInfo test) {
.build();
}

@Test
void incubatingApiNotAvailable() {
assertThatThrownBy(
() ->
Class.forName(
"io.opentelemetry.extension.incubator.metrics.ExtendedDoubleGaugeBuilder"))
.isInstanceOf(ClassNotFoundException.class);
}

@Test
void longHistogram() {
LongHistogramBuilder builder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ configurations.configureEach {
force("io.opentelemetry:opentelemetry-api:1.37.0")
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
}
if (name.startsWith("incubatorTest") || name.startsWith("noopTest")) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
}
} else if (name.startsWith("oldAndNewIncubatorTest")) {
if (name.startsWith("oldAndNewIncubatorTest")) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
force("io.opentelemetry:opentelemetry-extension-incubator:1.32.0-alpha")
}
}
if (name.equals("testRuntimeClasspath")) {
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.DoubleHistogram;
Expand Down Expand Up @@ -44,6 +45,13 @@ void setupMeter(TestInfo test) {
.build();
}

@Test
void incubatingApiNotAvailable() {
assertThatThrownBy(
() -> Class.forName("io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder"))
.isInstanceOf(ClassNotFoundException.class);
}

@Test
void longHistogram() {
LongHistogramBuilder builder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ configurations.configureEach {
if (name.endsWith("testRuntimeClasspath", true) || name.endsWith("testCompileClasspath", true)) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api:1.38.0")
force("io.opentelemetry:opentelemetry-api-incubator:1.38.0-alpha")
}
if (name.startsWith("incubatorTest") || name.startsWith("noopTest")) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api-incubator:1.38.0-alpha")
}
if (name.equals("testRuntimeClasspath")) {
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.DoubleGauge;
Expand Down Expand Up @@ -44,6 +45,13 @@ void setupMeter(TestInfo test) {
.build();
}

@Test
void incubatingApiNotAvailable() {
assertThatThrownBy(
() -> Class.forName("io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder"))
.isInstanceOf(ClassNotFoundException.class);
}

@Test
void syncLongGauge() throws InterruptedException {
LongGaugeBuilder builder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ configurations.configureEach {
if (name.endsWith("testRuntimeClasspath", true) || name.endsWith("testCompileClasspath", true)) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api:1.40.0")
force("io.opentelemetry:opentelemetry-api-incubator:1.40.0-alpha")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public OpenTelemetryApiIncubatorInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// EventLogger was removed in 1.47, including it here prevents the instrumentation from applying
// to 1.47
return hasClassesNamed(
"application.io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogram");
"application.io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogram",
"application.io.opentelemetry.api.incubator.events.EventLogger");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import java.util.function.BiConsumer;
import javax.annotation.Nullable;

final class ApplicationSpanBuilder140Incubator extends ApplicationSpanBuilder
public final class ApplicationSpanBuilder140Incubator extends ApplicationSpanBuilder
implements ExtendedSpanBuilder {

private final io.opentelemetry.api.incubator.trace.ExtendedSpanBuilder agentBuilder;

ApplicationSpanBuilder140Incubator(io.opentelemetry.api.trace.SpanBuilder agentBuilder) {
public ApplicationSpanBuilder140Incubator(io.opentelemetry.api.trace.SpanBuilder agentBuilder) {
super(agentBuilder);
this.agentBuilder = (io.opentelemetry.api.incubator.trace.ExtendedSpanBuilder) agentBuilder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ configurations.configureEach {
if (name.endsWith("testRuntimeClasspath", true) || name.endsWith("testCompileClasspath", true)) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api:1.42.0")
force("io.opentelemetry:opentelemetry-api-incubator:1.42.0-alpha")
}
if (name.startsWith("incubatorTest")) {
resolutionStrategy {
force("io.opentelemetry:opentelemetry-api-incubator:1.42.0-alpha")
}
if (name.equals("testRuntimeClasspath")) {
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public OpenTelemetryApiIncubatorInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
return hasClassesNamed("application.io.opentelemetry.api.incubator.logs.ExtendedLogger");
// EventLogger was removed in 1.47, including it here prevents the instrumentation from applying
// to 1.47
return hasClassesNamed(
"application.io.opentelemetry.api.incubator.logs.ExtendedLogger",
"application.io.opentelemetry.api.incubator.events.EventLogger");
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import application.io.opentelemetry.api.logs.LogRecordBuilder;
import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_40.incubator.logs.ApplicationLogger140Incubator;
import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.logs.ApplicationLogRecordBuilder142;

class ApplicationLogger142Incubator extends ApplicationLogger140Incubator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
import java.util.ArrayList;
import java.util.List;

class ApplicationLogRecordBuilder142 extends ApplicationLogRecordBuilder
public class ApplicationLogRecordBuilder142 extends ApplicationLogRecordBuilder
implements LogRecordBuilder {

private final io.opentelemetry.api.logs.LogRecordBuilder agentLogRecordBuilder;

ApplicationLogRecordBuilder142(io.opentelemetry.api.logs.LogRecordBuilder agentLogRecordBuilder) {
public ApplicationLogRecordBuilder142(
io.opentelemetry.api.logs.LogRecordBuilder agentLogRecordBuilder) {
super(agentLogRecordBuilder);
this.agentLogRecordBuilder = agentLogRecordBuilder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.logs;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.awaitility.Awaitility.await;

import io.opentelemetry.api.GlobalOpenTelemetry;
Expand Down Expand Up @@ -54,6 +55,12 @@ void setupLogger(TestInfo test) {
.build();
}

@Test
void incubatingApiNotAvailable() {
assertThatThrownBy(() -> Class.forName("io.opentelemetry.api.incubator.logs.ExtendedLogger"))
.isInstanceOf(ClassNotFoundException.class);
}

@Test
void logRecordBuilder() {
SpanContext spanContext =
Expand Down
Loading
Loading