Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Metrics

This feature allows a client to configure metric collectors.

Diffusion servers provide metrics which are made available in several ways:

  • Java Management Extensions (JMX) MBeans.
  • Through the Diffusion Management Console.
  • As endpoints for Prometheus.

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:

const metrics = session.metrics;
author

DiffusionData Limited

since

6.7

Hierarchy

  • Metrics

Index

Methods

listSessionMetricCollectors

  • Retrieves the current session metric collectors.

    Returns Result<SessionMetricCollectorList>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the calling session does not have VIEW_SERVER permission;
    • if the session is closed.

listTopicMetricCollectors

  • Retrieves the current topic metric collectors.

    Returns Result<TopicMetricCollectorList>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the calling session does not have VIEW_SERVER permission;
    • if the session is closed.

metricsRequest

putSessionMetricCollector

  • Add a session metric collector, replacing any with the same name.

    A SessionMetricCollector instance can be created using newSessionMetricCollectorBuilder.

    Parameters

    Returns Result<any>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the metric collector session filter is invalid;
    • if the calling session does not have CONTROL_SERVER permission;
    • if the operation failed due to a transient cluster error;
    • if the session is closed.
    • NullValueError – if the collector is null or undefined

putTopicMetricCollector

  • Add a topic metric collector, replacing any with the same name.

    A TopicMetricCollector instance can be created using newTopicMetricCollectorBuilder.

    Parameters

    Returns Result<any>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the metric collector session filter is invalid;
    • if the calling session does not have CONTROL_SERVER permission;
    • if the operation failed due to a transient cluster error;
    • if the session is closed.
    • NullValueError – if the collector is null or undefined

removeSessionMetricCollector

  • removeSessionMetricCollector(name: string): Result<any>
  • Removes any session metric collector with the given name, if it exists.

    Parameters

    • name: string

      the session metric collector name

    Returns Result<any>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the calling session does not have CONTROL_SERVER permission;
    • if the operation failed due to a transient cluster error;
    • if the session is closed.
    • NullValueError – if the name is null or undefined

removeTopicMetricCollector

  • removeTopicMetricCollector(name: string): Result<any>
  • Removes any topic metric collector with the given name, if it exists.

    Parameters

    • name: string

      the topic metric collector name

    Returns Result<any>

    a Result 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 Result will reject with an Error. Common reasons for failure include:

    • if the calling session does not have CONTROL_SERVER permission;
    • if the operation failed due to a transient cluster error;
    • if the session is closed.
    • NullValueError – if the collector is null or undefined