diff options
author | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2023-02-09 17:11:18 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2023-02-09 17:11:18 +0100 |
commit | 3014e3e42ce93ec638eda67d0fd0c40f68431707 (patch) | |
tree | cbc4b587293c97e8d88dcc6bdf3bc0407693404b /metrics-proxy/src/main/java/ai | |
parent | cf2673c4494f233c086dc54d747a377474801fb9 (diff) |
Define required capabilities for existing JRT RPC methods
Diffstat (limited to 'metrics-proxy/src/main/java/ai')
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java index 63672e7e600..aa8673befc1 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java @@ -11,6 +11,7 @@ import com.yahoo.jrt.ErrorCode; import com.yahoo.jrt.Method; import com.yahoo.jrt.Request; import com.yahoo.jrt.StringValue; +import com.yahoo.security.tls.Capability; import java.time.Instant; import java.util.List; @@ -53,38 +54,45 @@ public class RpcServer { // Add/replace this method first to increase likelihood of getting extra metrics and global dimensions connector.addMethod( new Method("setExtraMetrics", "s", "", this::setExtraMetrics) + .requireCapabilities(Capability.METRICSPROXY__MANAGEMENT_API) .methodDesc("Set extra metrics that will be added to output from getMetricsForYamas.") .paramDesc(0, "metricsJson", "The metrics in json format")); connector.addMethod( new Method("purgeExtraMetrics", "", "", this::purgeExtraMetrics) + .requireCapabilities(Capability.METRICSPROXY__MANAGEMENT_API) .methodDesc("Purge metrics and dimensions populated by setExtraMetrics")); connector.addMethod( new Method("getMetricsById", "s", "s", this::getMetricsById) + .requireCapabilities(Capability.METRICSPROXY__METRICS_API) .methodDesc("Get Vespa metrics for the service with the given Id") .paramDesc(0, "id", "The id of the service") .returnDesc(0, "ret", "Vespa metrics")); connector.addMethod( new Method("getServices", "", "s", this::getServices) + .requireCapabilities(Capability.METRICSPROXY__METRICS_API) .methodDesc("Get Vespa services monitored by this metrics proxy") .returnDesc(0, "ret", "Vespa metrics")); connector.addMethod( new Method("getMetricsForYamas", "s", "s", this::getMetricsForYamas) + .requireCapabilities(Capability.METRICSPROXY__METRICS_API) .methodDesc("Get JSON formatted Vespa metrics for a given service name or 'all'") .paramDesc(0, "service", "The vespa service name, or 'all'") .returnDesc(0, "ret", "Vespa metrics")); connector.addMethod( new Method("getHealthMetricsForYamas", "s", "s", this::getHealthMetricsForYamas) + .requireCapabilities(Capability.METRICSPROXY__METRICS_API) .methodDesc("Get JSON formatted Health check for a given service name or 'all'") .paramDesc(0, "service", "The vespa service name") .returnDesc(0, "ret", "Vespa metrics")); connector.addMethod( new Method("getAllMetricNamesForService", "ss", "s", this::getAllMetricNamesForService) + .requireCapabilities(Capability.METRICSPROXY__METRICS_API) .methodDesc("Get metric names known for service ") .paramDesc(0, "service", "The vespa service name'") .paramDesc(1, "consumer", "The consumer'") |