Monitoring

Get metrics

Count conversations and violations over a period of time.

POSThttps://api.ollive.ai/api/metrics/query/v1
Safe to retryv1

How it works

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

To countmeasuregroup_by
Conversations, in totalsessionsleave it out
Conversations, per rule packsessionspack_id
Violations, in totalviolationsleave it out
Violations, per pack, rule or deploymentviolationspack_id, directive_id or deployment_id
Failed checks, per severityviolationsseverity

The period runs from since until now. Set timeseries to true to get counts per hour or per day instead of one total.

Authorization

  • Authorizationheaderrequired

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

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 violations only.

  • severitiesstring[]

    Only these severities. With violations only.

    criticalhighmediumlow
  • sincestringdefault 30d

    How far back to look, such as 30m, 12h or 7d.

  • timeseriesboolean

    Return counts per time period instead of one total.

  • resolution_secondsintegerat least 60

    The length of each time period, in seconds. With timeseries only. 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: PLATFORM for ones Ollive collected, API for 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. 0 when timeseries is 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: severity only.

    • seriesobject[]required

      The counts per time period, oldest first. With timeseries only.

      • 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 limit left some groups out.

← List verdictsAPI overview →