Repository: quarkusio/quarkus
Issue: Jaeger tracing not working in native mode with "remote" sampler type

With a remote sampler, you get
```
Exception in thread "Timer-0" java.lang.RuntimeException: Unable to invoke no-args constructor for class io.jaegertracing.internal.samplers.http.SamplingStrategyResponse. Registering an InstanceCreator with Gson for this type may fix this problem.
	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:226)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:210)
	at com.google.gson.Gson.fromJson(Gson.java:888)
	at com.google.gson.Gson.fromJson(Gson.java:853)
	at com.google.gson.Gson.fromJson(Gson.java:802)
	at com.google.gson.Gson.fromJson(Gson.java:774)
	at io.jaegertracing.internal.samplers.HttpSamplingManager.parseJson(HttpSamplingManager.java:49)
	at io.jaegertracing.internal.samplers.HttpSamplingManager.getSamplingStrategy(HttpSamplingManager.java:68)
	at io.jaegertracing.internal.samplers.RemoteControlledSampler.updateSampler(RemoteControlledSampler.java:88)
	at io.jaegertracing.internal.samplers.RemoteControlledSampler$1.run(RemoteControlledSampler.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:556)
	at java.util.TimerThread.run(Timer.java:506)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:497)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.lang.IllegalArgumentException: Class io.jaegertracing.internal.samplers.http.SamplingStrategyResponse is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection
	at com.oracle.svm.core.genscavenge.graal.AllocationSnippets.checkDynamicHub(AllocationSnippets.java:153)
	at java.lang.reflect.Method.invoke(Method.java:566)
	at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:50)
	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:223)
	... 13 more
```

Changed files:
extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java

diff --git a/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java b/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java
index c49036d7b3f..ddb853661ae 100644
--- a/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java
+++ b/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java
@@ -13,6 +13,7 @@
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import io.quarkus.jaeger.runtime.JaegerBuildTimeConfig;
 import io.quarkus.jaeger.runtime.JaegerConfig;
 import io.quarkus.jaeger.runtime.JaegerDeploymentRecorder;
@@ -50,6 +51,15 @@ public void build(BuildProducer<FeatureBuildItem> feature) {
         feature.produce(new FeatureBuildItem(FeatureBuildItem.JAEGER));
     }
 
+    @BuildStep
+    public void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {
+        reflectiveClasses.produce(ReflectiveClassBuildItem
+                .builder("io.jaegertracing.internal.samplers.http.SamplingStrategyResponse",
+                        "io.jaegertracing.internal.samplers.http.ProbabilisticSamplingStrategy")
+                .finalFieldsWritable(true)
+                .build());
+    }
+
     private void produceMetrics(BuildProducer<MetricBuildItem> producer) {
         producer.produce(
                 metric("jaeger_tracer_baggage_restrictions_updates", MetricType.COUNTER, null, new Tag("result", "err")));