# Track release health

See per release how many sessions and users ran without a crash, how far the release is adopted, and which issues it brought.

Set `release` in `Sentry.init`; the bundler plugins, and a connected app's builds, set it for you.
The SDKs then send sessions: a session is one visit in the browser (a page load or a navigation)
or one request on a server. Replace _project-id_ with the project's id.

## Prerequisites

- Permission for `errors:GetEvents` on the project. Without it, the **Releases** tab says "You can
  see this project but not its release health."
- In the console, also `errors:ListProjects` on the project to open it (without it the project is
  not found).

## See release health

**Console**
1. Open the project, then the **Releases** tab.
2. Choose **24 h** or **14 days**.
3. (Optional) When the sessions name more than one environment, choose one, so staging's crashes
   do not count against production's crash-free rate.

**CLI**
```sh
dcloud errors release-health list project-id --range 24h
```

**API**
```http
GET /errors/api/projects/project-id/release-health?range=24h
```

Add `environment=production` for one environment's sessions. Without `range`, the window is 14 days. Rows come most recently seen first, up to `limit` (50 by
default, at most 200); rates are between 0 and 1, null without sessions or known users.

| Column              | What it is                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Release             | The release, with how many issues were first seen in it. It opens the issues first or last seen in it, any status. |
| Crash-free sessions | Sessions without an unhandled error, rounded down, so a release with any crash never reads 100 %.                  |
| Crash-free users    | Users none of whose sessions crashed. Only users the app names (`Sentry.setUser`) count.                           |
| Sessions            | Sessions of the release in the window.                                                                             |
| Adoption            | The release's share of the project's sessions in the window.                                                       |

To be alerted when a release crashes more, see [Create an alert rule](create-an-alert-rule.md).

## What is kept

Sessions are kept for 90 days, whatever the project's retention. A user id is kept as a keyed hash,
never as given. A Node.js server also sends one session for its whole process; that session is
counted on the **Stats** tab but not kept, because its requests already count. Sessions are not
billed.

## List releases

`dcloud errors releases list` and `GET /errors/api/releases` list the organization's latest 100
releases that `sentry-cli` and the bundler plugins created, newest first; `projectId` keeps one
project's. This needs `errors:ListReleases` on the service, `rn:ews:de1:<organization id>:errors:*`.

## Related

- [Upload source maps](upload-source-maps.md)
- `errors.release-health.list` · `dcloud errors releases list`
