Skip to content

Commit aee5f06

Browse files
committed
Merge branch 'main' into jmx-unit-semconv-alignment
2 parents 7c4afcb + 239a6a9 commit aee5f06

File tree

67 files changed

+2367
-808
lines changed

Some content is hidden

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

67 files changed

+2367
-808
lines changed

.fossa.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,9 @@ targets:
11141114
- type: gradle
11151115
path: ./
11161116
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-4.0:javaagent'
1117+
- type: gradle
1118+
path: ./
1119+
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-5.0:javaagent'
11171120
- type: gradle
11181121
path: ./
11191122
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-common:javaagent'

.github/graal-native-docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
mongodb:
3-
image: mongo:4.0
3+
image: mongo:4.2
44
ports:
55
- "27017:27017"
66

.github/workflows/auto-license-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
java-version-file: .java-version
2929

3030
- name: Set up gradle
31-
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
31+
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
3232
with:
3333
cache-read-only: true
3434

.github/workflows/auto-spotless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
java-version-file: .java-version
2929

3030
- name: Set up gradle
31-
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
31+
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
3232
with:
3333
cache-read-only: true
3434

.github/workflows/auto-update-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write
1919
steps:
2020
- name: Download patch
21-
uses: actions/[email protected]
21+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
2222
with:
2323
run-id: ${{ github.event.workflow_run.id }}
2424
path: ${{ runner.temp }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ dependencies {
161161
compileOnly("com.google.errorprone:error_prone_annotations")
162162

163163
codenarc("org.codenarc:CodeNarc:3.6.0")
164-
codenarc(platform("org.codehaus.groovy:groovy-bom:3.0.24"))
164+
codenarc(platform("org.codehaus.groovy:groovy-bom:3.0.25"))
165165

166166
modules {
167167
// checkstyle uses the very old google-collections which causes Java 9 module conflict with

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ val otelContribVersion = "1.46.0-alpha"
1010
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1111

1212
// Need both BOM and groovy jars
13-
val groovyVersion = "4.0.26"
13+
val groovyVersion = "4.0.27"
1414

1515
// We don't force libraries we instrument to new versions since we compile and test against specific
1616
// old baseline versions but we do try to force those libraries' transitive dependencies to new

instrumentation/camel-2.20/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelPropagationUtilTest.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@
2626
import org.junit.jupiter.api.BeforeAll;
2727
import org.junit.jupiter.api.Test;
2828

29-
public class CamelPropagationUtilTest {
29+
class CamelPropagationUtilTest {
3030

3131
@BeforeAll
32-
public static void setUp() {
32+
static void setUp() {
3333
GlobalOpenTelemetry.set(
3434
OpenTelemetry.propagating(ContextPropagators.create(JaegerPropagator.getInstance())));
3535
}
3636

3737
@Test
38-
public void shouldExtractHttpParentForHttpEndpoint() throws Exception {
39-
38+
void shouldExtractHttpParentForHttpEndpoint() throws Exception {
4039
// given
4140
Endpoint endpoint = new HttpEndpoint("", new HttpComponent(), URI.create(""));
4241
Map<String, Object> exchangeHeaders =
@@ -54,8 +53,7 @@ public void shouldExtractHttpParentForHttpEndpoint() throws Exception {
5453
}
5554

5655
@Test
57-
public void shouldNotFailExtractingNullHttpParentForHttpEndpoint() throws Exception {
58-
56+
void shouldNotFailExtractingNullHttpParentForHttpEndpoint() throws Exception {
5957
// given
6058
Endpoint endpoint = new HttpEndpoint("", new HttpComponent(), URI.create(""));
6159
Map<String, Object> exchangeHeaders = Collections.singletonMap("uber-trace-id", null);
@@ -70,8 +68,7 @@ public void shouldNotFailExtractingNullHttpParentForHttpEndpoint() throws Except
7068
}
7169

7270
@Test
73-
public void shouldNotFailExtractingNullAwsParentForSqsEndpoint() {
74-
71+
void shouldNotFailExtractingNullAwsParentForSqsEndpoint() {
7572
// given
7673
Endpoint endpoint = new SqsEndpoint("", new SqsComponent(), new SqsConfiguration());
7774
Map<String, Object> exchangeHeaders = Collections.singletonMap("AWSTraceHeader", null);
@@ -86,8 +83,7 @@ public void shouldNotFailExtractingNullAwsParentForSqsEndpoint() {
8683
}
8784

8885
@Test
89-
public void shouldExtractAwsParentForSqsEndpoint() {
90-
86+
void shouldExtractAwsParentForSqsEndpoint() {
9187
// given
9288
Endpoint endpoint = new SqsEndpoint("", new SqsComponent(), new SqsConfiguration());
9389
Map<String, Object> exchangeHeaders =

instrumentation/camel-2.20/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/SanitizationTest.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.apachecamel.decorators;
77

8-
import static org.junit.jupiter.api.Assertions.assertEquals;
8+
import static org.assertj.core.api.Assertions.assertThat;
99
import static org.mockito.Mockito.mock;
1010
import static org.mockito.Mockito.when;
1111

@@ -20,6 +20,18 @@
2020

2121
class SanitizationTest {
2222

23+
static class CqlArgs implements ArgumentsProvider {
24+
@Override
25+
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
26+
return Stream.of(
27+
Arguments.of("FROM TABLE WHERE FIELD>=-1234", "FROM TABLE WHERE FIELD>=?"),
28+
Arguments.of(
29+
"SELECT Name, Phone.Number FROM Contact WHERE Address.State = 'NY'",
30+
"SELECT Name, Phone.Number FROM Contact WHERE Address.State = ?"),
31+
Arguments.of("FROM col WHERE @Tag='Something'", "FROM col WHERE @Tag=?"));
32+
}
33+
}
34+
2335
@ParameterizedTest
2436
@ArgumentsSource(CqlArgs.class)
2537
void sanitizeCql(String original, String expected) {
@@ -31,7 +43,22 @@ void sanitizeCql(String original, String expected) {
3143
when(exchange.getIn()).thenReturn(message);
3244

3345
String actualSanitized = decorator.getStatement(exchange, null);
34-
assertEquals(expected, actualSanitized);
46+
assertThat(actualSanitized).isEqualTo(expected);
47+
}
48+
49+
static class JdbcArgs implements ArgumentsProvider {
50+
@Override
51+
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
52+
return Stream.of(
53+
Arguments.of("SELECT 3", "SELECT ?"),
54+
Arguments.of(
55+
"SELECT * FROM TABLE WHERE FIELD = 1234", "SELECT * FROM TABLE WHERE FIELD = ?"),
56+
Arguments.of(
57+
"SELECT * FROM TABLE WHERE FIELD<-1234", "SELECT * FROM TABLE WHERE FIELD<?"),
58+
Arguments.of(
59+
"SELECT col1 AS col2 FROM users WHERE field=1234",
60+
"SELECT col1 AS col2 FROM users WHERE field=?"));
61+
}
3562
}
3663

3764
@ParameterizedTest
@@ -45,22 +72,7 @@ void sanitizeJdbc(String original, String expected) {
4572
when(exchange.getIn()).thenReturn(message);
4673

4774
String actualSanitized = decorator.getStatement(exchange, null);
48-
assertEquals(expected, actualSanitized);
49-
}
50-
51-
@ParameterizedTest
52-
@ArgumentsSource(SqlArgs.class)
53-
void sanitizeSql(String original, String expected) {
54-
55-
DbSpanDecorator decorator = new DbSpanDecorator("sql", "");
56-
57-
Exchange exchange = mock(Exchange.class);
58-
Message message = mock(Message.class);
59-
when(message.getHeader("CamelSqlQuery")).thenReturn(original);
60-
when(exchange.getIn()).thenReturn(message);
61-
62-
String actualSanitized = decorator.getStatement(exchange, null);
63-
assertEquals(expected, actualSanitized);
75+
assertThat(actualSanitized).isEqualTo(expected);
6476
}
6577

6678
static class SqlArgs implements ArgumentsProvider {
@@ -75,30 +87,18 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
7587
}
7688
}
7789

78-
static class CqlArgs implements ArgumentsProvider {
79-
@Override
80-
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
81-
return Stream.of(
82-
Arguments.of("FROM TABLE WHERE FIELD>=-1234", "FROM TABLE WHERE FIELD>=?"),
83-
Arguments.of(
84-
"SELECT Name, Phone.Number FROM Contact WHERE Address.State = 'NY'",
85-
"SELECT Name, Phone.Number FROM Contact WHERE Address.State = ?"),
86-
Arguments.of("FROM col WHERE @Tag='Something'", "FROM col WHERE @Tag=?"));
87-
}
88-
}
90+
@ParameterizedTest
91+
@ArgumentsSource(SqlArgs.class)
92+
void sanitizeSql(String original, String expected) {
8993

90-
static class JdbcArgs implements ArgumentsProvider {
91-
@Override
92-
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
93-
return Stream.of(
94-
Arguments.of("SELECT 3", "SELECT ?"),
95-
Arguments.of(
96-
"SELECT * FROM TABLE WHERE FIELD = 1234", "SELECT * FROM TABLE WHERE FIELD = ?"),
97-
Arguments.of(
98-
"SELECT * FROM TABLE WHERE FIELD<-1234", "SELECT * FROM TABLE WHERE FIELD<?"),
99-
Arguments.of(
100-
"SELECT col1 AS col2 FROM users WHERE field=1234",
101-
"SELECT col1 AS col2 FROM users WHERE field=?"));
102-
}
94+
DbSpanDecorator decorator = new DbSpanDecorator("sql", "");
95+
96+
Exchange exchange = mock(Exchange.class);
97+
Message message = mock(Message.class);
98+
when(message.getHeader("CamelSqlQuery")).thenReturn(original);
99+
when(exchange.getIn()).thenReturn(message);
100+
101+
String actualSanitized = decorator.getStatement(exchange, null);
102+
assertThat(actualSanitized).isEqualTo(expected);
103103
}
104104
}

instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/DecoratorRegistry.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ private static Map<String, SpanDecorator> loadDecorators() {
3232
result.put("direct-vm", new InternalSpanDecorator());
3333
result.put("disruptor", new InternalSpanDecorator());
3434
result.put("disruptor-vm", new InternalSpanDecorator());
35-
result.put("elasticsearch", new DbSpanDecorator("elasticsearch", "elasticsearch"));
36-
result.put("opensearch", new DbSpanDecorator("opensearch", "opensearch"));
35+
result.put(
36+
"elasticsearch",
37+
new DbSpanDecorator(
38+
"elasticsearch", DbIncubatingAttributes.DbSystemIncubatingValues.ELASTICSEARCH));
39+
result.put(
40+
"opensearch",
41+
new DbSpanDecorator(
42+
"opensearch", DbIncubatingAttributes.DbSystemIncubatingValues.OPENSEARCH));
3743
result.put("http4", new Http4SpanDecorator());
3844
result.put("https4", new Https4SpanDecorator());
3945
result.put("http", new HttpSpanDecorator());

0 commit comments

Comments
 (0)