Monitoring
Get metrics
Count runs and findings over a period of time.
How it works
Choose what to count with measure, and how to split it with group_by:
| To count | measure | group_by |
|---|---|---|
| Runs, in total | runs | leave it out |
| Runs, per rule set | runs | rule_set_id |
| Findings, in total | findings | leave it out |
| Findings, per rule set, rule or agent | findings | rule_set_id, rule_id or agent_id |
| Rules not met, per severity | findings | severity |
The period runs from since until now. Set timeseries to true to get counts per hour or per day instead of one total.
Request body
application/json
- measurestringrequired
What to count.
runsfindings - group_bystring
How to split the count. Leave it out for one total.
rule_set_idrule_idagent_idseverity - agent_idstring
Only this agent.
- rule_set_idstring (uuid)
Only this rule set.
- rule_idstring
Only this rule. With
findingsonly. - severitiesstring[]
Only these severities. With
findingsonly.criticalhighmediumlow - sincestringdefault 30d
How far back to look, such as
30m,12hor7d. - timeseriesboolean
Return counts per time period instead of one total.
- resolution_secondsintegerat least 60
The length of each time period, in seconds. With
timeseriesonly. Defaults to an hour for periods up to a day, and a day for longer ones. - limitintegerup to 200
Keep only the top groups.
- sourcestringdefault platform
Which runs to include:
platformfor ones Ollive collected,apiormcpfor ones you sent.platformapimcp
Response
The counts. No groups if nothing matched.
- measurestringrequired
What was counted.
- group_bystringrequired
How it was split.
- startstring (date-time)required
The start of the period.
- endstring (date-time)required
The end of the period.
- resolution_secondsintegerrequired
The length of each time period.
0whentimeseriesis off. - groupsobject[]required
One entry per group, or a single entry for the total.
- keystringrequired
The group’s ID. Empty for the total.
- labelstringrequired
A readable name for the group.
- valuesobject
The counts. Not included with
timeseries.- run_countinteger
Runs.
- checked_run_countinteger
Runs that finished checking.
- finding_countinteger
Findings.
- flagged_run_countinteger
Runs with at least one finding.
- not_met_countinteger
Rules not met. With
group_by: severityonly.
- seriesobject[]required
The counts per time period, oldest first. With
timeseriesonly.- atstring (date-time)required
The start of the time period.
- valuesobjectrequired
The counts for that period.
- total_groupsintegerrequired
How many groups there were before
limit. - truncatedbooleanrequired
Whether
limitleft some groups out.
That combination of measure and group_by isn’t available, or something else in the request is wrong.
Returns an error, for example with the code unsupported_metric.
The API key is missing, wrong, revoked or expired.
Returns an error, for example with the code authentication_failed.