Group metrics

Extensions 1.0 end of life

OneAgent and ActiveGate version 1.299 are the last versions supporting OneAgent and ActiveGate Extensions 1.0 framework. You can continue using Extensions 1.0 if you stay at OneAgent or ActiveGate version 1.299. Note that this means you'll be using an unsupported Python version 3.8. We strongly recommend migrating your extensions to the latest Extensions 2.0 framework.

For more information, see General guidance and how to migrate.

When you report device group-wide metrics, moving beyond a single device, you can get insights into the general group status, group processing performance, or count group elements (devices). The group metrics behave like standard metrics and similarly, you can use them in:

Group metrics charts located at the bottom of a device group page

You'll find device group metric charts at the bottom of the Group overview page.

How to use device 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.

{
"name": "custom.remote.python.my_plugin",
"version": "1.001",
"type": "python",
"entity": "CUSTOM_DEVICE",
"processTypeNames": ["PYTHON"],
"technologies": ["example technology"],
"source": {
"package": "my_plugin",
"className": "MyPlugin",
"activation": "Remote"
},
"metrics": [
{
"entity": "CUSTOM_DEVICE_GROUP",
"timeseries": {
"key": "cluster_nodes_ok",
"unit": "Count",
"displayname": "cluster node ok"
}
}
],
"ui": {
"keymetrics": [
{
"key": "cluster_nodes_ok",
"displayname": "Group key metric"
}
],
"charts": [
{
"group": "Cluster charts",
"title": "My chart",
"series": [
{
"key": "cluster_nodes_ok",
"displayname": " "
}
]
}
]
}
}

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

Python usage

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

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 good practice to report device group metrics from the master device, because multiplying metrics with the same timestamp on the same entity may lead to unexcepted behavior.