Retrieve Release Health Session Statistics
Returns a time series of release health session statistics for projects bound to an organization.
The interval and date range are subject to certain restrictions and rounding rules.
The date range is rounded to align with the interval, and is rounded to at least one hour. The interval can at most be one day and at least one hour currently. It has to cleanly divide one day, for rounding reasons.
Apart from the query parameters listed below, this endpoint also supports the usual pagination parameters.
Path Parameters
organization_slug
(string)REQUIREDThe slug of the organization.
Query Parameters:
project
(array(integer))REQUIREDThe ID of the projects to filter by.
Use
-1
to include all accessible projects.field
(array(string))REQUIREDThe list of fields to query.
The available fields are
sum(session)
count_unique(user)
avg
,p50
,p75
,p90
,p95
,p99
,max
applied tosession.duration
. For example,p99(session.duration)
. Session duration is no longer being recorded as of on Jan 12, 2023. Returned data may be incomplete.crash_rate
,crash_free_rate
applied touser
orsession
. For example,crash_free_rate(user)
environment
(array(string))The name of environments to filter by.
groupBy
(array(string))The list of properties to group by.
The available groupBy conditions are
project
,release
,environment
andsession.status
.Grouping by
session.status
does not work whencrash_rate
orcrash_free_rate
are queried.orderBy
(string)An optional field to order by, which must be one of the fields provided in
field
. Use-
for descending order, for example-sum(session)
.This alters the order of the
groups
returned, so it only makes sense in combination withgroupBy
.Ordering by more than one field is currently not supported.
query
(string)A free-form query that is applied as a filter.
An example query could be
release:"1.1.0" or release:"1.2.0"
.statsPeriod
(string)This defines the range of the time series, relative to now.
The range is given in a
"<number><unit>"
format.For example
1d
for a one day range. Possible units arem
for minutes,h
for hours,d
for days andw
for weeks.It defaults to
90d
.interval
(string)This is the resolution of the time series, given in the same format as
statsPeriod
.The default resolution is
1h
and the minimum resolution is currently restricted to1h
as well.Intervals larger than
1d
are not supported, and the interval has to cleanly divide one day.statsPeriodStart
(string)This defines the start of the time series range, in the same format as the
interval
, relative to now.statsPeriodEnd
(string)This defines the end of the time series range, in the same format as the
interval
, relative to now.start
(string)This defines the start of the time series range as an explicit datetime.
end
(string)This defines the inclusive end of the time series range as an explicit datetime.
Scopes
<auth_token>
requires one of the following scopes:org: read
curl https://sentry.io/api/0/organizations/{organization_slug}/sessions/ \ -H 'Authorization: Bearer <auth_token>'
{
"start": "2021-02-01T00:00:00Z",
"end": "2021-02-04T00:00:00Z",
"intervals": [
"2021-02-01T00:00:00Z",
"2021-02-02T00:00:00Z",
"2021-02-03T00:00:00Z"
],
"groups": [
{
"by": {
"session.status": "healthy"
},
"totals": {
"sum(session)": 1715553
},
"series": {
"sum(session)": [
683772,
677788,
353993
]
}
},
{
"by": {
"session.status": "abnormal"
},
"totals": {
"sum(session)": 0
},
"series": {
"sum(session)": [
0,
0,
0
]
}
},
{
"by": {
"session.status": "crashed"
},
"totals": {
"sum(session)": 383
},
"series": {
"sum(session)": [
33,
26,
324
]
}
},
{
"by": {
"session.status": "errored"
},
"totals": {
"sum(session)": 1565
},
"series": {
"sum(session)": [
163,
201,
1201
]
}
}
]
}