Skip to content

Set Sentry release explicitly in InitSentry #88

Description

@rappm

Backend events are sent to Sentry with an empty release, so there is no release/regression grouping, no "resolved in next release", and no suspect-commit attribution.

Why

utils/InitSentry never sets ClientOptions.Release. sentry-go then falls back to defaultRelease(), which scans env vars (SENTRY_RELEASE, GITHUB_SHA, ...). In the main repo the deploy only passed GITHUB_SHA to the frontend containers, not the Go server containers, so the fallback found nothing. The build-info VCS fallback also doesn't apply to the stripped Docker binaries.

The main repo now passes GITHUB_SHA into the backend server containers (so the env fallback works), but relying on the implicit fallback is fragile. It would be more robust to set Release explicitly here.

Proposed change

In utils/InitSentry, set Release from an explicit env var, e.g.:

Release: GetEnv("SENTRY_RELEASE", GetEnv("GITHUB_SHA", "")),

Leaving it empty if unset preserves current behavior. Consumers can then pass either SENTRY_RELEASE or the existing GITHUB_SHA.

This is the standalone release item split out of #87 (which also covers the expired-token fix and trace-sampling). Tracking it separately so the release change can land independently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions