Skip to content

Commit b633b39

Browse files
committed
merge
2 parents 30b591a + 74c0683 commit b633b39

File tree

177 files changed

+3552
-3581
lines changed

Some content is hidden

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

177 files changed

+3552
-3581
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# this file exists so that Renovate can auto-update docker image versions that are then used elsewhere
22

3-
FROM lycheeverse/lychee:sha-2aa22f8@sha256:2e3786630482c41f9f2dd081e06d7da1c36d66996e8cf6573409b8bc418d48c4 AS lychee
3+
FROM lycheeverse/lychee:sha-8222559@sha256:6f49010cc46543af3b765f19d5319c0cdd4e8415d7596e1b401d5b4cec29c799 AS lychee

.github/workflows/documentation-synchronization-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Documentation Synchronization Audit (opentelemetry.io)
22

33
on:
44
schedule:
5-
- cron: "30 1 * * *" # daily at 1:30 UTC
5+
- cron: "30 1 * * 1" # every Monday at 1:30 UTC
66
workflow_dispatch:
77

88
permissions:

.github/workflows/overhead-benchmark-daily.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@ jobs:
2828
run: |
2929
rsync -avv gh-pages/benchmark-overhead/results/ benchmark-overhead/results/
3030
31+
- name: Set up JDK for running Gradle
32+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
33+
with:
34+
distribution: temurin
35+
java-version-file: .java-version
36+
3137
- name: Setup Gradle
3238
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
3339

40+
- name: Build Latest Snapshot JAR
41+
run: ./gradlew assemble -x javadoc
42+
3443
- name: Run tests
3544
working-directory: benchmark-overhead
3645
run: ./gradlew test
@@ -42,17 +51,15 @@ jobs:
4251
- name: Copy results back to gh-pages branch
4352
run: rsync -avv benchmark-overhead/results/ gh-pages/benchmark-overhead/results/ && rm -rf benchmark-overhead/results
4453

54+
- name: Use CLA approved bot
55+
run: .github/scripts/use-cla-approved-bot.sh
56+
4557
- name: Commit updated results
46-
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
47-
with:
48-
add: "benchmark-overhead/results"
49-
cwd: "./gh-pages"
50-
branch: "gh-pages"
51-
message: "update test result data"
52-
author_name: otelbot
53-
author_email: [email protected]
54-
committer_name: otelbot
55-
committer_email: [email protected]
58+
working-directory: ./gh-pages
59+
run: |
60+
git add benchmark-overhead/results
61+
git commit -m "update test result data"
62+
git push
5663
5764
workflow-notification:
5865
permissions:

.lychee.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ max_concurrency = 4
66
# Check link anchors
77
include_fragments = true
88

