Group metrics

Why should I group metrics?

When you report cluster wide metrics, moving beyond a single node, you can get insights into the general cluster status, cluster processing performance, or count cluster nodes. The group metrics behave like standard metrics and similarly, you can use them in:

group metrics charts located at the bottom of group page

You'll fine group metric charts in the bottom of Group overview page.

How to use group metrics

JSON declaration

To change the primary entity of the metric to group, you have to specify it in the JSON metric declaration in the metrics section.

group metric declaration
"metrics": [
        "entity": "CUSTOM_DEVICE_GROUP",
        "timeseries": {
            "key": "cluster_nodes_ok",
            "unit": "Count",
            "dimensions": [],
            "displayname": "cluster node ok"
        "source": {
            "type": "cluster"

The remaining JSON code is the same as for standard metrics. Note that you mustn't use both a node metric and a group metric in one chart, as these would be difficult to compare.

Python usage

To use a group metric with the python code, you need to create a group with topology builder first. Then you can add either absolute or relative value to your group.

group metric usage
def query(self, **kwargs):
    group = self.topology_builder.create_group("group_id", "group_name")
    group.absolute(key='cluster_nodes_ok', value=5)

It's a very good practice to report group metrics from the master node, because multiplying metrics with the same timestamp on the same entity may lead to unexcepted behavior.