Monitoring
Get metrics
Count conversations and violations 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 |
|---|---|---|
| Conversations, in total | sessions | leave it out |
| Conversations, per rule pack | sessions | pack_id |
| Violations, in total | violations | leave it out |
| Violations, per pack, rule or deployment | violations | pack_id, directive_id or deployment_id |
| Failed checks, per severity | violations | 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.
sessionsviolations - group_bystring
How to split the count. Leave it out for one total.
pack_iddirective_iddeployment_idseverity - deployment_idstring
Only this deployment.
- pack_idstring (uuid)
Only this rule pack.
- binding_text_idstring
Only rules from this source.
- directive_idstring
Only this rule. With
violationsonly. - severitiesstring[]
Only these severities. With
violationsonly.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 conversations to include:
PLATFORMfor ones Ollive collected,APIfor ones you sent.PLATFORMAPI
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.- session_countinteger
Conversations.
- verified_session_countinteger
Conversations that finished checking.
- violation_countinteger
Violations.
- violating_session_countinteger
Conversations with at least one violation.
- verdict_countinteger
Failed checks. 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.