What’s newRelease 13 · Dec 2, 2026From finding to fix: diagnoses, Ask Ollive and three new integrationsRead the changelog

Monitoring

Get metrics

Count runs and findings over a time range, in total, per group and over time.

POSThttps://api.ollive.ai/api/metrics/query/v1

How it works

Ask for up to five metrics in one request. Give each one a name and a measure, and its counts come back under that name. A metric can have its own rule_id and severities, so you can count findings twice with different filters.

Choose what to count with measure, and how to split it with group_by:

To countmeasuregroup_byFilters
Runs, in totalrunsleave it outagent_id, rule_set_id
Runs, per rule setrunsrule_set_idagent_id
Findings, in total or per rule set, rule or agentfindingsleave it out, rule_set_id, rule_id or agent_idall four
Rules not met, per severityfindingsseverityall four

A finding is one agent not meeting one rule, so finding_count counts distinct findings. It doesn’t add up across groups or time periods, which is why total is counted on its own.

The response always has total: every metric over the whole time range. Set include_previous to also get previous, the same counts for the time range of the same length just before, to show a trend. Set timeseries to get series: the counts for every period of resolution_seconds from start, with empty periods as zeros.

With group_by, groups has every group any metric has, in the time range or the one before, ranked by the first metric. Each group carries every metric, with zeros where a metric has none. Use limit to keep only the top groups. Metrics count the rule sets your agents are bound to now.

With both group_by and timeseries, a response can hold up to 100,000 counts (groups × periods × metrics). Past that, you get a 400: ask for fewer groups, longer periods or a shorter time range.

Authorization

  • Authorizationheaderrequired

    Your API key, after the word Bearer, like this: Bearer ollive_sk_…. Create a key.

Request body

application/json

  • metricsobject[]required1 to 5

    The metrics to count.

    • namestringrequiredup to 40 characters

      A name for the metric, different from the others in the request. Its counts come back under this name. Lowercase letters, numbers and _, starting with a letter.

    • measurestringrequired

      What to count.

      runsfindings
    • rule_idstring

      Only this rule. With findings only.

    • severitiesstring[]

      Only these severities. With findings only.

      criticalhighmediumlowunknown
  • group_bystring

    How to split every metric. Leave it out for totals only.

    rule_set_idrule_idagent_idseverity
  • agent_idstring

    Only this agent, for every metric.

  • rule_set_idstring (uuid)

    Only this rule set, for every metric.

  • startstring (date-time)up to 5,000 days before end

    The start of the time range, included. Defaults to 30 days before end.

  • endstring (date-time)

    The end of the time range, not included. Defaults to now.

  • include_previousboolean

    Also count the time range of the same length just before, in previous.

  • timeseriesboolean

    Also count every period of time, in series.

  • resolution_secondsintegerat least 60

    The length of each period, in seconds. With timeseries only. Defaults to an hour for time ranges up to a day, and a day for longer ones.

  • limitinteger

    Keep only the top groups. With group_by set to rule_set_id, rule_id or agent_id.

  • sourcestringdefault platform

    Which runs to count: platform for ones Ollive collected, api or mcp for ones sent to Ollive.

    platformapimcp

Response

The counts. Zeros if nothing matched.

  • group_bystringrequired

    How the counts were split.

  • startstring (date-time)required

    The start of the time range.

  • endstring (date-time)required

    The end of the time range.

  • previous_startstring (date-time)

    The start of the previous time range. With include_previous only.

  • previous_endstring (date-time)

    The end of the previous time range. With include_previous only.

  • resolution_secondsintegerrequired

    The length of each period. 0 without timeseries.

  • totalobjectrequired

    Each metric’s counts over the whole time range, by name.

    • run_countinteger

      Runs. runs metrics only.

    • checked_run_countinteger

      Runs that finished checking. runs metrics only.

    • finding_countinteger

      Findings. findings metrics only.

    • flagged_run_countinteger

      Runs with at least one finding. findings metrics only.

    • not_met_countinteger

      Rules not met. With group_by: severity only.

  • previousobjectrequired

    Each metric’s counts over the previous time range, by name. Empty without include_previous.

  • seriesobject[]required

    The counts per period, oldest first. Empty without timeseries.

    • atstring (date-time)required

      The start of the period.

    • valuesobjectrequired

      Each metric’s counts for that period, by name.

  • groupsobject[]required

    One entry per group, ranked by the first metric. Empty without group_by.

    • keystringrequired

      The group’s ID: a rule set, rule or agent ID, or a severity. unknown when Ollive couldn’t tell which one.

    • labelstringrequired

      A readable name for the group.

    • valuesobjectrequired

      Each metric’s counts for this group, by name.

    • previousobjectrequired

      The same for the previous time range. Empty without include_previous.

    • seriesobject[]required

      This group’s counts per period, oldest first. Empty without timeseries.

  • total_groupsintegerrequired

    How many groups there were before limit.

  • truncatedbooleanrequired

    Whether limit left some groups out.

← List resultsList rule sets →