Query Discover Events in Table Format
Retrieves discover (also known as events) data for a given organization.
Eventsv2 Deprecation Note: Users who may be using the eventsv2
endpoint should update their requests to the events
endpoint outline in this document.
The eventsv2
endpoint is not a public endpoint and has no guaranteed availability. If you are not making any API calls to eventsv2
, you can safely ignore this.
Changes between eventsv2
and events
include:
- Field keys in the response now match the keys in the requested
field
param exactly. - The
meta
object in the response now shows types in the nestedfield
object.
Aside from the url change, there are no changes to the request payload itself.
Note: This endpoint is intended to get a table of results, and is not for doing a full export of data sent to Sentry.
The field
query parameter determines what fields will be selected in the data
and meta
keys of the endpoint response.
- The
data
key contains a list of results row by row that match thequery
made - The
meta
key contains information about the response, including the unit or type of the fields requested
Path Parameters
organization_slug
(string)REQUIREDThe slug of the organization the resource belongs to.
Query Parameters:
field
(array(string))REQUIREDThe fields, functions, or equations to request for the query. At most 20 fields can be selected per request. Each field can be one of the following types:
- A built-in key field. See possible fields in the properties table, under any field that is an event property.
- example:
field=transaction
- example:
- A tag. Tags should use the
tag[]
formatting to avoid ambiguity with any fields- example:
field=tag[isEnterprise]
- example:
- A function which will be in the format of
function_name(parameters,...)
. See possible functions in the query builder documentation.- when a function is included, Discover will group by any tags or fields
- example:
field=count_if(transaction.duration,greater,300)
- An equation when prefixed with
equation|
. Read more about equations here.- example:
field=equation|count_if(transaction.duration,greater,300) / count() * 100
- example:
- A built-in key field. See possible fields in the properties table, under any field that is an event property.
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(integer))The IDs of projects to filter by.
-1
means all available projects. For example the following are valid parameters:/?project=1234&project=56789
/?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:
d
for daysh
for hoursm
for minutess
for secondsw
for weeks
For example
24h
, to mean query data starting from 24 hours ago to now.per_page
(integer)Limit the number of rows to return in the result. Default and maximum allowed is 100.
query
(string)The search filter for your query, read more about query syntax here.
example:
query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)
sort
(string)What to order the results of the query by. Must be something in the
field
list, excluding equations.
Scopes
<auth_token>
requires one of the following scopes:org:admin
org:read
org:write
curl https://sentry.io/api/0/organizations/{organization_slug}/events/ \ -H 'Authorization: Bearer <auth_token>'
{
"data": [
{
"count_if(transaction.duration,greater,300)": 5,
"count()": 10,
"equation|count_if(transaction.duration,greater,300) / count() * 100": 50,
"transaction": "foo"
},
{
"count_if(transaction.duration,greater,300)": 3,
"count()": 20,
"equation|count_if(transaction.duration,greater,300) / count() * 100": 15,
"transaction": "bar"
},
{
"count_if(transaction.duration,greater,300)": 8,
"count()": 40,
"equation|count_if(transaction.duration,greater,300) / count() * 100": 20,
"transaction": "baz"
}
],
"meta": {
"fields": {
"count_if(transaction.duration,greater,300)": "integer",
"count()": "integer",
"equation|count_if(transaction.duration,greater,300) / count() * 100": "number",
"transaction": "string"
}
}
}