As of ThreatConnect 5.4, it is possible to create Custom Metrics which can be used to monitor and track important data points. A card for Custom Metrics can be created on the ThreatConnect dashboard to show the value(s) of a Metric. This documentation will detail how to retrieve, create, and delete Custom Metrics via the API.

In order to view the Custom Metrics available to an Organization in ThreatConnect, use the following query:

GET/v2/customMetrics/

JSON Response:

{"status":"Success","data":{"resultCount":2,"customMetricConfig":[{"id":7,"name":"playbookRuns","dataType":"Sum","interval":"Hourly","keyedValues":true,"description":"Monitor playbook runs."},{"id":11,"name":"tasksCompleted","dataType":"Sum","interval":"Daily","keyedValues":false,"description":"Track the number of tasks closed."}]}}

To view a specific metric, add the metric’s name to the end of the query as shown below:

GET/v2/customMetrics/{metricName}

Or, alternatively, you can use the ID of the metric to get the same result:

When creating a new entry in a metric, it is possible to view the current value by adding the ?returnValue=true flag to the query. For example, the query format below will increment the value of a non-keyed metric by two and return the current value of the metric: