opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

Fix native mode error cause by static init of random

Open brunobat opened this issue 2 years ago • 2 comments

Description:

Native build fails because AwsXrayRemoteSampler.java statically inits a Random() This is not allowed, as explained here: https://foivos.zakkak.net/tutorials/working-with-randoms-native-images/

See discussion here: https://github.com/quarkusio/quarkus/discussions/33154

brunobat avatar May 08 '23 15:05 brunobat

is it possible to add a native test (e.g. similar to open-telemetry/opentelemetry-java-instrumentation#8163) to prevent regressions on this?

This would require a build step that builds a native app with graalvm and then run tests against it. With Quarkus this is easy, but for a standalone lib like this, it would require research. Do you remember if we already have any native tests somewhere?

brunobat avatar May 09 '23 08:05 brunobat

Do you remember if we already have any native tests somewhere?

check out https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/8163

trask avatar May 10 '23 14:05 trask