Skip to content

Commit ed4f298

Browse files
committed
Merge branch 'main' into servlet-async-context
2 parents 0de7f49 + 7dc73f0 commit ed4f298

File tree

289 files changed

+2326
-609
lines changed

Some content is hidden

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

289 files changed

+2326
-609
lines changed

.fossa.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,10 @@ targets:
426426
target: ':instrumentation:elasticsearch:elasticsearch-rest-7.0:library'
427427
- type: gradle
428428
path: ./
429-
target: ':instrumentation:elasticsearch:elasticsearch-rest-common:javaagent'
429+
target: ':instrumentation:elasticsearch:elasticsearch-rest-common-5.0:javaagent'
430430
- type: gradle
431431
path: ./
432-
target: ':instrumentation:elasticsearch:elasticsearch-rest-common:library'
432+
target: ':instrumentation:elasticsearch:elasticsearch-rest-common-5.0:library'
433433
- type: gradle
434434
path: ./
435435
target: ':instrumentation:elasticsearch:elasticsearch-transport-5.0:javaagent'
@@ -694,12 +694,6 @@ targets:
694694
- type: gradle
695695
path: ./
696696
target: ':instrumentation:netty:netty-3.8:javaagent'
697-
- type: gradle
698-
path: ./
699-
target: ':instrumentation:netty:netty-4-common:javaagent'
700-
- type: gradle
701-
path: ./
702-
target: ':instrumentation:netty:netty-4-common:library'
703697
- type: gradle
704698
path: ./
705699
target: ':instrumentation:netty:netty-4.0:javaagent'
@@ -712,6 +706,12 @@ targets:
712706
- type: gradle
713707
path: ./
714708
target: ':instrumentation:netty:netty-common:library'
709+
- type: gradle
710+
path: ./
711+
target: ':instrumentation:netty:netty-common-4.0:javaagent'
712+
- type: gradle
713+
path: ./
714+
target: ':instrumentation:netty:netty-common-4.0:library'
715715
- type: gradle
716716
path: ./
717717
target: ':instrumentation:okhttp:okhttp-2.2:javaagent'
@@ -895,6 +895,9 @@ targets:
895895
- type: gradle
896896
path: ./
897897
target: ':instrumentation:spring:spring-kafka-2.7:library'
898+
- type: gradle
899+
path: ./
900+
target: ':instrumentation:spring:spring-pulsar-1.0:javaagent'
898901
- type: gradle
899902
path: ./
900903
target: ':instrumentation:spring:spring-rabbit-1.0:javaagent'
@@ -1011,7 +1014,7 @@ targets:
10111014
target: ':instrumentation:kafka:kafka-clients:kafka-clients-2.6:library'
10121015
- type: gradle
10131016
path: ./
1014-
target: ':instrumentation:kafka:kafka-clients:kafka-clients-common:library'
1017+
target: ':instrumentation:kafka:kafka-clients:kafka-clients-common-0.11:library'
10151018
- type: gradle
10161019
path: ./
10171020
target: ':instrumentation:log4j:log4j-context-data:log4j-context-data-2.17:javaagent'
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash -e
2+
3+
# shellcheck disable=SC2001
4+
5+
for dir in $(find instrumentation -name "*.java" | grep library/src/main/java | sed 's#/[^/]*$##' | sort -u); do
6+
7+
module_name=$(echo "$dir" | sed 's#.*/\([^/]*\)/library/src/main/java/.*#\1#')
8+
9+
if [[ "$module_name" =~ java-* ]]; then
10+
continue
11+
fi
12+
if [[ "$module_name" == "jdbc" ]]; then
13+
continue
14+
fi
15+
if [[ "$module_name" == "jmx-metrics" ]]; then
16+
continue
17+
fi
18+
if [[ "$module_name" == "resources" ]]; then
19+
continue
20+
fi
21+
if [[ "$module_name" == "oshi" ]]; then
22+
continue
23+
fi
24+
25+
# these are possibly problematic
26+
if [[ "$dir" == "instrumentation/grpc-1.6/library/src/main/java/io/grpc/override" ]]; then
27+
continue
28+
fi
29+
if [[ "$dir" == "instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/lettuce/core/protocol" ]]; then
30+
continue
31+
fi
32+
33+
# some common modules don't have any base version
34+
# - lettuce-common
35+
# - netty-common
36+
if [[ ! "$module_name" =~ [0-9]$ && "$module_name" != "lettuce-common" && "$module_name" != "netty-common" ]]; then
37+
echo "module name doesn't have a base version: $dir"
38+
exit 1
39+
fi
40+
41+
simple_module_name=$(echo "$module_name" | sed 's/-[0-9.]*$//' | sed 's/-//g')
42+
base_version=$(echo "$module_name" | sed 's/.*-\([0-9.]*\)$/\1/' | sed 's/\./_/')
43+
44+
if [[ ! "$module_name" =~ [0-9]$ && "$module_name" != "lettuce-common" && "$module_name" != "netty-common" ]]; then
45+
expected_package_name="io/opentelemetry/instrumentation/$simple_module_name/v$base_version"
46+
else
47+
expected_package_name="io/opentelemetry/instrumentation/$simple_module_name"
48+
fi
49+
50+
package_name=$(echo "$dir" | sed 's#.*/src/main/java/##')
51+
52+
# deal with differences like module name elasticsearch-rest and package name elasticsearch.rest
53+
expected_package_name_normalized=$(echo "$expected_package_name" | sed 's#/##g')
54+
package_name_normalized=$(echo "$package_name" | sed 's#/##g')
55+
56+
if [[ "$package_name_normalized" != "$expected_package_name_normalized"* ]]; then
57+
echo "ERROR: $dir"
58+
exit 1
59+
fi
60+
61+
done
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
22