9+
remap = [
10+
# workaround for https://github.com/lycheeverse/lychee/issues/1729
11+
"https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4",
12+
"https://docs.oracle.com/(.*)#.*$ https://docs.oracle.com/$1"
13+
]
14+
915
# excluding links to pull requests and issues is done for performance
1016
# stackexchange link fails with 403 when accessed by lychee
1117
exclude = [
18+
# workaround for https://github.com/lycheeverse/lychee/issues/1729
19+
'^https://github.com/.*#issuecomment-.*$',
1220
'^https://github.com/open-telemetry/opentelemetry-java-instrumentation/(issues|pull)/\d+$',
1321
'^http://code.google.com/p/concurrentlinkedhashmap$',
1422
'^https://softwareengineering.stackexchange.com/questions/29727.*',

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
### 🌟 New javaagent instrumentation
370370

371371
- AWS Bedrock instrumentation, following
372-
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai#semantic-conventions-for-generative-ai-systems)
372+
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/README.md#semantic-conventions-for-generative-ai-systems)
373373
([#13355](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13355),
374374
[#13408](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13408),
375375
[#13473](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13473),
@@ -382,7 +382,7 @@
382382
### 🌟 New library instrumentation
383383

384384
- AWS Bedrock instrumentation, following
385-
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai#semantic-conventions-for-generative-ai-systems)
385+
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/README.md#semantic-conventions-for-generative-ai-systems)
386386
([#13355](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13355),
387387
[#13408](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13408),
388388
[#13473](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13473),

CONTRIBUTING.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,28 @@ See [Running the tests](./docs/contributing/running-tests.md) for more details.
1515

1616
### Snapshot builds
1717

18-
For developers testing code changes before a release is complete, there are
19-
snapshot builds of the `main` branch. They are available from
20-
the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`
21-
([browse](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/)).
18+
For developers testing code changes before a release is complete, snapshot builds of the `main`
19+
branch are available from the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`.
20+
21+
To find the latest snapshot, check the maven metadata (replace `{LATEST_VERSION}` with the current
22+
stable release):
23+
24+
```
25+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/{LATEST_VERSION}-SNAPSHOT/maven-metadata.xml
26+
```
27+
28+
Look for the `<timestamp>` and `<buildNumber>` in the XML response, then construct the download URL:
29+
30+
```
31+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/{VERSION}-SNAPSHOT/opentelemetry-javaagent-{VERSION}-{TIMESTAMP}-{BUILD_NUMBER}.jar
32+
```
33+
34+
For example, if the metadata shows timestamp `20250925.160708` and build number `56` for version
35+
`2.21.0`, the snapshot JAR URL would be:
36+
37+
```
38+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/2.21.0-SNAPSHOT/opentelemetry-javaagent-2.21.0-20250925.160708-56.jar
39+
```
2240

2341
### Building from source
2442

benchmark-overhead/src/test/java/io/opentelemetry/agents/LatestAgentSnapshotResolver.java

Lines changed: 51 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -5,115 +5,80 @@
55

66
package io.opentelemetry.agents;
77

8-
import static org.joox.JOOX.$;
9-
108
import java.io.IOException;
119
import java.nio.file.Files;
1210
import java.nio.file.Path;
1311
import java.nio.file.Paths;
14-
import java.nio.file.StandardOpenOption;
12+
import java.nio.file.StandardCopyOption;
1513
import java.util.Optional;
16-
import java.time.Duration;
17-
import okhttp3.OkHttpClient;
18-
import okhttp3.Request;
19-
import okhttp3.Response;
20-
import okhttp3.ResponseBody;
21-
import org.joox.Match;
2214
import org.slf4j.Logger;
2315
import org.slf4j.LoggerFactory;
24-
import org.w3c.dom.Document;
2516

2617
public class LatestAgentSnapshotResolver {
2718

2819
private static final Logger logger = LoggerFactory.getLogger(LatestAgentSnapshotResolver.class);
2920

30-
static final String BASE_URL =
31-
"https://oss.sonatype.org/content/repositories/snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent";
32-
static final String LATEST_SNAPSHOT_META = BASE_URL + "/maven-metadata.xml";
33-
34-
private static final OkHttpClient client = new OkHttpClient.Builder()
35-
.connectTimeout(Duration.ofMinutes(1))
36-
.readTimeout(Duration.ofMinutes(1))
37-
.build();
38-
3921
Optional<Path> resolve() throws IOException {
40-
String version = fetchLatestSnapshotVersion();
41-
logger.info("Latest snapshot version is {}", version);
42-
String latestFilename = fetchLatestFilename(version);
43-
String url = BASE_URL + "/" + version + "/" + latestFilename;
44-
byte[] jarBytes = fetchBodyBytesFrom(url);
45-
Path path = Paths.get(".", "opentelemetry-javaagent-SNAPSHOT.jar");
46-
Files.write(
47-
path,
48-
jarBytes,
49-
StandardOpenOption.CREATE,
50-
StandardOpenOption.WRITE,
51-
StandardOpenOption.TRUNCATE_EXISTING);
52-
return Optional.of(path);
53-
}
22+
Path localJavaagentPath = findLocalJavaagentJar();
5423

55-
private String fetchLatestFilename(String version) throws IOException {
56-
String url = BASE_URL + "/" + version + "/maven-metadata.xml";
57-
String body = fetchBodyStringFrom(url);
58-
Document document = $(body).document();
59-
Match match = $(document).xpath("/metadata/versioning/snapshotVersions/snapshotVersion");
60-
return match.get().stream()
61-
.filter(
62-
elem -> {
63-
Match classifierMatch = $(elem).child("classifier");
64-
String classifier = classifierMatch == null ? null : classifierMatch.content();
65-
String extension = $(elem).child("extension").content();
66-
return "jar".equals(extension) && (classifier == null);
67-
})
68-
.map(e -> $(e).child("value").content())
69-
.findFirst()
70-
.map(value -> "opentelemetry-javaagent-" + value + ".jar")
71-
.orElseThrow();
72-
}
24+
if (localJavaagentPath == null || !Files.exists(localJavaagentPath)) {
25+
throw new IOException("Local javaagent JAR not found. Please run './gradlew :javaagent:assemble' from the project root first.");
26+
}
7327

74-
private String fetchLatestSnapshotVersion() throws IOException {
75-
String url = LATEST_SNAPSHOT_META;
76-
String body = fetchBodyStringFrom(url);
77-
Document document = $(body).document();
78-
Match match = $(document).xpath("/metadata/versioning/latest");
79-
return match.get(0).getTextContent();
80-
}
28+
logger.info("Using local javaagent JAR: {}", localJavaagentPath);
8129

82-
private String fetchBodyStringFrom(String url) throws IOException {
83-
return fetchBodyFrom(url).string();
30+
Path targetPath = Paths.get(".", "opentelemetry-javaagent-SNAPSHOT.jar");
31+
Files.copy(localJavaagentPath, targetPath, StandardCopyOption.REPLACE_EXISTING);
32+
return Optional.of(targetPath);
8433
}
8534

86-
private byte[] fetchBodyBytesFrom(String url) throws IOException {
87-
return fetchBodyFrom(url).bytes();
88-
}
35+
private Path findLocalJavaagentJar() {
36+
Path relativePath = Paths.get("../javaagent/build/libs").toAbsolutePath().normalize();
37+
Path javaagentJar = findJavaagentJarInDirectory(relativePath);
8938

90-
// The sonatype repository can be very unreliable, so we retry a few times
91-
private ResponseBody fetchBodyFrom(String url) throws IOException {
92-
Request request = new Request.Builder().url(url).build();
93-
IOException lastException = null;
39+
if (javaagentJar != null) {
40+
return javaagentJar;
41+
}
9442

95-
for (int attempt = 0; attempt < 3; attempt++) {
96-
try {
97-
try (Response response = client.newCall(request).execute()) {
98-
if (!response.isSuccessful()) {
99-
throw new IOException("Unexpected HTTP code " + response.code() + " for " + url);
100-
}
101-
ResponseBody body = response.body();
102-
if (body != null) {
103-
byte[] data = body.bytes();
104-
return ResponseBody.create(data, body.contentType());
105-
} else {
106-
throw new IOException("Response body is null");
107-
}
108-
}
109-
} catch (IOException e) {
110-
lastException = e;
111-
if (attempt < 2) {
112-
logger.warn("Attempt {} to fetch {} failed: {}. Retrying...", attempt + 1, url, e.getMessage());
43+
// If not found, try from the project root (in case running from different location)
44+
Path projectRoot = Paths.get(".").toAbsolutePath().normalize();
45+
while (projectRoot.getParent() != null) {
46+
Path gradlewFile = projectRoot.resolve("gradlew");
47+
if (Files.exists(gradlewFile)) {
48+
// Found the project root
49+
Path javaagentLibsDir = projectRoot.resolve("javaagent/build/libs");
50+
javaagentJar = findJavaagentJarInDirectory(javaagentLibsDir);
51+
if (javaagentJar != null) {
52+
return javaagentJar;
11353
}
54+
break;
11455
}
56+
projectRoot = projectRoot.getParent();
57+
}
58+
59+
return null;
60+
}
61+
62+
private Path findJavaagentJarInDirectory(Path directory) {
63+
if (!Files.exists(directory) || !Files.isDirectory(directory)) {
64+
return null;
65+
}
66+
67+
try {
68+
return Files.list(directory)
69+
.filter(path -> {
70+
String filename = path.getFileName().toString();
71+
// Look for the main jar: opentelemetry-javaagent-VERSION.jar (no additional suffixes)
72+
return filename.startsWith("opentelemetry-javaagent-") &&
73+
filename.endsWith(".jar") &&
74+
!filename.matches(".*-[a-z]+\\.jar"); // excludes anything with -word.jar pattern
75+
})
76+
.findFirst()
77+
.orElse(null);
78+
} catch (IOException e) {
79+
logger.warn("Failed to list files in directory {}: {}", directory, e.getMessage());
80+
return null;
11581
}
116-
throw lastException;
11782
}
11883
}
11984

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies {
5656
// When updating, update above in plugins too
5757
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.0.0")
5858
implementation("com.google.guava:guava:33.5.0-jre")
59-
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.2.1")
59+
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.2.2")
6060
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6161
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2")
6262
implementation("org.owasp:dependency-check-gradle:12.1.6")

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ nullaway {
1818

1919
tasks {
2020
withType<JavaCompile>().configureEach {
21-
if (name.contains("test", ignoreCase = true)) {
22-
options.errorprone.nullaway {
23-
enabled = false
24-
}
25-
} else {
26-
options.errorprone.nullaway {
27-
severity.set(CheckSeverity.ERROR)
28-
}
29-
}
3021
options.errorprone.nullaway {
22+
if (name.contains("test", ignoreCase = true)) {
23+
disable()
24+
} else {
25+
error()
26+
}
3127
customInitializerAnnotations.add("org.openjdk.jmh.annotations.Setup")
3228
excludedFieldAnnotations.add("org.mockito.Mock")
3329
excludedFieldAnnotations.add("org.mockito.InjectMocks")
3430
}
3531
}
3632
}
33+

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ data class DependencySet(val group: String, val version: String, val modules: Li
66

77
// this line is managed by .github/scripts/update-sdk-version.sh
88
val otelSdkVersion = "1.54.1"
9-
val otelContribVersion = "1.49.0-alpha"
9+
val otelContribVersion = "1.50.0-alpha"
1010
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1111

1212
// Need both BOM and groovy jars

0 commit comments

Comments
 (0)