Specifies that metrics should be fetched from the server to which the current session is connected.
a new request derived from this fetch request but which will collect metrics from the current server
Fetches the metrics from the server.
If the fetch operation completes successfully, the Promise result will contain a MetricsResult that can be used to access the metrics.
Otherwise, the Promise will reject with an error. Common reasons for failure include:
If all metrics for a server are filtered out then the result will still contain an empty entry for that server.
If either MetricsRequest.server or MetricsRequest.currentServer has been called then the result will contain an entry for that server only. Otherwise, it will contain an entry for each server in the cluster.
a Promise that will complete with the metrics
Allows specifying a set of filters to limit the metrics returned.
The filter may not be null. If the filter is empty then all metrics are returned.
The filter is a set of strings. The filter matches a String if the String equals any member of the filter.
Metrics are included only if:
the set of filters to use
a new request derived from this fetch request but with the specified filters
Allows specifying a regular expression to filter the metrics returned.
The filter may not be null.
Similarly to calling filter with a set, metrics are included only if:
Only the last filter set by this method will be applied.
a regular expression to use to filter the metrics. When using a string to specify a regular expression, the string should not contain the surrounding slashes nor any flags.
a new request derived from this fetch request but with the specified filter
Specifies the name of the server to fetch metrics from. This is the configured server name.
the name of the server to fetch metrics from
a new request derived from this fetch request but with the specified server
A parameterized query that can be used to fetch metrics from the server.
A new request can be created with Metrics.metricsRequest}. Requests are immutable. The MetricsRequest.server, MetricsRequest.currentServer and MetricsRequest.filter methods can be used to create a configured request that either limits the metrics to a specific server or filters the metrics returned.
By default, the request will fetch metrics from all servers and will not filter the metrics.
The metrics are the same as those exposed by the Prometheus endpoint when requesting metrics in the OpenMetrics format.
6.10