File tree 3 files changed +22
-5
lines changed
runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17
spring/spring-boot-autoconfigure/src/main
javaSpring3/io/opentelemetry/instrumentation/spring/autoconfigure/internal/instrumentation/runtimemetrics
resources/META-INF/spring
3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -136,11 +136,6 @@ CountDownLatch getStartUpLatch() {
136
136
}
137
137
138
138
private static boolean isJfrAvailable () {
139
- if (System .getProperty ("org.graalvm.nativeimage.imagecode" ) != null ) {
140
- // GraalVM native image does not support JFR
141
- return false ;
142
- }
143
-
144
139
try {
145
140
Class .forName ("jdk.jfr.FlightRecorder" );
146
141
// UnsatisfiedLinkError or ClassNotFoundException
Original file line number Diff line number Diff line change
1
+ package io .opentelemetry .instrumentation .spring .autoconfigure .internal .instrumentation .runtimemetrics ;
2
+
3
+ import org .springframework .beans .factory .aot .BeanRegistrationExcludeFilter ;
4
+ import org .springframework .beans .factory .support .RegisteredBean ;
5
+
6
+ /**
7
+ * Configures runtime metrics collection for Java 17+.
8
+ *
9
+ * <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
10
+ * at any time.
11
+ */
12
+ public class RuntimeMetricsBeanRegistrationExcludeFilter implements BeanRegistrationExcludeFilter {
13
+ @ Override
14
+ public boolean isExcludedFromAotProcessing (RegisteredBean registeredBean ) {
15
+ // GraalVM native image does not support JFR, so we exclude Java 17+ runtime metrics provider
16
+ return "io.opentelemetry.instrumentation.spring.autoconfigure.internal.instrumentation.runtimemetrics.Java17RuntimeMetricsProvider"
17
+ .equals (registeredBean .getBeanName ());
18
+ }
19
+ }
Original file line number Diff line number Diff line change 1
1
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2
2
io.opentelemetry.instrumentation.spring.autoconfigure.internal.instrumentation.annotations.OpenTelemetryAnnotationsRuntimeHints
3
+
4
+ org.springframework.beans.factory.aot.BeanRegistrationExcludeFilter=\
5
+ io.opentelemetry.instrumentation.spring.autoconfigure.internal.instrumentation.runtimemetrics.RuntimeMetricsBeanRegistrationExcludeFilter
You can’t perform that action at this time.
0 commit comments