From 123527672416088322e9ed664c1834b341bf2a44 Mon Sep 17 00:00:00 2001 From: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Date: Tue, 8 Feb 2022 21:08:28 +0900 Subject: [PATCH] Native image reflection config for HdrHistogram usage Our client-side percentiles use HdrHistogram as an implementation detail. That library uses some reflection that fails at runtime in a native image without this reflection config. Ideally, the HdrHistogram library would work in native images out-of-the-box by, for example, having this reflection config in its published JAR. In the meantime, we will add the necessary config to Micrometer to provide a better experience for our users compiling to native images and using client-side percentiles. With this, users should not need to add any configuration or hints themselves to use Micrometer in their native image applications. Resolves gh-3002 --- .../io.micrometer/micrometer-core/reflect-config.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json b/micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json index a55a083667..96ccfd3875 100644 --- a/micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json +++ b/micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json @@ -12,5 +12,13 @@ {"name":"getMaxFileDescriptorCount","parameterTypes":[] }, {"name":"getOpenFileDescriptorCount","parameterTypes":[] } ] + }, + { + "name":"org.HdrHistogram.ConcurrentHistogram", + "methods":[{"name":"","parameterTypes":["long","long","int"] }] + }, + { + "name":"org.HdrHistogram.Histogram", + "methods":[{"name":"","parameterTypes":["long","long","int"] }] } ]