An error count without a release attached is a guess. When a spike appears, the first question is always the same: which build is causing this? If your exception events cannot answer that, you end up comparing timestamps against deploy logs and hoping they line up.
posthog-js 1.409.0 helps with this. It adds $release_id to $exception events, using the release id that posthog-cli injects into your bundle. A later posthog-cli update also added a --release-mode option for the inject, upload and process commands. Together they let each error point back to a specific release and its uploaded source maps.
Data Points to Track
- $release_id: the release identifier on each
$exceptionevent - exception_type: the error class or name
- exception_message: the sanitised message text
- release_version: your own version label for the build
- first_seen_release: the earliest release in which an error group appeared
- events_without_release_id: exceptions that arrive with no release attached
- sourcemap_resolved: whether the stack trace was symbolicated
- environment: production, staging or preview
- deploy_timestamp: when the release went live
- affected_users: distinct users hit per release
Setup Steps
- Upgrade posthog-js to 1.409.0 or later.
- Update posthog-cli to a version that supports
--release-mode. - Inject the release id into your production bundle as part of the build.
- Upload source maps in the same pipeline step, so the release and its maps stay paired.
- Deploy and trigger a test error in a staging build.
- Confirm the
$exceptionevent carries a$release_idand a readable stack trace. - Build an insight that breaks exception counts down by
$release_id. - Alert on any release whose error rate exceeds the previous one by a set margin.
Actionable Insights
Break exceptions down by release and the picture changes fast. A new error group that appears only in the latest release is almost certainly a regression. An old group that disappears after a release tells you a fix worked.
Watch the share of exceptions with no $release_id. A high number usually means a build path skipped the inject step, such as a hotfix pipeline or a preview deploy. Those errors are the hardest to trace, so fix the pipeline first.
Compare error rate per active user, not raw counts. A release with more errors may simply have more traffic. Dividing by users shows whether quality really changed.
If stack traces stay unreadable, check that the uploaded source maps match the injected release id. A mismatch is the most common cause.
Common Pitfalls
Do not reuse one release id across builds. If two bundles share an id, the maps and errors blur together.
Do not inject the id in development. Local noise will drown the production signal.
Do not forget cached bundles. Users on an old cached build keep reporting the previous release id, which is correct, but it can look like a regression if you only read the latest release.
Why Product Teams Should Care
Error data becomes useful to product managers when it maps to a release. You can say which version caused a drop in conversion, and decide whether to roll back or patch, with evidence instead of a hunch.
Example Scenario
A team ships a checkout change on a Tuesday. Errors rise on Wednesday, but traffic also rose after a campaign. Broken down by $release_id, the new release shows a fresh TypeError that the previous release never produced, affecting about 2% of checkout users. The team patches within hours and confirms the group stops appearing in the following release.