Skip to content

Commit be8fb11

Browse files
authored
Merge branch 'main' into teja/creating-delegating-metric-data
2 parents c6b6dcc + 10eda19 commit be8fb11

File tree

77 files changed

+343
-429
lines changed

Some content is hidden

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

77 files changed

+343
-429
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
## Unreleased
44

5+
## Version 1.49.0 (2025-04-04)
6+
7+
### SDK
8+
9+
#### Trace
10+
11+
* Avoid linear queue.size() calls in span producers by storing queue size separately
12+
([#7141](https://github.com/open-telemetry/opentelemetry-java/pull/7141))
13+
14+
#### Exporters
15+
16+
* OTLP: Add support for setting exporter executor service
17+
([#7152](https://github.com/open-telemetry/opentelemetry-java/pull/7152))
18+
* OTLP: Refine delay jitter for exponential backoff
19+
([#7206](https://github.com/open-telemetry/opentelemetry-java/pull/7206))
20+
21+
#### Extensions
22+
23+
* Autoconfigure: Remove support for otel.experimental.exporter.otlp.retry.enabled
24+
([#7200](https://github.com/open-telemetry/opentelemetry-java/pull/7200))
25+
* Autoconfigure: Add stable cardinality limit property otel.java.metrics.cardinality.limit
26+
([#7199](https://github.com/open-telemetry/opentelemetry-java/pull/7199))
27+
* Incubator: Add declarative config model customizer SPI
28+
([#7118](https://github.com/open-telemetry/opentelemetry-java/pull/7118))
29+
530
## Version 1.48.0 (2025-03-07)
631

732
### API

README.md

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies {
6767
implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.1.0")
6868
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
6969
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
70-
implementation("org.owasp:dependency-check-gradle:12.1.0")
70+
implementation("org.owasp:dependency-check-gradle:12.1.1")
7171
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.0")
7272
}
7373

buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ tasks {
8787
// cognitive load is dubious.
8888
disable("YodaCondition")
8989

90+
// Text blocks are not supported in java 8
91+
disable("StringConcatToTextBlock")
92+
9093
if ((name.contains("Jmh") || name.contains("Test") || project.name.contains("testing-internal")) && !project.name.equals("custom-checks")) {
9194
// Allow underscore in test-type method names
9295
disable("MemberName")

buildSrc/src/main/kotlin/otel.jacoco-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
jacoco {
8-
toolVersion = "0.8.12"
8+
toolVersion = "0.8.13"
99
}
1010

1111
// https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_code_coverage.html

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ java {
4242

4343
checkstyle {
4444
configDirectory.set(file("$rootDir/buildscripts/"))
45-
toolVersion = "10.21.4"
45+
toolVersion = "10.23.0"
4646
isIgnoreFailures = false
4747
configProperties["rootDir"] = rootDir
4848
}

context/src/main/java/io/opentelemetry/context/Context.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ default Executor wrap(Executor executor) {
268268
* making this the {@linkplain Context#current() current context} before each execution.
269269
*/
270270
default ExecutorService wrap(ExecutorService executor) {
271+
if (executor instanceof ContextExecutorService) {
272+
return executor;
273+
}
271274
return new ContextExecutorService(this, executor);
272275
}
273276

@@ -277,6 +280,9 @@ default ExecutorService wrap(ExecutorService executor) {
277280
* execution.
278281
*/
279282
default ScheduledExecutorService wrap(ScheduledExecutorService executor) {
283+
if (executor instanceof ContextScheduledExecutorService) {
284+
return executor;
285+
}
280286
return new ContextScheduledExecutorService(this, executor);
281287
}
282288

context/src/test/java/io/opentelemetry/context/ContextTest.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,24 @@ void wrapExecutor() {
361361
}
362362
}
363363

364+
@Test
365+
void wrapExecutorService() {
366+
// given
367+
ExecutorService executorService = Executors.newSingleThreadExecutor();
368+
369+
// when
370+
ExecutorService firstWrap = CAT.wrap(executorService);
371+
ExecutorService secondWrap = CAT.wrap(firstWrap);
372+
373+
// then
374+
assertThat(firstWrap).isInstanceOf(ContextExecutorService.class);
375+
assertThat(((ContextExecutorService) firstWrap).context()).isEqualTo(CAT);
376+
assertThat(((ContextExecutorService) firstWrap).delegate()).isEqualTo(executorService);
377+
assertThat(secondWrap).isInstanceOf(ContextExecutorService.class);
378+
assertThat(((ContextExecutorService) secondWrap).context()).isEqualTo(CAT);
379+
assertThat(((ContextExecutorService) secondWrap).delegate()).isEqualTo(executorService);
380+
}
381+
364382
@Nested
365383
@TestInstance(Lifecycle.PER_CLASS)
366384
class WrapExecutorService {
@@ -504,6 +522,25 @@ void invokeAnyTimeout() throws Exception {
504522
}
505523
}
506524

525+
@Test
526+
void wrapScheduledExecutorService() {
527+
// given
528+
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
529+
530+
// when
531+
ScheduledExecutorService firstWrap = CAT.wrap(executorService);
532+
ScheduledExecutorService secondWrap = CAT.wrap(firstWrap);
533+
534+
// then
535+
assertThat(firstWrap).isInstanceOf(ContextScheduledExecutorService.class);
536+
assertThat(((ContextScheduledExecutorService) firstWrap).context()).isEqualTo(CAT);
537+
assertThat(((ContextScheduledExecutorService) firstWrap).delegate()).isEqualTo(executorService);
538+
assertThat(secondWrap).isInstanceOf(ContextScheduledExecutorService.class);
539+
assertThat(((ContextScheduledExecutorService) secondWrap).context()).isEqualTo(CAT);
540+
assertThat(((ContextScheduledExecutorService) secondWrap).delegate())
541+
.isEqualTo(executorService);
542+
}
543+
507544
@Nested
508545
@TestInstance(Lifecycle.PER_CLASS)
509546
class WrapScheduledExecutorService {

custom-checks/src/test/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadocTest.java

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,48 @@
1111
class OtelInternalJavadocTest {
1212

1313
@Test
14-
void test() {
15-
doTest("internal/InternalJavadocPositiveCases.java");
16-
doTest("internal/InternalJavadocNegativeCases.java");
14+
void positiveCases() {
15+
CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class)
16+
.addSourceLines(
17+
"internal/InternalJavadocPositiveCases.java",
18+
"/*",
19+
" * Copyright The OpenTelemetry Authors",
20+
" * SPDX-License-Identifier: Apache-2.0",
21+
" */",
22+
"package io.opentelemetry.gradle.customchecks.internal;",
23+
"// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers",
24+
"public class InternalJavadocPositiveCases {",
25+
" // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers",
26+
" public static class One {}",
27+
" /** Doesn't have the disclaimer. */",
28+
" // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers",
29+
" public static class Two {}",
30+
"}")
31+
.doTest();
1732
}
1833

19-
private static void doTest(String path) {
34+
@Test
35+
void negativeCases() {
2036
CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class)
21-
.addSourceFile(path)
37+
.addSourceLines(
38+
"internal/InternalJavadocNegativeCases.java",
39+
"/*",
40+
" * Copyright The OpenTelemetry Authors",
41+
" * SPDX-License-Identifier: Apache-2.0",
42+
" */",
43+
"package io.opentelemetry.gradle.customchecks.internal;",
44+
"/**",
45+
" * This class is internal and is hence not for public use. Its APIs are unstable and can change at",
46+
" * any time.",
47+
" */",
48+
"public class InternalJavadocNegativeCases {",
49+
" /**",
50+
" * This class is internal and is hence not for public use. Its APIs are unstable and can change at",
51+
" * any time.",
52+
" */",
53+
" public static class One {}",
54+
" static class Two {}",
55+
"}")
2256
.doTest();
2357
}
2458
}

custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocNegativeCases.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)