3-
grep -Pohr --include '*.java' --exclude-dir=test \"otel.instrumentation.[^\"]+\" \
3+
grep -Eohr --include '*.java' --exclude-dir="test*" \"otel.instrumentation.[^\"]+\" \
44
| grep -v otel.instrumentation.internal \
55
| sort -u

.github/workflows/build-common.yml

+7
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ jobs:
163163

164164
- run: .github/scripts/check-latest-dep-test-overrides.sh
165165

166+
check-package-names:
167+
runs-on: ubuntu-latest
168+
steps:
169+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
170+
171+
- run: .github/scripts/check-package-names.sh
172+
166173
build:
167174
runs-on: ubuntu-latest
168175
steps:

.github/workflows/reusable-native-tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ jobs:
1717
graalvm-native-tests:
1818
if: "!inputs.skip-native-tests"
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
test-java-version:
23+
- 22
24+
- 23
2025
steps:
2126
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2227
- id: read-java
2328
run: echo "version=$(cat .java-version)" >> "$GITHUB_OUTPUT"
2429
- uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3.1
2530
with:
2631
version: "latest"
27-
java-version: "${{ steps.read-java.outputs.version }}"
32+
java-version: ${{ matrix.test-java-version }}
2833
components: "native-image"
2934
- name: Running test
3035
env:

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- The `java.net.http.HttpClient` instrumentation package
88
`io.opentelemetry.instrumentation.httpclient` was deprecated in favor of the new package name
99
`io.opentelemetry.instrumentation.javahttpclient`
10+
- The class `io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel` was
11+
renamed to `io.opentelemetry.instrumentation.netty.common.v4_0.HttpRequestAndChannel`
1012

1113
## Version 2.13.3 (2025-02-28)
1214

dependencyManagement/build.gradle.kts

+1-1
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.47.0"
8+
val otelSdkVersion = "1.48.0"
99
val otelContribVersion = "1.44.0-alpha"
1010
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1111

docs/contributing/writing-instrumentation.md

+20
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,26 @@ All classes from the newly added bootstrap module will be loaded by the bootstra
402402
globally available within the JVM. **IMPORTANT: Note that you _cannot_ use any third-party libraries
403403
here, including the instrumented library - you can only use JDK and OpenTelemetry API classes.**
404404

405+
### Common Modules
406+
407+
When creating a common module shared among different instrumentations, the naming convention should
408+
include a version suffix that matches the major/minor version of the instrumented library specified
409+
in the common module's `build.gradle.kts`.
410+
411+
For example, if the common module's Gradle file contains the following dependency:
412+
413+
```kotlin
414+
dependencies {
415+
compileOnly("org.yarpc.client:rest:5.0.0")
416+
}
417+
```
418+
419+
Then the module should be named using the suffix `yarp-common-5.0`.
420+
421+
If the common module does not have a direct dependency on the instrumented library, no version
422+
suffix is required. Examples of such cases include modules named `lettuce-common` and
423+
`netty-common`.
424+
405425
## Writing Java agent unit tests
406426

407427
As mentioned before, tests in the `javaagent` module cannot access the javaagent instrumentation

