fix: avoid protobuf debug reflection in native images#2251
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
|
how do we know this fixes the graal specific issue? were you able to reproduce it? your PR description also says "Note: Docker/Testcontainers exporter integration test was not run locally because Docker Desktop’s Linux engine was not running." which i think is just something you and your local llm need to sort out? |
I'll try to find a solution to this and give you a reproducable steps or results. |
017c5e3 to
d4afe3d
Compare
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
d4afe3d to
8178cff
Compare
|
@jaydeluca I reproduced the GraalVM native-image debug protobuf issue on Windows without Docker. Environment:
Important: run Before, on
Result on After, on
Result on fix branch: Attaching the tool(native-debug-repro.zip) I used for the above test. Seeking your re-review. |
Summary
Fixes #1995.
This PR avoids GraalVM native-image failures when using the protobuf debug exposition format with native histograms. The debug output path now formats protobuf metric families through direct generated protobuf getters instead of
TextFormat.printer(), which relied on reflection unavailable in native images.Changes
PrometheusProtobufWriterImpl#toDebugString(...)to use the new formatter.Testing
mise run lint:fix./mvnw.cmd -pl prometheus-metrics-exposition-formats test -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn./mvnw.cmd -pl prometheus-metrics-exposition-formats-shaded -am install -DskipTests -Dcoverage.skip=true