Query Explore Events in Timeseries Format
Retrieves explore data for a given organization as a timeseries.
This endpoint can return timeseries for either 1 or many axis, and results grouped to the top events depending on the parameters passed
Note: For queries extending past 30d, spanning billions of rows, or running on projects with low
sample rates, the aggregation yAxis=count_unique() and filters on high-cardinality
fields (such as query=user.id:bc) will not return accurate results. Use these queries for rough
estimation only.
Path Parameters
organization_id_or_slug(string)REQUIREDThe ID or slug of the organization the resource belongs to.
Query Parameters:
dataset(string)REQUIRED- choices:
- errors
- logs
- profile_functions
- spans
- tracemetrics
- uptime_results
Which dataset to query. The chosen dataset determines which fields are queryable.
errors- Error events.logs- Structured log events.profile_functions- Function-level Profiling data.spans- Distributed tracing span events.tracemetrics- Application Metrics.uptime_results- Uptime monitoring check results.
end(string)The end of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.environment(array(string))The name of environments to filter by.
project(array(undefined))The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects.
-1is also accepted to include all accessible projects. For example, the following are valid parameters:/?project=1234&project=56789/?project=android&project=javascript-react/?project=-1
start(string)The start of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.statsPeriod(string)The period of time for the query, will override the start & end parameters, a number followed by one of:
dfor dayshfor hoursmfor minutessfor secondswfor weeks
For example,
24h, to mean query data starting from 24 hours ago to now.topEvents(integer)The number of top event results to return, must be between 1 and 10. When TopEvents is passed, both sort and groupBy are required parameters
comparisonDelta(integer)The delta in seconds to return additional offset timeseries by
intervalThe size of the bucket for the timeseries to have, must be a value smaller than the window being queried. Either a number of seconds, or a number with a unit suffix of
s,m,h,d, orw, such as5mor1h. If the interval is invalid a default interval will be selected insteadsort(string)What to order the results of the query by. Must be something in the
fieldlist, excluding equations.groupBy(array(string))List of fields to group by, Required for topEvents queries as this and sort determine what the top events are
yAxis(array(string))The aggregate fields to create timeseries for, defaults to
count()when not included. Pass the parameter more than once to get a timeseries for each aggregate, for example?yAxis=count()&yAxis=p95(span.duration).count()- Total count of events over the period.avg(field)- Average value of the field over the period.pXX(field)- Percentile value of the field over the period. One of:p50,p75,p90,p95,p99,p100.sum(field)- Sum of all values for the field over the period.min(field)- Lowest value observed for the field over the period.max(field)- Highest value observed for the field over the period.count_unique(field)- Count of unique values observed for the field over the period. See Note: regarding accuracy on sampled data.epm- Average number of events received per minute.eps- Average number of events received per second.failure_rate()- Percentage of events whosestatusindicates failure.failure_count()- Total count of events with an errorstatusover period.performance_score(field)- Web Vitals performance score for the selected measurement.opportunity_score(field)- Web Vitals opportunity score for the selected measurement.
transformations[0](array(string))Ordered transformations for a zero-based
yAxisposition. Replace0with the target axis index. Repeat the indexed key for each operation, for exampletransformations[0]=fill(locf)&transformations[0]=smooth(sma,3). Each axis accepts at most one fill and one smooth operation, in execution order. Fill modes arelocf,zero, andlinear. Smoothing modes aresma,ema, andasap. Omit the indexed key to leave that axis unchanged. Requires the interpolation and smoothing feature.query(string)Filters results by using query syntax.
Example:
query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)With the
logsdataset, a string attribute can also be matched against a regular expression written askey://pattern//, and excluded with!key://pattern//. Patterns use RE2 syntax, match anywhere in the value unless anchored with^or$, are case sensitive unless they start with(?i), and are limited to 64 characters. A query can contain up to 16 regular expressions. To search for a literal value that starts with//, quote it:key:"//value". See regular expressions for more details.Example:
query=message://^Timeout after \d+ms//disableAggregateExtrapolation(string)- choices:
- 0
- 1
Whether to disable the use of extrapolation and return the sampled values, due to sampling the number returned may be less than the actual values sent to Sentry
preventMetricAggregates(string)- choices:
- 0
- 1
Whether to throw an error when aggregates are passed in the query or groupBy
excludeOther(string)- choices:
- 0
- 1
Only applicable with TopEvents, whether to include the 'other' timeseries which represents all the events that aren't in the top groups.
Scopes
<auth_token> requires one of the following scopes:org:adminorg:readorg:write
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/events-timeseries/ \ -H 'Authorization: Bearer <auth_token>'
Copied{ "timeSeries": [ { "values": [ { "timestamp": 1741366800000, "value": 5, "incomplete": false }, { "timestamp": 1741370400000, "value": 3, "incomplete": true, "incompleteReason": "INGESTION_PENDING" }, { "timestamp": 1741374000000, "value": 4, "incomplete": true, "incompleteReason": "NOT_ELAPSED" } ], "yAxis": "count()", "groupBy": [ { "key": "transaction", "value": "foo" }, { "key": "project", "value": "bar" }, { "key": "tag[foo]", "value": "baz" } ], "meta": { "valueUnit": null, "valueType": "integer", "interval": 3600 } }, { "values": [ { "timestamp": 1741366800000, "value": 5, "incomplete": false }, { "timestamp": 1741370400000, "value": 2, "incomplete": true, "incompleteReason": "INGESTION_PENDING" }, { "timestamp": 1741374000000, "value": 1, "incomplete": true, "incompleteReason": "NOT_ELAPSED" } ], "yAxis": "count()", "groupBy": [ { "key": "transaction", "value": "foo" }, { "key": "project", "value": "ball" }, { "key": "tag[foo]", "value": "baz" } ], "meta": { "valueUnit": null, "valueType": "integer", "interval": 3600 } } ], "meta": { "dataset": "spans", "start": 1741366800000, "end": 1741374060000, "ingestion": { "status": "healthy", "delaySeconds": 130.5, "completeThrough": 1741373929500 } } }