Skip to content

Commit

Permalink
Merge pull request quarkusio#46553 from geoand/quarkusio#46539
Browse files Browse the repository at this point in the history
Introduce `url.scheme` tag into `http.server.active.requests` metric
  • Loading branch information
brunobat authored Feb 28, 2025
2 parents 519f562 + 323a5db commit bc14c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.quarkus.micrometer.runtime.binder.HttpCommonTags;
import io.quarkus.micrometer.runtime.export.exemplars.OpenTelemetryContextUnwrapper;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.http.ServerWebSocket;
import io.vertx.core.spi.metrics.HttpServerMetrics;
Expand Down Expand Up @@ -53,13 +54,14 @@ public class VertxHttpServerMetrics extends VertxTcpServerMetrics

VertxHttpServerMetrics(MeterRegistry registry,
HttpBinderConfiguration config,
OpenTelemetryContextUnwrapper openTelemetryContextUnwrapper) {
OpenTelemetryContextUnwrapper openTelemetryContextUnwrapper, HttpServerOptions httpServerOptions) {
super(registry, "http.server", null);
this.config = config;
this.openTelemetryContextUnwrapper = openTelemetryContextUnwrapper;

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

httpServerMetricsTagsContributors = resolveHttpServerMetricsTagsContributors();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public MetricsOptions newOptions() {
}
if (httpBinderConfiguration.isServerEnabled()) {
log.debugf("Create HttpServerMetrics with options %s and address %s", options, localAddress);
return new VertxHttpServerMetrics(Metrics.globalRegistry, httpBinderConfiguration, openTelemetryContextUnwrapper);
return new VertxHttpServerMetrics(Metrics.globalRegistry, httpBinderConfiguration, openTelemetryContextUnwrapper,
options);
}
return null;
}
Expand Down

0 comments on commit bc14c86

Please sign in to comment.