Skip to content

Commit c91871f

Browse files
authored
Use java8 variant of apm-agent (#132651)
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.
1 parent bfefe03 commit c91871f

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
@@ -329,7 +329,7 @@ static Path findAgentJar(String installDir) throws IOException, UserException {
329329

330330
try (var apmStream = Files.list(apmModule)) {
331331
final List<Path> paths = apmStream.filter(
332-
path -> path.getFileName().toString().matches("elastic-apm-agent-\\d+\\.\\d+\\.\\d+\\.jar")
332+
path -> path.getFileName().toString().matches("elastic-apm-agent-java8-\\d+\\.\\d+\\.\\d+\\.jar")
333333
).toList();
334334

335335
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
@@ -141,7 +141,7 @@ private Path makeFakeAgentJar() throws IOException {
141141
Path tempFile = createTempFile();
142142
Path apmPathDir = tempFile.getParent().resolve("modules").resolve("apm");
143143
Files.createDirectories(apmPathDir);
144-
Path apmAgentFile = apmPathDir.resolve("elastic-apm-agent-0.0.0.jar");
144+
Path apmAgentFile = apmPathDir.resolve("elastic-apm-agent-java8-0.0.0.jar");
145145
Files.move(tempFile, apmAgentFile);
146146

147147
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
@@ -76,9 +76,9 @@
7676
<sha256 value="10fe288fd7a2cdaf5175332b73529f9abf8fd54dcfff317d6967c0c35ffb133b" origin="Generated by Gradle"/>
7777
</artifact>
7878
</component>
79-
<component group="co.elastic.apm" name="elastic-apm-agent" version="1.55.0">
80-
<artifact name="elastic-apm-agent-1.55.0.jar">
81-
<sha256 value="3cbba96a64593c14568399dbc816fc36a5647e39449e1d4cf1eedce9880a9d3e" origin="Generated by Gradle"/>
79+
<component group="co.elastic.apm" name="elastic-apm-agent-java8" version="1.55.0">
80+
<artifact name="elastic-apm-agent-java8-1.55.0.jar">
81+
<sha256 value="a4f3ae98e180dd5138cc8c719889366fe7d3afcecdb618da6db0b144a1717ac8" origin="Generated by Gradle"/>
8282
</artifact>
8383
</component>
8484
<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.55.0"
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
@@ -219,7 +219,7 @@ public static void deleteTemporaryApmConfig(JvmInfo jvmInfo, BiConsumer<Exceptio
219219
"\\" + File.separator,
220220
".*modules",
221221
"apm",
222-
"elastic-apm-agent-\\d+\\.\\d+\\.\\d+\\.jar"
222+
"elastic-apm-agent-java8-\\d+\\.\\d+\\.\\d+\\.jar"
223223
);
224224
if (parts[0].matches(APM_AGENT_CONFIG_FILE_REGEX)) {
225225
if (parts.length == 2 && parts[1].startsWith("c=")) {

0 commit comments

Comments
 (0)