Using Sentry Release Tracking to Turn Deployments Into Error-Aware Rollbacks
Learn how to tag every Sentry event with a release ID, power the Release Health dashboard, and make data-driven rollback decisions, with CI/CD examples for Python, JavaScript, and Java.
01 Apr 2026, 08:26 UTC

Why Release Tracking Matters for Modern Deployments
Every time you ship code, you want to know if the new version broke something. Sentry's Release Tracking automatically tags each error event with the exact deployment that produced it. This one piece of metadata turns a noisy error stream into a searchable, actionable view called the Release Health dashboard. From there, teams can spot spikes, compare releases, and decide whether to roll back, all without digging through logs.
What the Feature Gives You
- Automatic release tagging: Sentry attaches a release identifier to every event.
- Release Health dashboard: visualizes error rates per release, highlighting outliers.
- Auto-created releases: if a release object does not exist, Sentry creates it on the fly.
- Cross-language support: SDKs in Python, JavaScript, Java, Ruby, and more expose a simple
releaseoption. - No extra cost: available in both Sentry OSS and Sentry Cloud plans.
Setting Up Release Tracking in Your CI/CD Pipeline
The key is to set the release value before the first error event is sent. Typically, you pull the Git tag or semantic version from your CI environment and pass it to the SDK at startup. The examples below assume a current Sentry SDK version; check your SDK's changelog if you are pinned to an older major version.
Python (Django/Flask)
import os
import sentry_sdk
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
release=os.getenv("SENTRY_RELEASE") # e.g., "v1.2.3" or a commit SHA
)In your CI script (GitHub Actions example):
- name: Set Sentry Release
run: echo "SENTRY_RELEASE=$(git describe --tags --always)" >> $GITHUB_ENVJavaScript (Node.js)
const Sentry = require("@sentry/node");
Sentry.init({
dsn: process.env.SENTRY_DSN,
release: process.env.SENTRY_RELEASE // e.g., "v1.2.3"
});GitLab CI example:
variables:
SENTRY_RELEASE: $CI_COMMIT_TAGJava (Spring Boot)
import io.sentry.Sentry;
Sentry.init(options -> {
options.setDsn(System.getenv("SENTRY_DSN"));
options.setRelease(System.getenv("SENTRY_RELEASE")); // e.g., "v1.2.3"
});In Jenkins:
environment {
SENTRY_RELEASE = "${GIT_COMMIT}" // or use a tag
}Verifying the Release Tag in Sentry
- Deploy the updated code to a staging environment.
- Trigger a controlled error (for example, throw an exception in a test route).
- Open the Sentry web UI and navigate to Releases > Release Health.
- Locate the release you just deployed; you should see the triggered error counted against it.
- Click into the event details and confirm the
releasefield in the event payload matches the tag you set. - Optional: use the Sentry REST API to list releases. Run this anywhere with network access, using an auth token with project read permissions:
Replacecurl -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ https://sentry.io/api/0/projects/ORG/PROJECT/releases/ORGandPROJECTwith your slugs. Treat the token as a secret and never commit it.
Practical Decision: When to Roll Back
The Release Health dashboard gives you a quick visual cue. A new release that shows a sudden increase in error rate compared to its predecessor is a candidate for rollback. However, weigh these trade-offs:
- Frequent deploys vs. dashboard noise: if you deploy every commit, the dashboard fills with releases. Group by major or minor version, or filter by environment, to keep it readable.
- Microservice architectures: in a poly-repo setup, each service should tag releases independently. Otherwise the global dashboard mixes unrelated errors and attribution becomes misleading.
- Consistent naming: mixing tags and commit hashes fragments data. Pick one convention; tags are recommended because they are human-readable and immutable.
Limitations and Edge Cases
- Events sent before the release tag is set get attributed to the previous release or an unknown release, so initialize the SDK as early as possible.
- Large teams auto-creating releases for many services can clutter the release list; pre-create releases via the API or share a naming scheme.
- Release Health only shows releases with at least one event, so a silent-but-broken deploy will not stand out on its own.
Actionable Checklist
- Set
releasein every SDK before the first error is reported. - Use Git tags or CI environment variables to keep release names consistent.
- Verify the release appears in Release Health after a test deployment.
- Define a threshold (for example, 2x the previous error rate) for rollback alerts.
- Document the release naming convention in your team's deployment guide.
By integrating Release Tracking into your pipeline, you turn every deployment into a data-driven checkpoint. The next time an error spikes, you will know exactly which code pushed it, and you can roll back or investigate with confidence.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.