Occurrences over a span of time

Get occurrences metrics over a span of time by filtering, grouping, and aggregating. The endpoint follows search/query semantics as a POST request using a Project or Account Access Token with read scope.

The account must have access to the Metrics API, which is part of the Advanced package. Other accounts receive a 403.

Projects queried

  • Project Access Token: the query always runs against the token's own project. Any project_id filter in the request is ignored.
  • Account Access Token: without a project_id filter, every project the token can read is queried. With one, projects the token can't read are dropped from the filter, and if none are left the response is a 403.

Time range and timepoints

start_time and end_time are optional. A missing start_time, or one earlier than the account's data retention, starts the query at the retention boundary. A missing end_time leaves the range open-ended.

With a granularity, results are bucketed into one timepoint per period. Without one, all rows are returned in a single timepoint whose timestamp is the time of the latest occurrence.

Columns

These columns can be used in filters, group_by, aggregates, and sort:

  • project_id
  • item_id
  • environment
  • browser_family
  • browser_version
  • os_family
  • os_version
  • device_brand
  • device_model
  • ip_address
  • item_status
  • item_level
  • item_group_item_id
  • item_title
  • item_counter
  • person_username
  • person_email
  • person_id
  • code_version
  • count
  • occurrence_id
  • uuid
  • context
  • platform
  • framework
  • platform_canonical
  • framework_canonical
  • language
  • language_name
  • notifier_name
  • notifier_version
  • occurrence_count
  • message_body
  • timestamp
  • fingerprint
  • server_host
  • server_root
  • server_pid
  • server_cpu
  • scm_branch
  • request_url
  • request_method
  • request_query_string
  • request_body
  • js_client_settings
  • exception_class
  • exception_message
  • exception_description
  • traceframe_stack_level
  • traceframe_index
  • traceframe_reverse_index
  • traceframe_lineno
  • traceframe_colno
  • traceframe_filename
  • traceframe_method
  • traceframe_class_name
  • traceframe_in_project
  • telemetry_level
  • telemetry_type
  • telemetry_source
  • telemetry_timestamp
  • telemetry_body_subtype
  • telemetry_body_method
  • telemetry_body_url
  • telemetry_body_message
  • telemetry_body_element
  • telemetry_body_from
  • telemetry_body_to
  • telemetry_body_status_code
  • telemetry_body_start_timestamp
  • telemetry_body_end_timestamp
  • replay_id

Key/value columns

These columns hold lists of name/value pairs:

  • request_headers
  • request_params
  • request_gets
  • request_posts
  • customs
  • traceframe_locals
  • attributes

In filters and aggregates, set key to the name of the entry to use, for example {"field": "request_headers", "key": "User-Agent", "operator": "eq", "values": ["curl/8.0"]}. When the entry's value is JSON, text after the first unescaped . in key is read as a JSONPath into it (for example payload.user.id); escape a literal dot in the name as \.. Each of these columns also has _name and _value variants (for example request_headers_name) that address every name or every value in the list.

Filter operators

  • eq and ne match any of the listed values and accept more than one value.
  • gt, gte, lt, and lte take one value.
  • like and ilike (case-insensitive) take one SQL LIKE pattern; use % as the wildcard.
  • is_null and not_null take no values.

item_status and item_level are filtered by name, for example active or error.

A filter whose field is an aggregate alias is applied to the aggregated result, for example {"field": "person_count", "operator": "gt", "values": [10]}.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer

Unix timestamp of start time for the query. Optional. When missing, or earlier than the account's data retention, the query starts at the retention boundary

integer

Unix timestamp of end time for the query, inclusive. Optional. When missing, the range has no upper bound

filters
array of objects

Array of filters, all of which must match. Supported operators: eq, ne, gt, gte, lt, lte, like, ilike, is_null, and not_null. Only eq and ne accept more than one value. See the endpoint description for details

filters
group_by
array of objects

An array of column names on which to group the results

group_by
aggregates
array of objects

An array of columns on which an aggregate function should be performed for each group. Supported functions are: count_all, count_distinct, max, min, sum, topk, quantiles, array, and json_array_length

aggregates
sort

Sort on one field, or on several in order of priority. Default is timestamp ascending

string
enum

Timepoint size of the returned results. Optional. Without it, all rows are returned in a single timepoint

Allowed:
string

Timezone used to bucket timepoints. Optional, default is UTC. Other examples: US/Pacific, Europe/London, Japan, and etc.

integer

Total rows/groups to return in the set. Optional. With neither limit nor offset, every row is returned. With only offset, the default is 25

integer

Number of rows/groups to skip before the first one returned. Optional, default is 0

Headers
string
required

Use a Project or Account Access Token with 'read' scope. An Account Access Token names the project with project_id on an endpoint that acts on one project, and a personal access token can do only what its user is permitted to.

Responses

project_ids that the token can't read are left out of the query, and the request is refused only when none are left. Also returned when the account's plan doesn't include the Metrics API.

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json