instances) {
+ this.endOfServiceDiscovery = System.nanoTime();
+ if (instances != null) {
+ instanceCounter.increment(instances.size());
+ }
+
+ }
+
+ @Override
+ public void onServiceDiscoveryFailure(Throwable throwable) {
+ // Noop
+ }
+
+ @Override
+ public void onServiceSelectionSuccess(long id) {
+ // Noop
+ }
+
+ @Override
+ public void onServiceSelectionFailure(Throwable throwable) {
+ // Noop
+ }
+
+ };
+ return STORK_METRICS;
+ }
+
+}
diff --git a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/MicrometerConfig.java b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/MicrometerConfig.java
index 75042e33cf11d..7286227a22b23 100644
--- a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/MicrometerConfig.java
+++ b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/MicrometerConfig.java
@@ -99,6 +99,7 @@ public static class BinderConfig {
public KafkaConfigGroup kafka;
public RedisConfigGroup redis;
+ public StorkConfigGroup stork;
public GrpcServerConfigGroup grpcServer;
diff --git a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/StorkConfigGroup.java b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/StorkConfigGroup.java
new file mode 100644
index 0000000000000..cca42c194fbb2
--- /dev/null
+++ b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/config/StorkConfigGroup.java
@@ -0,0 +1,33 @@
+package io.quarkus.micrometer.runtime.config;
+
+import java.util.Optional;
+
+import io.quarkus.runtime.annotations.ConfigGroup;
+import io.quarkus.runtime.annotations.ConfigItem;
+
+@ConfigGroup
+public class StorkConfigGroup implements MicrometerConfig.CapabilityEnabled {
+ /**
+ * Stork metrics support.
+ *
+ * Support for Stork metrics will be enabled if Micrometer support is enabled,
+ * the Quarkus Stork extension is on the classpath
+ * and either this value is true, or this value is unset and
+ * {@code quarkus.micrometer.binder-enabled-default} is true.
+ */
+ @ConfigItem
+ public Optional enabled;
+
+ @Override
+ public Optional getEnabled() {
+ return enabled;
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName()
+ + "{enabled=" + enabled
+ + '}';
+ }
+
+}
diff --git a/extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/SmallRyeStorkRecorder.java b/extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/SmallRyeStorkRecorder.java
index dd82473fdac6c..4f362a4a416d2 100644
--- a/extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/SmallRyeStorkRecorder.java
+++ b/extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/SmallRyeStorkRecorder.java
@@ -2,11 +2,16 @@
import java.util.List;
+import jakarta.enterprise.inject.Instance;
+import jakarta.enterprise.inject.spi.CDI;
+
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.ShutdownContext;
import io.quarkus.runtime.annotations.Recorder;
import io.smallrye.stork.Stork;
import io.smallrye.stork.api.config.ServiceConfig;
+import io.smallrye.stork.api.observability.ObservationCollector;
+import io.smallrye.stork.integration.ObservableStorkInfrastructure;
import io.vertx.core.Vertx;
@Recorder
@@ -15,7 +20,13 @@ public class SmallRyeStorkRecorder {
public void initialize(ShutdownContext shutdown, RuntimeValue vertx, StorkConfiguration configuration) {
List serviceConfigs = StorkConfigUtil.toStorkServiceConfig(configuration);
StorkConfigProvider.init(serviceConfigs);
- Stork.initialize(new QuarkusStorkInfrastructure(vertx.getValue()));
+ Instance instance = CDI.current().select(ObservationCollector.class);
+ if (instance.isResolvable()) {
+ Stork.initialize(new ObservableStorkInfrastructure(instance.get()));
+ } else {
+ Stork.initialize(new QuarkusStorkInfrastructure(vertx.getValue()));
+ }
+
shutdown.addShutdownTask(new Runnable() {
@Override
public void run() {
diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml
index db702dcaf0ecc..c5dde41c214be 100644
--- a/independent-projects/resteasy-reactive/pom.xml
+++ b/independent-projects/resteasy-reactive/pom.xml
@@ -68,7 +68,7 @@
5.3.0
1.0.0.Final
2.15.2
- 2.3.1
+ 2.4.0-SNAPSHOT
3.0.2
3.0.3
3.0.0
diff --git a/integration-tests/rest-client-reactive-stork/pom.xml b/integration-tests/rest-client-reactive-stork/pom.xml
index 90f50aadf71f5..199f1fe2c302a 100644
--- a/integration-tests/rest-client-reactive-stork/pom.xml
+++ b/integration-tests/rest-client-reactive-stork/pom.xml
@@ -111,6 +111,19 @@