void getMetricsForYamas(Request req) {
        Instant startTime = Instant.now();
        req.detach();
        String service = req.parameters().get(0).asString();
        log.log(FINE, () -> "getMetricsForYamas called at " + startTime + " with argument: " + service);
        List<VespaService> services = vespaServices.getMonitoringServices(service);
        log.log(FINE, () -> "Getting metrics for services: " + mkString(services, "[", ", ", "]"));
        if (services.isEmpty()) setNoServiceError(req, service);
        else withExceptionHandling(req, () -> {
            List<MetricsPacket> packets = YamasJsonUtil.appendOptionalStatusPacket(metricsManager.getMetrics(services, startTime));
            log.log(FINE,() -> "Returning metrics packets:\n" + mkString(packets, "\n"));
            req.returnValues().add(new StringValue(toJson(packets, false)));
        });
        req.returnRequest();
    }
Rpc server for the metrics proxy.

When a new object is created after reconfiguration, it will claim ownership of the methods
in the given {@link RpcConnector}. This is ok because at the time this component is created,
all components it depends on are already created.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java