API Documentation | Check Bundle Metrics

Add or remove individual metrics under a Check Bundle rather than replacing the entire Check Bundle object.

Fields

_cid string
The primary key
"/check_bundle_metrics/45315"
A string containing a check_bundle_metrics cid
metrics array
Details on the metrics each check in this bundle gathers.
[{"type":"numeric","units":"seconds","status":"active","tags":[],"name":"average"},{"name":"maximum","tags":[],"status":"active","units":"seconds","type":"numeric"},{"type":"numeric","tags":[],"name":"minimum","units":"seconds","status":"active"}]
An array
object (zero or more times)
Details on a single metric that is/can be collected.
An object
name string
The name of the metric
A string containing freeform text
type string
The type of the metric.
A string containing either 'numeric', 'text', 'histogram', 'composite', or 'caql'
result string
The result of the requested change for this metric. Can be, 'success', 'fail', or 'noop'
A string containing freeform text
status string
If the metric is 'active' (currently being collected) or merely 'available' (can be collected but isn't right now)
A string containing either 'active' or 'available'
tags array

An array of tags. The tags in the array are automatically sorted, deduplicated and transformed into their lowercase canonical form.
string (zero or more times)
An associated tag
A tag is just a string, with or without a colon, such as 'foo', 'bar', 'datacenter:london', or 'os:linux'. The part of the string before the colon is considered the category the tag is in; Tag strings without a colon will place the string in the 'uncategorized' category. Circonus will lowercase the contents of the string before storing it.
units string
The unit of measurement the metric represents (e.g., bytes, seconds, milliseconds).
A string containing freeform text

Example

Modifying metrics in a check bundle

Modifying metrics on an existing check bundle is as simple as making a HTTP PUT request to /check_bundle_metrics/[check_bundle_id] and passing JSON representing the metrics to modify. You can change the status of the passed metrics ("active" or "available"), or you can change the type of the passed metrics. You can also modify tags or units.

Any metrics that already exist on the check bundle and are not referenced in your PUT request are left unmodified.

IMPORTANT: Because we have to reach out to the broker to affect these changes it's possible to leave metrics in a weird state if you attempt to deactivate or activate metrics one at a time in a loop. If you intend to change multiple metrics at the same time you should put all of them in a single list so that we can update them in a single transaction.

PUT /check_bundle_metrics/45315
{"metrics":[{"type":"numeric","tags":["tagcat:tagval"],"name":"Honeydew`detectors`0`count","units":"seconds","status":"active"},{"status":"available","units":"seconds","name":"average","tags":[],"type":"numeric"}]}

In the above example a new metric called "Honeydew`detectors`0`count" is turned on ("status" : "active"), while another metric "average" is turned off ("status" : "available"). "available" means that the metric is available to be collected on the broker but is currently not being collected.

The response will contain the same list of metrics you submitted along with a result indicating the result of the operation ("success", "fail", "noop")

Getting the current active metric list

You can obtain the current active metric list for a check bundle with a simple HTTP GET

GET /check_bundle_metrics/45315
{"metrics":[{"units":"seconds","status":"active","name":"Honeydew`detectors`0`count","tags":["tagcat:tagval"],"type":"numeric"}],"_cid":"/check_bundle_metrics/45315"}

For more info on metrics in a check bundle, see the CheckBundle docs