Skip to content

Commit bc14c86

Browse files
authored
Merge pull request #46553 from geoand/#46539
Introduce `url.scheme` tag into `http.server.active.requests` metric
2 parents 519f562 + 323a5db commit bc14c86

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.quarkus.micrometer.runtime.binder.HttpCommonTags;
2323
import io.quarkus.micrometer.runtime.export.exemplars.OpenTelemetryContextUnwrapper;
2424
import io.vertx.core.http.HttpMethod;
25+
import io.vertx.core.http.HttpServerOptions;
2526
import io.vertx.core.http.HttpServerRequest;
2627
import io.vertx.core.http.ServerWebSocket;
2728
import io.vertx.core.spi.metrics.HttpServerMetrics;
@@ -53,13 +54,14 @@ public class VertxHttpServerMetrics extends VertxTcpServerMetrics
5354

5455
VertxHttpServerMetrics(MeterRegistry registry,
5556
HttpBinderConfiguration config,
56-
OpenTelemetryContextUnwrapper openTelemetryContextUnwrapper) {
57+
OpenTelemetryContextUnwrapper openTelemetryContextUnwrapper, HttpServerOptions httpServerOptions) {
5758
super(registry, "http.server", null);
5859
this.config = config;
5960
this.openTelemetryContextUnwrapper = openTelemetryContextUnwrapper;
6061

6162
activeRequests = new LongAdder();
6263
Gauge.builder(config.getHttpServerActiveRequestsName(), activeRequests, LongAdder::doubleValue)
64+
.tag("url.scheme", httpServerOptions.isSsl() ? "https" : "http")
6365
.register(registry);
6466

6567
httpServerMetricsTagsContributors = resolveHttpServerMetricsTagsContributors();

extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterBinderAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public MetricsOptions newOptions() {
7979
}
8080
if (httpBinderConfiguration.isServerEnabled()) {
8181
log.debugf("Create HttpServerMetrics with options %s and address %s", options, localAddress);
82-
return new VertxHttpServerMetrics(Metrics.globalRegistry, httpBinderConfiguration, openTelemetryContextUnwrapper);
82+
return new VertxHttpServerMetrics(Metrics.globalRegistry, httpBinderConfiguration, openTelemetryContextUnwrapper,
83+
options);
8384
}
8485
return null;
8586
}

0 commit comments

Comments
 (0)