Skip to content

Commit 129f224

Browse files
Update the OpenTelemetry SDK version to 1.47.0 (#13250)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 15358d6 commit 129f224

File tree

42 files changed

+773
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+773
-160
lines changed

.fossa.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,9 @@ targets:
751751
- type: gradle
752752
path: ./
753753
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.42:javaagent'
754+
- type: gradle
755+
path: ./
756+
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.47:javaagent'
754757
- type: gradle
755758
path: ./
756759
target: ':instrumentation:pekko:pekko-actor-1.0:javaagent'

.github/workflows/build-common.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ jobs:
6868
cache-read-only: ${{ inputs.cache-read-only }}
6969

7070
- name: Generate license report
71-
run: ./gradlew generateLicenseReport ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
71+
# with the build cache enabled occasionally produces outdated results
72+
run: ./gradlew generateLicenseReport --no-build-cache
7273

7374
- name: Check licenses
7475
run: |

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
data class DependencySet(val group: String, val version: String, val modules: List<String>)
66

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

examples/distro/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subprojects {
2727
ext {
2828
versions = [
2929
// this line is managed by .github/scripts/update-sdk-version.sh
30-
opentelemetrySdk : "1.46.0",
30+
opentelemetrySdk : "1.47.0",
3131

3232
// these lines are managed by .github/scripts/update-version.sh
3333
opentelemetryJavaagent : "2.13.0-SNAPSHOT",

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ version '1.0'
2323
ext {
2424
versions = [
2525
// this line is managed by .github/scripts/update-sdk-version.sh
26-
opentelemetrySdk : "1.46.0",
26+
opentelemetrySdk : "1.47.0",
2727

2828
// these lines are managed by .github/scripts/update-version.sh
2929
opentelemetryJavaagent : "2.13.0-SNAPSHOT",

instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/ApplicationOpenTelemetry127.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,18 @@ private static ApplicationMeterFactory getMeterFactory(String className) {
120120
}
121121

122122
private static ApplicationLoggerFactory getLoggerFactory() {
123-
// this class is defined in opentelemetry-api-1.42
123+
// this class is defined in opentelemetry-api-1.47
124124
ApplicationLoggerFactory loggerFactory =
125125
getLoggerFactory(
126-
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.incubator.logs.ApplicationLoggerFactory142Incubator");
126+
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_47.incubator.logs.ApplicationLoggerFactory147Incubator");
127127
if (loggerFactory == null) {
128+
// this class is defined in opentelemetry-api-1.42
129+
loggerFactory =
130+
getLoggerFactory(
131+
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.incubator.logs.ApplicationLoggerFactory142Incubator");
132+
}
133+
if (loggerFactory == null) {
134+
// this class is defined in opentelemetry-api-1.42
128135
loggerFactory =
129136
getLoggerFactory(
130137
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_42.logs.ApplicationLoggerFactory142");
@@ -147,10 +154,16 @@ private static ApplicationLoggerFactory getLoggerFactory(String className) {
147154
}
148155

149156
private static ApplicationTracerFactory getTracerFactory() {
150-
// this class is defined in opentelemetry-api-1.40
157+
// this class is defined in opentelemetry-api-1.47
151158
ApplicationTracerFactory tracerFactory =
152159
getTracerFactory(
153-
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_40.incubator.trace.ApplicationTracerFactory140Incubator");
160+
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_47.incubator.trace.ApplicationTracerFactory147Incubator");
161+
if (tracerFactory == null) {
162+
// this class is defined in opentelemetry-api-1.40
163+
tracerFactory =
164+
getTracerFactory(
165+
"io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_40.incubator.trace.ApplicationTracerFactory140Incubator");
166+
}
154167
if (tracerFactory == null) {
155168
tracerFactory = new ApplicationTracerFactory127();
156169
}

instrumentation/opentelemetry-api/opentelemetry-api-1.32/javaagent/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ configurations.configureEach {
2121
resolutionStrategy {
2222
force("io.opentelemetry:opentelemetry-api:1.32.0")
2323
}
24+
if (name.equals("testRuntimeClasspath")) {
25+
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
26+
}
2427
}
2528
}
2629

instrumentation/opentelemetry-api/opentelemetry-api-1.32/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_32/metrics/MeterTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
1010
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1111
import static java.util.Collections.singletonList;
12+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
1213

1314
import io.opentelemetry.api.common.Attributes;
1415
import io.opentelemetry.api.metrics.DoubleHistogram;
@@ -44,6 +45,15 @@ void setupMeter(TestInfo test) {
4445
.build();
4546
}
4647

48+
@Test
49+
void incubatingApiNotAvailable() {
50+
assertThatThrownBy(
51+
() ->
52+
Class.forName(
53+
"io.opentelemetry.extension.incubator.metrics.ExtendedDoubleGaugeBuilder"))
54+
.isInstanceOf(ClassNotFoundException.class);
55+
}
56+
4757
@Test
4858
void longHistogram() {
4959
LongHistogramBuilder builder =

instrumentation/opentelemetry-api/opentelemetry-api-1.37/javaagent/build.gradle.kts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ configurations.configureEach {
2121
force("io.opentelemetry:opentelemetry-api:1.37.0")
2222
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
2323
}
24-
if (name.startsWith("incubatorTest") || name.startsWith("noopTest")) {
25-
resolutionStrategy {
26-
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
27-
}
28-
} else if (name.startsWith("oldAndNewIncubatorTest")) {
24+
if (name.startsWith("oldAndNewIncubatorTest")) {
2925
resolutionStrategy {
3026
force("io.opentelemetry:opentelemetry-api-incubator:1.37.0-alpha")
3127
force("io.opentelemetry:opentelemetry-extension-incubator:1.32.0-alpha")
3228
}
3329
}
30+
if (name.equals("testRuntimeClasspath")) {
31+
exclude(group = "io.opentelemetry", module = "opentelemetry-api-incubator")
32+
}
3433
}
3534
}
3635

instrumentation/opentelemetry-api/opentelemetry-api-1.37/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_37/metrics/MeterTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
1010
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1111
import static java.util.Collections.singletonList;
12+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
1213

1314
import io.opentelemetry.api.common.Attributes;
1415
import io.opentelemetry.api.metrics.DoubleHistogram;
@@ -44,6 +45,13 @@ void setupMeter(TestInfo test) {
4445
.build();
4546
}
4647

48+
@Test
49+
void incubatingApiNotAvailable() {
50+
assertThatThrownBy(
51+
() -> Class.forName("io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder"))
52+
.isInstanceOf(ClassNotFoundException.class);
53+
}
54+
4755
@Test
4856
void longHistogram() {
4957
LongHistogramBuilder builder =

0 commit comments

Comments
 (0)