Skip to content

Commit 1a211cf

Browse files
moscherjernst
andauthored
Use java8 variant of apm-agent (#132651) (#136816)
This commit changes the apm-agent dependency to the java8 variant. The current dependency has a minimum java7 version, which restricts the dependency upgrades it can do. (cherry picked from commit c91871f) # Conflicts: # gradle/verification-metadata.xml # modules/apm/build.gradle Co-authored-by: Ryan Ernst <[email protected]>
1 parent 8639ddf commit 1a211cf

File tree

8 files changed

+12
-7
lines changed

8 files changed

+12
-7
lines changed

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/APMJvmOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static Path findAgentJar(String installDir) throws IOException, UserException {
369369

370370
try (var apmStream = Files.list(apmModule)) {
371371
final List<Path> paths = apmStream.filter(
372-
path -> path.getFileName().toString().matches("elastic-apm-agent-\\d+\\.\\d+\\.\\d+\\.jar")
372+
path -> path.getFileName().toString().matches("elastic-apm-agent-java8-\\d+\\.\\d+\\.\\d+\\.jar")
373373
).toList();
374374

375375
if (paths.size() > 1) {

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/APMJvmOptionsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private Path makeFakeAgentJar() throws IOException {
190190
Path tempFile = createTempFile();
191191
Path apmPathDir = tempFile.getParent().resolve("modules").resolve("apm");
192192
Files.createDirectories(apmPathDir);
193-
Path apmAgentFile = apmPathDir.resolve("elastic-apm-agent-0.0.0.jar");
193+
Path apmAgentFile = apmPathDir.resolve("elastic-apm-agent-java8-0.0.0.jar");
194194
Files.move(tempFile, apmAgentFile);
195195

196196
return tempFile.getParent();

docs/changelog/132651.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 132651
2+
summary: Use java8 variant of apm-agent
3+
area: Infra/Core
4+
type: upgrade
5+
issues: []

gradle/verification-metadata.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
<sha256 value="10fe288fd7a2cdaf5175332b73529f9abf8fd54dcfff317d6967c0c35ffb133b" origin="Generated by Gradle"/>
7373
</artifact>
7474
</component>
75-
<component group="co.elastic.apm" name="elastic-apm-agent" version="1.52.2">
76-
<artifact name="elastic-apm-agent-1.52.2.jar">
77-
<sha256 value="dee18355a06f66a425bd597d6447ccbe7e8b7a3c0667adb7b30da173e31044e0" origin="Generated by Gradle"/>
75+
<component group="co.elastic.apm" name="elastic-apm-agent-java8" version="1.55.0">
76+
<artifact name="elastic-apm-agent-java8-1.55.0.jar">
77+
<sha256 value="a4f3ae98e180dd5138cc8c719889366fe7d3afcecdb618da6db0b144a1717ac8" origin="Generated by Gradle"/>
7878
</artifact>
7979
</component>
8080
<component group="co.elastic.logging" name="ecs-logging-core" version="1.2.0">

modules/apm/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies {
2020
implementation "io.opentelemetry:opentelemetry-api:${otelVersion}"
2121
implementation "io.opentelemetry:opentelemetry-context:${otelVersion}"
2222
implementation "io.opentelemetry:opentelemetry-semconv:${otelSemconvVersion}"
23-
runtimeOnly "co.elastic.apm:elastic-apm-agent:1.52.2"
23+
runtimeOnly "co.elastic.apm:elastic-apm-agent-java8:1.55.0"
2424

2525
javaRestTestImplementation project(':modules:apm')
2626
javaRestTestImplementation project(':test:framework')

server/src/main/java/org/elasticsearch/node/Node.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static void deleteTemporaryApmConfig(JvmInfo jvmInfo, BiConsumer<Exceptio
235235
"\\" + File.separator,
236236
".*modules",
237237
"apm",
238-
"elastic-apm-agent-\\d+\\.\\d+\\.\\d+\\.jar"
238+
"elastic-apm-agent-java8-\\d+\\.\\d+\\.\\d+\\.jar"
239239
);
240240
if (parts[0].matches(APM_AGENT_CONFIG_FILE_REGEX)) {
241241
if (parts.length == 2 && parts[1].startsWith("c=")) {

0 commit comments

Comments
 (0)