List all metric alerts that have been created.
a Promise that resolves when a response is received from the server, returning a list of metric alerts sorted by their creation order.
If the task fails, the Promise will reject with an Error. Common
reasons for failure, listed by the exception, include:
<ul>
<li>{@link ClusterRoutingException} – if the operation
failed due to a transient cluster error;
<li>{@link PermissionsException} – if the calling session
does not have CONTROL_SERVER permission;
<li>{@link SessionClosedException} – if the session is
closed.
</ul>
Retrieves the current session metric collectors.
a Promise that completes when a response is received from the server.
If the task completes successfully, the result will be a list of current session metric collectors.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
Retrieves the current topic metric collectors.
a Promise that completes when a response is received from the server.
If the task completes successfully, the result will be a list of current topic metric collectors.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
Creates an unconfigured MetricsRequest. The request can be invoked using MetricsRequest.fetch to retrieve metrics for the server or cluster.
See MetricsRequest for more information.
a new MetricsRequest
Add a session metric collector, replacing any with the same name.
A SessionMetricCollector instance can be created using newSessionMetricCollectorBuilder.
the session metric collector
a Promise that resolves when a response is received from the server.
If the task completes successfully, the result will be null. The
result type is any
rather than void
to provide forward
compatibility with future iterations of this API that may provide
a non-null result with a more specific result type.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
null
or undefined
Add a topic metric collector, replacing any with the same name.
A TopicMetricCollector instance can be created using newTopicMetricCollectorBuilder.
the topic metric collector
a Promise that resolves when a response is received from the server.
If the task completes successfully, the result will be null. The
result type is any
rather than void
to provide forward
compatibility with future iterations of this API that may provide
a non-null result with a more specific result type.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
null
or undefined
Remove a named metric alert if it exists.
If the named alert does not exist, the Promise will complete successfully.
the name of the metric alert
a Promise that resolves when a response is received from the server.
If the task fails, the Promise will reject with an Error. Common
reasons for failure, listed by the exception, include:
<ul>
<li>{@link ClusterRoutingException} – if the operation
failed due to a transient cluster error;
<li>{@link PermissionsException} – if the calling session
does not have CONTROL_SERVER permission;
<li>{@link SessionClosedException} – if the session is
closed.
</ul>
Removes any session metric collector with the given name, if it exists.
the session metric collector name
a Promise that resolves when a response is received from the server.
If the task completes successfully, the result will be null. The
result type is any
rather than void
to provide forward
compatibility with future iterations of this API that may provide
a non-null result with a more specific result type.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
null
or undefined
Removes any topic metric collector with the given name, if it exists.
the topic metric collector name
a Promise that resolves when a response is received from the server.
If the task completes successfully, the result will be null. The
result type is any
rather than void
to provide forward
compatibility with future iterations of this API that may provide
a non-null result with a more specific result type.
Otherwise, the Promise will reject with an Error. Common reasons for failure include:
null
or undefined
Set or update a metric alert with a given name and specification.
This method creates or updates a metric alert. If an alert with the specified name already exists, it will be overwritten with the new specification.
the name of the metric alert. This name is used to uniquely identify the alert.
the specification of the metric alert. This defines the conditions under which the alert is triggered and the actions to be taken.
a Promise that resolves when a response is received from the server. If the operation is successful, the Promise resolves normally.
If the task fails, the Promise will reject with an Error. Common
reasons for failure, listed by the exception, include:
<ul>
<li>{@link ScriptException} – if {@code specification} is
invalid;
<li>{@link ClusterRoutingException} – if the operation
failed due to a transient cluster error;
<li>{@link PermissionsException} – if the calling session
does not have CONTROL_SERVER permission;
<li>{@link SessionClosedException} – if the session is
closed;
</ul>
This feature allows a client to configure metric collectors.
Diffusion servers provide metrics which are made available in several ways:
Metric collectors allow custom aggregation of metrics that are relevant to your application. There are no default metric collectors, only the ones that you create.
There are two types of metric collector: Session Metric Collectors and Topic Metric Collectors.
For full details regarding the configuration and operation of metric collectors see the user manual.
Session Metric Collectors.
These can be configured to record metric data for a subset of all sessions, specified with a session filter.
The set of metrics recorded by each session metric collector is the same as those recorded for the whole server. For full details of session metrics, see the table in the user manual.
If the session filters of two different session metric collectors select the same session, both will record metrics for that session. It is only valid to add the metrics of different session metric collectors if their session filters select distinct sets of sessions.
You can optionally group the sessions within a collector by session properties.
Topic Metric Collectors
These can be configured to record metric data for a subset of all topics, specified with a topic selector.
You can optionally group the topics within a collector by topic type.
The set of metrics recorded by each topic metric collector is the same as those recorded for the whole server. For full details of topic metrics, see the table in the user manual.
If the topic selectors of two different topic metric collectors select the same topic, both will record metrics for that topic. It is only valid to add the metrics of different topic metric collectors if their topic selectors select distinct sets of topics.
Access control
The following access control restrictions are applied:
Accessing the feature
This feature may be obtained from a session as follows:
DiffusionData Limited
6.7