Releases & Health

A release is a version of your code that is deployed to an environment. When you give Sentry information about your releases, you can:

  • Determine issues and regressions introduced in a new release
  • Predict which commit caused an issue and who is likely responsible
  • Resolve issues by including the issue number in your commit message
  • Receive email notifications when your code gets deployed

Additionally, releases are used for applying source maps to minified JavaScript to view original, untransformed source code.

Bind the Version

Include a release ID (often called a "version") when you configure your client SDK.

The release name cannot:

  • contain newlines, tabulator characters, forward slashes(/) or back slashes(\)
  • be (in their entirety) period (.), double period (..), or space ( )
  • exceed 200 characters

The value can be arbitrary, but we recommend either of these naming strategies:

  • Semantic Versioning: package@version or package@version+build (for example, my.project.name@2.3.12+1234)
    • package is the unique identifier of the project/app (CFBundleIdentifier on iOS, packageName on Android)
    • version is the semver-like structure <major>.<minor?>.<patch?>.<revision?>-<prerelease?> (CFBundleShortVersionString on iOS, versionName on Android)
    • build is the number that identifies an iteration of your app (CFBundleVersion on iOS, versionCode on Android)
  • Commit SHA: If you use a DVCS, we recommend using the identifying hash (for example, the commit SHA, da39a3ee5e6b4b0d3255bfef95601890afd80709). You can let Sentry CLI automatically determine this hash for supported version control systems with sentry-cli releases propose-version.
AndroidManifest.xml
Copied
<application>
  <meta-data android:name="io.sentry.release" android:value="io.example@1.1.0" />
</application>

Or, if you are manually instrumenting Sentry:

Copied
SentryAndroid.init(this, options -> {
  options.setRelease("io.example@1.1.0");
});

If no release name is set the SDK creates a default combined of packageName, versionName and versionCode, for example my.project.name@2.3.12+1234.

How you make the version available to your code is up to you. For example, you could use an environment variable that is set during the build process.

This tags each event with the release value. We recommend that you tell Sentry about a new release before deploying it, as this will unlock a few more features as discussed in our documentation about releases. But if you don’t, Sentry will automatically create a release entity in the system the first time it sees an event with that release ID.

After configuring your SDK, you can install a repository integration or manually supply Sentry with your own commit metadata. Read our documentation about setting up releases for further information about integrations, associating commits, and telling Sentry when deploying releases.

Release Health

Monitor the health of releases by observing user adoption, usage of the application, percentage of crashes, and session data. Release health will provide insight into the impact of crashes and bugs as it relates to user experience, and reveal trends with each new issue through the release details, graphs, and filters.

The SDK will automatically manage the start and end of the sessions when the SDK is initialized.

To benefit from the health data, you must use at least version 2.1.0 of the Android SDK, and enable the collection of release health metrics in the initialization options for the SDK. Release health is captured, by default, in our Android version 3.0 and higher, unless you specifically disabled collecting it in the initialization options for the SDK.

By default, the session is terminated once the application is in the background for more than 30 seconds. You can change the time out with the option named sessionTrackingIntervalMillis. It takes the amount in milliseconds. For example, to configure it to be 60 seconds:

AndroidManifest.xml
Copied
<application>
  <meta-data android:name="io.sentry.session-tracking.timeout-interval-millis" android:value="60000" />
</application>

Or, if you are manually instrumenting Sentry:

Copied
import io.sentry.android.core.SentryAndroid;

SentryAndroid.init(this, options -> {
  options.setSessionTrackingIntervalMillis(60000);
});

If you'd like to opt-out of this feature, you can do it via options.

AndroidManifest.xml
Copied
<application>
  <meta-data android:name="io.sentry.session-tracking.enable" android:value="true" />
</application>

Or, if you are manually instrumenting Sentry:

Copied
import io.sentry.android.core.SentryAndroid;

SentryAndroid.init(this, options -> {
  options.setEnableSessionTracking(true);
});

AndroidX Support

Sentry uses the androidx.lifecycle libraries for detecting when the application is either in the background or in the foreground. This is necessary for producing accurate results across all the Android OS versions.

We check at runtime for availability, so if you're not using androidx.lifecycle libraries, you can remove them from Sentry's transitive dependencies.

Copied
implementation ('io.sentry:sentry-android:7.13.0') {
    exclude group: 'androidx.lifecycle', module: 'lifecycle-process'
    exclude group: 'androidx.lifecycle', module: 'lifecycle-common-java8'
}

Be aware that by removing those transitive dependencies, the automatic session tracking won't work, but you can still do it manually by calling the public APIs Sentry.startSession() and Sentry.endSession().