Skip to content

Commit bb36b37

Browse files
Merge branch 'main' into add_metric_annotation_instrument
2 parents 711fa32 + 743cb55 commit bb36b37

File tree

11 files changed

+155
-58
lines changed

11 files changed

+155
-58
lines changed

docs/instrumentation-list.yaml

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

instrumentation-annotations-support-testing/src/main/java/io/opentelemetry/javaagent/instrumentation/otelannotations/AbstractWithSpanTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ protected final InstrumentationExtension testing() {
4343
return testing;
4444
}
4545

46+
protected boolean isExperimentalSpanAttributesEnabled() {
47+
return true;
48+
}
49+
4650
@Test
4751
void success() {
4852
AbstractTraced<T, U> traced = newTraced();
@@ -92,7 +96,10 @@ void canceled() {
9296

9397
List<AttributeAssertion> attributeAssertions =
9498
codeFunctionAssertions(traced.getClass(), "completable");
95-
attributeAssertions.add(equalTo(booleanKey(canceledKey()), true));
99+
100+
if (isExperimentalSpanAttributesEnabled()) {
101+
attributeAssertions.add(equalTo(booleanKey(canceledKey()), true));
102+
}
96103

97104
testing.waitAndAssertTraces(
98105
trace ->

instrumentation/guava-10.0/javaagent/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ muzzle {
1212
}
1313
}
1414

15-
tasks.withType<Test>().configureEach {
16-
// TODO run tests both with and without experimental span attributes
17-
jvmArgs("-Dotel.instrumentation.guava.experimental-span-attributes=true")
18-
}
19-
2015
dependencies {
2116
bootstrap(project(":instrumentation:executors:bootstrap"))
2217

@@ -47,7 +42,14 @@ tasks {
4742
jvmArgs("-Dotel.semconv-stability.opt-in=code/dup")
4843
}
4944

45+
val testExperimental by registering(Test::class) {
46+
testClassesDirs = sourceSets.test.get().output.classesDirs
47+
classpath = sourceSets.test.get().runtimeClasspath
48+
49+
jvmArgs("-Dotel.instrumentation.guava.experimental-span-attributes=true")
50+
}
51+
5052
check {
51-
dependsOn(testStableSemconv, testBothSemconv)
53+
dependsOn(testStableSemconv, testBothSemconv, testExperimental)
5254
}
5355
}

instrumentation/guava-10.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/guava/v10_0/BaseGuavaWithSpanTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
abstract class BaseGuavaWithSpanTest
1515
extends AbstractWithSpanTest<SettableFuture<String>, ListenableFuture<String>> {
1616

17+
static final boolean isExperimentalEnabled =
18+
Boolean.getBoolean("otel.instrumentation.guava.experimental-span-attributes");
19+
1720
@Override
1821
protected void complete(SettableFuture<String> future, String value) {
1922
future.set(value);
@@ -43,4 +46,9 @@ protected Throwable unwrapError(Throwable t) {
4346
protected String canceledKey() {
4447
return "guava.canceled";
4548
}
49+
50+
@Override
51+
protected boolean isExperimentalSpanAttributesEnabled() {
52+
return isExperimentalEnabled;
53+
}
4654
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description: >
2+
This instrumentation enables context propagation for Guava ListenableFuture, it does not emit
3+
any telemetry on its own.
4+
features:
5+
- CONTEXT_PROPAGATION
6+
library_link: https://github.com/google/guava
7+
configurations:
8+
- name: otel.instrumentation.guava.experimental-span-attributes
9+
description: Enables experimental span attribute `guava.canceled` for cancelled operations.
10+
type: boolean
11+
default: false
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
description: >
2-
This instrumentation enables the generation of spans for Hibernate operations, including
3-
session methods (e.g., `save`, `update`, `delete`), transaction commits, and query executions.
4-
library_link: https://github.com/hibernate/hibernate-orm
1+
description: This instrumentation enables spans for Hibernate ORM operations.
2+
library_link: https://hibernate.org/
53
configurations:
64
- name: otel.instrumentation.hibernate.experimental-span-attributes
5+
description: Enables the experimental `hibernate.session_id` span attribute.
76
type: boolean
8-
description: Enables the addition of the experimental `hibernate.session_id` span attribute.
9-
default: false
7+
default: false
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
description: >
2-
This instrumentation enables the generation of spans for Hibernate operations, including
3-
session methods (e.g., `save`, `update`, `delete`), transaction commits, and query executions.
4-
library_link: https://github.com/hibernate/hibernate-orm
1+
description: This instrumentation enables spans for Hibernate ORM operations.
2+
library_link: https://hibernate.org/
53
configurations:
64
- name: otel.instrumentation.hibernate.experimental-span-attributes
5+
description: Enables the experimental `hibernate.session_id` span attribute.
76
type: boolean
8-
description: Enables the addition of the experimental `hibernate.session_id` span attribute.
9-
default: false
7+
default: false
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
description: >
2-
This instrumentation enables the generation of spans for Hibernate operations, including
3-
session methods (e.g., `save`, `update`, `delete`), transaction commits, and query executions.
4-
library_link: https://github.com/hibernate/hibernate-orm
1+
description: This instrumentation enables spans for Hibernate ORM operations.
2+
library_link: https://hibernate.org/
53
configurations:
64
- name: otel.instrumentation.hibernate.experimental-span-attributes
5+
description: Enables the experimental `hibernate.session_id` span attribute.
76
type: boolean
8-
description: Enables the addition of the experimental `hibernate.session_id` span attribute.
9-
default: false
7+
default: false
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
description: This instrumentation enables the generation of spans for Hibernate stored procedure calls.
2-
library_link: https://github.com/hibernate/hibernate-orm
1+
description: This instrumentation enables spans for Hibernate stored procedure calls.
2+
library_link: https://hibernate.org/
33
configurations:
44
- name: otel.instrumentation.hibernate.experimental-span-attributes
5+
description: Enables the experimental `hibernate.session_id` span attribute.
56
type: boolean
6-
description: Enables the addition of the experimental `hibernate.session_id` span attribute.
7-
default: false
7+
default: false
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
description: >
2-
This instrumentation does not emit any telemetry on its own. Instead, it enables context
3-
propagation for Hibernate Reactive asynchronous operations.
2+
This instrumentation enables context propagation for Hibernate Reactive, it does not emit any
3+
telemetry on its own.
44
library_link: https://hibernate.org/reactive/
5+
features:
6+
- CONTEXT_PROPAGATION

0 commit comments

Comments
 (0)