docs/supported-libraries.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ These are the supported libraries and frameworks:
101101
| [Log4j 1](https://logging.apache.org/log4j/1.2/) | 1.2+ | N/A | none |
102102
| [Log4j 2](https://logging.apache.org/log4j/2.x/) | 2.11+ | [opentelemetry-log4j-appender-2.17](../instrumentation/log4j/log4j-appender-2.17/library),<br>[opentelemetry-log4j-context-data-2.17-autoconfigure](../instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure) | none |
103103
| [Logback](http://logback.qos.ch/) | 1.0+ | [opentelemetry-logback-appender-1.0](../instrumentation/logback/logback-appender-1.0/library),<br>[opentelemetry-logback-mdc-1.0](../instrumentation/logback/logback-mdc-1.0/library) | none |
104-
| [Micrometer](https://micrometer.io/) | 1.5+ | [opentelemetry-micrometer-1.5](../instrumentation/micrometer/micrometer-1.5/library) | none |
104+
| [Micrometer](https://micrometer.io/) | 1.5+ (disabled by default) | [opentelemetry-micrometer-1.5](../instrumentation/micrometer/micrometer-1.5/library) | none |
105105
| [MongoDB Driver](https://mongodb.github.io/mongo-java-driver/) | 3.1+ | [opentelemetry-mongo-3.1](../instrumentation/mongo/mongo-3.1/library) | [Database Client Spans], [Database Client Metrics]&nbsp;[6] |
106106
| [MyBatis](https://mybatis.org/mybatis-3/) | 3.2+ | N/A | none |
107107
| [Netty HTTP codec [5]](https://github.com/netty/netty) | 3.8+ | [opentelemetry-netty-4.1](../instrumentation/netty/netty-4.1/library) | [HTTP Client Spans], [HTTP Client Metrics], [HTTP Server Spans], [HTTP Server Metrics] |
@@ -138,6 +138,7 @@ These are the supported libraries and frameworks:
138138
| [Spring Integration](https://spring.io/projects/spring-integration) | 4.1+ (not including 6.0+ yet) | [opentelemetry-spring-integration-4.1](../instrumentation/spring/spring-integration-4.1/library) | [Messaging Spans] |
139139
| [Spring JMS](https://docs.spring.io/spring-framework/docs/current/reference/html/integration.html#jms) | 2.0+ | N/A | [Messaging Spans] |
140140
| [Spring Kafka](https://spring.io/projects/spring-kafka) | 2.7+ | [opentelemetry-spring-kafka-2.7](../instrumentation/spring/spring-kafka-2.7/library) | [Messaging Spans] |
141+
| [Spring Pulsar](https://spring.io/projects/spring-pulsar) | 1.0+ | | [Messaging Spans] |
141142
| [Spring RabbitMQ](https://spring.io/projects/spring-amqp) | 1.0+ | N/A | [Messaging Spans] |
142143
| [Spring RestTemplate](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/package-summary.html) | 3.1+ | [opentelemetry-spring-web-3.1](../instrumentation/spring/spring-web/spring-web-3.1/library) | [HTTP Client Spans], [HTTP Client Metrics] |
143144
| [Spring RMI](https://docs.spring.io/spring-framework/docs/4.0.x/javadoc-api/org/springframework/remoting/rmi/package-summary.html) | 4.0+ | N/A | [RPC Client Spans], [RPC Server Spans] |
@@ -229,12 +230,16 @@ These are the JVMs and operating systems that the integration tests are run agai
229230

230231
## Disabled instrumentations
231232

232-
Some instrumentations can produce too many spans and make traces very noisy.
233+
Some instrumentations can produce too many spans and metrics and thus create a lot of noise.
233234
For this reason, the following instrumentations are disabled by default:
234235

235236
- `jdbc-datasource` which creates spans whenever the `java.sql.DataSource#getConnection` method is called.
236237
- `dropwizard-metrics` which might create a very low quality metrics data, because of lack of label/attribute support
237238
in the Dropwizard metrics API.
239+
- `micrometer` which might create high number of metrics due to being broadly used in libraries.
238240

239241
To enable them, add the `otel.instrumentation.<name>.enabled` system property:
240-
`-Dotel.instrumentation.jdbc-datasource.enabled=true`
242+
243+
- `-Dotel.instrumentation.jdbc-datasource.enabled=true`
244+
- `-Dotel.instrumentation.dropwizard-metrics.enabled=true`
245+
- `-Dotel.instrumentation.micrometer.enabled=true`

examples/distro/build.gradle

+1-1
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.47.0",
30+
opentelemetrySdk : "1.48.0",
3131

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

examples/extension/build.gradle

+1-1
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.47.0",
26+
opentelemetrySdk : "1.48.0",
2727

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

0 commit comments

Comments
 (0)