Skip to content

Commit 2e73f4d

Browse files
otelbot[bot]trask
andauthored
Update pinned latest dep versions (#18478)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
1 parent 4393e74 commit 2e73f4d

4 files changed

Lines changed: 72 additions & 54 deletions

File tree

.github/config/latest-dep-versions.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"com.github.etaty:rediscala_2.11#+": "1.9.0",
4242
"com.github.etaty:rediscala_2.12#+": "1.9.0",
4343
"com.github.etaty:rediscala_2.13#+": "1.9.0",
44-
"com.github.oshi:oshi-core#+": "6.12.0",
44+
"com.github.oshi:oshi-core#+": "7.0.0",
4545
"com.google.guava:guava#+": "33.6.0-jre",
4646
"com.google.gwt:gwt-servlet#+": "2.10.0",
4747
"com.google.http-client:google-http-client#+": "2.1.0",
@@ -64,9 +64,9 @@
6464
"com.oracle.database.jdbc:ojdbc8#+": "23.26.1.0.0",
6565
"com.oracle.database.jdbc:ucp#+": "23.26.1.0.0",
6666
"com.rabbitmq:amqp-client#+": "5.30.0",
67-
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12#+": "1.13.17",
68-
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.13#+": "1.13.17",
69-
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_3#+": "1.13.17",
67+
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.12#+": "1.13.18",
68+
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.13#+": "1.13.18",
69+
"com.softwaremill.sttp.tapir:tapir-pekko-http-server_3#+": "1.13.18",
7070
"com.sparkjava:spark-core#+": "2.9.4",
7171
"com.squareup.okhttp3:okhttp#+": "5.3.2",
7272
"com.squareup.okhttp:okhttp#+": "2.7.5",
@@ -135,11 +135,11 @@
135135
"io.dropwizard:dropwizard-client#+": "5.0.1",
136136
"io.dropwizard:dropwizard-views#+": "5.0.1",
137137
"io.github.rediscala:rediscala_2.13#+": "1.17.0",
138-
"io.grpc:grpc-core#+": "1.80.0",
139-
"io.grpc:grpc-netty#+": "1.80.0",
140-
"io.grpc:grpc-protobuf#+": "1.80.0",
141-
"io.grpc:grpc-services#+": "1.80.0",
142-
"io.grpc:grpc-stub#+": "1.80.0",
138+
"io.grpc:grpc-core#+": "1.81.0",
139+
"io.grpc:grpc-netty#+": "1.81.0",
140+
"io.grpc:grpc-protobuf#+": "1.81.0",
141+
"io.grpc:grpc-services#+": "1.81.0",
142+
"io.grpc:grpc-stub#+": "1.81.0",
143143
"io.helidon.webserver:helidon-webserver#+": "4.4.1",
144144
"io.javalin:javalin#+": "7.2.0",
145145
"io.javalin:javalin#6.+": "6.7.0",
@@ -184,7 +184,7 @@
184184
"io.projectreactor:reactor-test#+": "3.8.5",
185185
"io.quarkus.platform:quarkus-bom#3.5.+": "3.5.3",
186186
"io.quarkus.platform:quarkus-bom#3.9.+": "3.9.5",
187-
"io.quarkus:quarkus-rest#+": "3.35.0",
187+
"io.quarkus:quarkus-rest#+": "3.35.1",
188188
"io.quarkus:quarkus-resteasy-reactive#+": "3.15.7",
189189
"io.r2dbc:r2dbc-spi#+": "1.0.0.RELEASE",
190190
"io.ratpack:ratpack-core#+": "1.9.0",
@@ -346,7 +346,7 @@
346346
"org.eclipse.jetty:jetty-servlet#10.+": "10.0.26",
347347
"org.eclipse.jetty:jetty-servlet#7.+": "7.6.21.v20160908",
348348
"org.eclipse.jetty:jetty-webapp#10.+": "10.0.26",
349-
"org.elasticsearch.client:elasticsearch-rest-client#+": "9.3.3",
349+
"org.elasticsearch.client:elasticsearch-rest-client#+": "9.3.4",
350350
"org.elasticsearch.client:elasticsearch-rest-client#6.+": "6.8.23",
351351
"org.elasticsearch.client:elasticsearch-rest-client#6.3.+": "6.3.2",
352352
"org.elasticsearch.client:rest#+": "5.5.3",
@@ -361,7 +361,7 @@
361361
"org.elasticsearch.plugin:transport-netty4-client#+": "7.17.29",
362362
"org.elasticsearch.plugin:transport-netty4-client#6.+": "6.8.23",
363363
"org.elasticsearch.plugin:transport-netty4-client#6.4.+": "6.4.3",
364-
"org.elasticsearch:elasticsearch#+": "9.3.3",
364+
"org.elasticsearch:elasticsearch#+": "9.3.4",
365365
"org.glassfish.grizzly:grizzly-http#+": "5.0.1",
366366
"org.glassfish.grizzly:grizzly-http#4.+": "4.0.2",
367367
"org.glassfish.grizzly:grizzly-http-server#4.+": "4.0.2",
@@ -373,7 +373,7 @@
373373
"org.glassfish.jersey.core:jersey-server#2.+": "2.48",
374374
"org.glassfish.jersey.inject:jersey-hk2#+": "4.0.2",
375375
"org.glassfish.jersey.inject:jersey-hk2#2.+": "2.48",
376-
"org.glassfish:jakarta.faces#+": "4.1.7",
376+
"org.glassfish:jakarta.faces#+": "4.1.8",
377377
"org.glassfish:jakarta.faces#3.+": "3.0.5",
378378
"org.glassfish:javax.faces#+": "2.4.0",
379379
"org.glassfish:javax.faces#2.+": "2.4.0",
@@ -414,9 +414,9 @@
414414
"org.jodd:jodd-http#+": "6.3.0",
415415
"org.mongodb:mongo-java-driver#+": "3.12.14",
416416
"org.mongodb:mongodb-driver-async#+": "3.12.14",
417-
"org.mongodb:mongodb-driver-core#+": "5.6.5",
418-
"org.mongodb:mongodb-driver-reactivestreams#+": "5.6.5",
419-
"org.mongodb:mongodb-driver-sync#+": "5.6.5",
417+
"org.mongodb:mongodb-driver-core#+": "5.7.0",
418+
"org.mongodb:mongodb-driver-reactivestreams#+": "5.7.0",
419+
"org.mongodb:mongodb-driver-sync#+": "5.7.0",
420420
"org.mybatis:mybatis#+": "3.5.19",
421421
"org.opensearch.client:opensearch-java#+": "3.8.0",
422422
"org.opensearch.client:opensearch-rest-client#+": "3.6.0",
@@ -527,20 +527,20 @@
527527
"redis.clients:jedis#2.+": "2.10.2",
528528
"redis.clients:jedis#3.+": "3.10.0",
529529
"software.amazon.awssdk.crt:aws-crt#+": "0.45.2",
530-
"software.amazon.awssdk:aws-core#+": "2.43.1",
531-
"software.amazon.awssdk:aws-json-protocol#+": "2.43.1",
532-
"software.amazon.awssdk:bedrockruntime#+": "2.43.1",
533-
"software.amazon.awssdk:dynamodb#+": "2.43.1",
534-
"software.amazon.awssdk:ec2#+": "2.43.1",
535-
"software.amazon.awssdk:kinesis#+": "2.43.1",
536-
"software.amazon.awssdk:lambda#+": "2.43.1",
537-
"software.amazon.awssdk:rds#+": "2.43.1",
538-
"software.amazon.awssdk:s3#+": "2.43.0",
539-
"software.amazon.awssdk:secretsmanager#+": "2.43.1",
540-
"software.amazon.awssdk:ses#+": "2.43.1",
541-
"software.amazon.awssdk:sfn#+": "2.43.1",
542-
"software.amazon.awssdk:sns#+": "2.43.1",
543-
"software.amazon.awssdk:sqs#+": "2.43.1",
530+
"software.amazon.awssdk:aws-core#+": "2.43.2",
531+
"software.amazon.awssdk:aws-json-protocol#+": "2.43.2",
532+
"software.amazon.awssdk:bedrockruntime#+": "2.43.2",
533+
"software.amazon.awssdk:dynamodb#+": "2.43.2",
534+
"software.amazon.awssdk:ec2#+": "2.43.2",
535+
"software.amazon.awssdk:kinesis#+": "2.43.2",
536+
"software.amazon.awssdk:lambda#+": "2.43.2",
537+
"software.amazon.awssdk:rds#+": "2.43.2",
538+
"software.amazon.awssdk:s3#+": "2.43.2",
539+
"software.amazon.awssdk:secretsmanager#+": "2.43.2",
540+
"software.amazon.awssdk:ses#+": "2.43.2",
541+
"software.amazon.awssdk:sfn#+": "2.43.2",
542+
"software.amazon.awssdk:sns#+": "2.43.2",
543+
"software.amazon.awssdk:sqs#+": "2.43.2",
544544
"tech.powerjob:powerjob-official-processors#+": "5.1.2",
545545
"tech.powerjob:powerjob-worker#+": "5.1.2"
546546
}

