Only offer metrics in the context of an instance
@@ -104,7 +104,7 @@ public class ApplicationHandler extends HttpHandler {
return applicationRepository.getLogs(applicationId, hostname, apiParams);
}
- if (isMetricsRequest(request) && false) {
+ if (isMetricsRequest(request)) {
return applicationRepository.getMetrics();
}
@@ -148,9 +148,9 @@ public class ApplicationHandler extends HttpHandler {
"http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*/serviceconverge",
"http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*/serviceconverge/*",
"http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*/clustercontroller/*/status/*",
+ "http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*/metrics",
"http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*",
"http://*/application/v2/tenant/*/application/*/logs",
- "http://*/application/v2/metrics",
"http://*/application/v2/tenant/*/application/*");
}
@@ -160,7 +160,7 @@ public class ApplicationHandler extends HttpHandler {
}
private static boolean isMetricsRequest(HttpRequest request) {
- return getBindingMatch(request).groupCount() == 1 &&
+ return getBindingMatch(request).groupCount() == 7 &&
request.getUri().getPath().endsWith("/metrics");
}
