Repository navigation
Description
Is your feature request related to a problem? Please describe.
Armeria already records HTTP metrics for every API endpoint under the http.server prefix:
unitycatalog/server/src/main/java/io/unitycatalog/server/ArmeriaServerBuilder.java
Lines 282 to 287 in 2f41e34
| ArmeriaServerBuilder meterRegistry(MeterRegistry meterRegistry) { | |
| armeriaServerBuilder.meterRegistry(meterRegistry); | |
| apiVirtualHost.decorator( | |
| MetricCollectingService.newDecorator(MeterIdPrefixFunction.ofDefault("http.server"))); | |
| return this; | |
| } |
The registry then drops every http.server.* meter except the request counter:
unitycatalog/server/src/main/java/io/unitycatalog/server/observability/MetricsRegistries.java
Lines 54 to 62 in 2f41e34
| public static PrometheusMetrics createPrometheus() { | |
| PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT); | |
| Predicate<Meter.Id> httpRequestCounter = id -> id.getName().equals("http.server.requests"); | |
| registry | |
| .config() | |
| .meterFilter( | |
| MeterFilter.deny( | |
| id -> id.getName().startsWith("http.server.") && !httpRequestCounter.test(id))) | |
| .meterFilter(MeterFilter.forMeters(httpRequestCounter, MeterFilter.ignoreTags("result"))); |
The docs say so:
unitycatalog/docs/server/observability.md
Lines 107 to 109 in 2f41e34
| Within the `http_server_*` family, only `http_server_requests_total` is exposed, without a `result` | |
| tag. HTTP latency, request/response size, timeout, and in-flight metrics are not exposed. JVM, | |
| CPU, Armeria-internal, and UC metrics remain enabled. |
For example, when createTable slows from 50 ms to 5 s, /metrics still shows only http_server_requests_total{method="createTable",...}. An operator can see how many requests ran, but not how long they took or how many are running now.
Describe the solution you would like
In MetricsRegistries.createPrometheus(), also allow two meters Armeria records:
http.server.total.duration: a timer perservice,methodandhttp_status, exposed ashttp_server_total_duration_seconds_count,_sumand_max. Keep Micrometer's default of no percentile histogram, so each endpoint adds three series.http.server.active.requests: a gauge perserviceandmethod. Summing it gives total in-flight requests.
Keep denying the other http.server.* meters (request and response length, request and response duration, timeouts).
Update the metric families table and the paragraph after it in docs/server/observability.md, with an example series for each new family.
Tests go into the existing ObservabilityEndpointsIntegrationTest. Its scrape check accepts only the request counter today:
Lines 220 to 227 in 2f41e34
| assertThat(response.body().lines().filter(line -> line.startsWith("http_server_")).toList()) | |
| .isNotEmpty() | |
| .allSatisfy( | |
| line -> | |
| assertThat(line) | |
| .startsWith("http_server_requests_total{") | |
| .contains("service=", "method=", "http_status=") | |
| .doesNotContain("result=")); |
Change it to accept the two new families, and assert that after a createCatalog call the scrape has a http_server_total_duration_seconds_count series with method="createCatalog" and a http_server_active_requests series. Run:
build/sbt "server/testOnly io.unitycatalog.server.observability.ObservabilityEndpointsIntegrationTest io.unitycatalog.server.observability.MetricsRegistriesTest io.unitycatalog.server.UnityCatalogServerTest"
Done when a scrape shows latency and in-flight series per endpoint, the docs list them, and these tests pass.
Additional context
The /metrics endpoint came from #1906. Connection-pool metrics are in #2257.
Activity
ZephyrYWZhou commentedon Nov 17, 2026
Hey @shba24, I'd like to pick this one up if it's still open. Could you assign it to me please?
My plan is to follow what you laid out in the issue description:
• Let
http.server.total.durationandhttp.server.active.requeststhrough the filter inMetricsRegistries.• Update the metric families table in
observability.md.• Extend
ObservabilityEndpointsIntegrationTestto check both after acreateCatalogcall.This would be my first contribution to Unity Catalog, so I'm excited to dig in! 🙋
[Server] Expose per-endpoint latency and in-flight requests in /metri…