instrumentation/oshi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/oshi/OshiMetricsInstaller.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import io.opentelemetry.javaagent.extension.AgentListener;
1010
import io.opentelemetry.javaagent.extension.instrumentation.internal.AgentDistributionConfig;
1111
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
12-
import java.lang.reflect.Method;
1312

1413
/**
1514
* An {@link AgentListener} that enables oshi metrics during agent startup if oshi is present on the
@@ -26,24 +25,15 @@ public void afterAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredSdk) {
2625
}
2726

2827
try {
29-
// Call oshi.SystemInfo.getCurrentPlatformEnum() to activate SystemMetrics.
28+
// Instantiate oshi.SystemInfo to activate SystemMetrics.
3029
// Oshi instrumentation will intercept this call and enable SystemMetrics.
30+
// (The static getCurrentPlatformEnum()/getCurrentPlatform() entry points used in older
31+
// versions were both removed in oshi 7.0.0.)
3132
Class<?> oshiSystemInfoClass =
3233
ClassLoader.getSystemClassLoader().loadClass("oshi.SystemInfo");
33-
Method getCurrentPlatformEnumMethod = getCurrentPlatformMethod(oshiSystemInfoClass);
34-
getCurrentPlatformEnumMethod.invoke(null);
35-
} catch (Throwable ignored) {
34+
oshiSystemInfoClass.getConstructor().newInstance();
35+
} catch (Throwable t) {
3636
// OK
3737
}
3838
}
39-
40-
private static Method getCurrentPlatformMethod(Class<?> oshiSystemInfoClass)
41-
throws NoSuchMethodException {
42-
try {
43-
return oshiSystemInfoClass.getMethod("getCurrentPlatformEnum");
44-
} catch (NoSuchMethodException ignored) {
45-
// renamed in oshi 6.0.0
46-
return oshiSystemInfoClass.getMethod("getCurrentPlatform");
47-
}
48-
}
4939
}

instrumentation/oshi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/oshi/SystemInfoInstrumentation.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
package io.opentelemetry.javaagent.instrumentation.oshi;
77

8-
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
9-
import static net.bytebuddy.matcher.ElementMatchers.isStatic;
8+
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
109
import static net.bytebuddy.matcher.ElementMatchers.named;
11-
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
10+
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
1211

1312
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1413
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
@@ -24,16 +23,18 @@ public ElementMatcher<TypeDescription> typeMatcher() {
2423

2524
@Override
2625
public void transform(TypeTransformer transformer) {
26+
// Instrument the no-arg constructor: prior versions exposed static
27+
// getCurrentPlatformEnum()/getCurrentPlatform() entry points, but oshi 7.0.0 removed both, so
28+
// we trigger registration on instantiation instead (works across all supported versions).
2729
transformer.applyAdviceToMethod(
28-
isPublic().and(isStatic()).and(namedOneOf("getCurrentPlatformEnum", "getCurrentPlatform")),
29-
getClass().getName() + "$GetCurrentPlatformEnumAdvice");
30+
isConstructor().and(takesArguments(0)), getClass().getName() + "$ConstructAdvice");
3031
}
3132

3233
@SuppressWarnings("unused")
33-
public static class GetCurrentPlatformEnumAdvice {
34+
public static class ConstructAdvice {
3435

35-
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
36-
public static void onEnter() {
36+
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
37+
public static void onExit() {
3738
MetricsRegistration.register();
3839
}
3940
}

instrumentation/oshi/library/src/main/java/io/opentelemetry/instrumentation/oshi/ProcessMetrics.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.opentelemetry.api.common.AttributeKey;
1010
import io.opentelemetry.api.common.Attributes;
1111
import io.opentelemetry.api.metrics.Meter;
12+
import java.lang.reflect.Method;
1213
import java.util.ArrayList;
1314
import java.util.List;
1415
import oshi.SystemInfo;
@@ -19,6 +20,32 @@
1920
public final class ProcessMetrics {
2021
private static final AttributeKey<String> TYPE_KEY = AttributeKey.stringKey("type");
2122

23+
// getResidentSetSize() was deprecated in oshi 6.11.0 and removed in 7.0.0; the replacement
24+
// getResidentMemory() was added in 6.11.0.
25+
private static final Method RESIDENT_MEMORY_METHOD = findResidentMemoryMethod();
26+
27+
private static Method findResidentMemoryMethod() {
28+
for (String name : new String[] {"getResidentMemory", "getResidentSetSize"}) {
29+
try {
30+
return OSProcess.class.getMethod(name);
31+
} catch (NoSuchMethodException e) {
32+
// try next
33+
}
34+
}
35+
return null;
36+
}
37+
38+
private static long getResidentMemory(OSProcess process) {
39+
if (RESIDENT_MEMORY_METHOD == null) {
40+
return 0;
41+
}
42+
try {
43+
return (long) RESIDENT_MEMORY_METHOD.invoke(process);
44+
} catch (ReflectiveOperationException e) {
45+
return 0;
46+
}
47+
}
48+
2249
/** Register observers for java runtime metrics. */
2350
public static List<AutoCloseable> registerObservers(OpenTelemetry openTelemetry) {
2451
Meter meter = openTelemetry.getMeterProvider().get("io.opentelemetry.oshi");
@@ -34,7 +61,7 @@ public static List<AutoCloseable> registerObservers(OpenTelemetry openTelemetry)
3461
.buildWithCallback(
3562
r -> {
3663
processInfo.updateAttributes();
37-
r.record(processInfo.getResidentSetSize(), Attributes.of(TYPE_KEY, "rss"));
64+
r.record(getResidentMemory(processInfo), Attributes.of(TYPE_KEY, "rss"));
3865
r.record(processInfo.getVirtualSize(), Attributes.of(TYPE_KEY, "vms"));
3966
}));
4067

0 commit comments

Comments
 (0)