Repository navigation
Description
Describe the bug
The API host serves / with a lambda:
unitycatalog/server/src/main/java/io/unitycatalog/server/ArmeriaServerBuilder.java
Line 146 in 6a89c2c
| this.apiVirtualHost.service("/", (ctx, req) -> HttpResponse.of("Hello, Unity Catalog!")); |
The route has no default service name, so Armeria falls back to the lambda's class name for the service label. The JVM makes that name up at startup, so it changes on every restart. Two runs, one GET / each:
http_server_requests_total{hostname_pattern="*:18080",http_status="200",method="GET",service="io.unitycatalog.server.ArmeriaServerBuilder$$Lambda$739/0x000000700173fa50"} 1.0
http_server_requests_total{hostname_pattern="*:18080",http_status="200",method="GET",service="io.unitycatalog.server.ArmeriaServerBuilder$$Lambda$736/0x000000700173e1b8"} 1.0
Every restart gives / a new service value, which means new series in Prometheus. The old ones go stale, series keep piling up, and any dashboard or alert on / stops matching after a restart. This hits http_server_requests_total today, and the latency and in-flight meters from #2266 too.
To Reproduce
bin/start-uc-server --port 18080 --obs-port 19464curl http://127.0.0.1:18080/curl -s http://127.0.0.1:19464/metrics | grep 'method="GET"'- Restart the server and repeat steps 2-3. The
servicelabel is different.
Expected behavior
The / route has a fixed service label that stays the same across restarts.
Additional context
The other routes on the API host are named classes (the annotated *Service classes, and DocService for /docs), so only / is affected.
A possible fix is to give the route a default service name:
this.apiVirtualHost
.route()
.path("/")
.defaultServiceName("root")
.build((ctx, req) -> HttpResponse.of("Hello, Unity Catalog!"));plus a test that scrapes after GET / and checks for no $$Lambda in any service label. Open question: what should the value be? root is short, while something like io.unitycatalog.server.Root would match how the other services are named.
Activity
shba24 commentedon Nov 21, 2026
Thank you @ZephyrYWZhou for this report. You traced the unstable service label on the root route's metrics to the bare lambda in ArmeriaServerBuilder, and you included both scraped label values and a clear test idea.
We reproduced it on current main. A new test, ObservabilityEndpointsIntegrationTest.rootRouteIsNotMeteredUnderALambdaClassName, sends a GET to / and scrapes the request metrics. It fails on this assertion:
.allSatisfy(line -> assertThat(line).doesNotContain("$$Lambda")). The offending line washttp_server_requests_total{...,service="io.unitycatalog.server.ArmeriaServerBuilder$$Lambda$1330/0x00007d292c8397c0"} 1.0.The server area owners will take it from here. If you would like to send a fix that gives the root route a fixed service name, that test is a good starting point.
ZephyrYWZhou commentedon Nov 23, 2026
Thanks @shba24! Opened #2287 with the fix, and used your test idea: it checks no request-metric line has a $$Lambda label after GET /.
[Server] Give the / route a stable service name in /metrics