Skip to content

feat(zebrad): align Sentry CI metadata and environments - #10490

Merged
gustavovalverde merged 8 commits into
mainfrom
align-sentry-observability
Apr 20, 2026
Merged

feat(zebrad): align Sentry CI metadata and environments#10490
gustavovalverde merged 8 commits into
mainfrom
align-sentry-observability

Conversation

@gustavovalverde

@gustavovalverde gustavovalverde commented Apr 16, 2026

Copy link
Copy Markdown
Member

Motivation

Align Zebra's observability metadata and environment naming across GitHub Actions, GCP labels, and Sentry.

Closes #10169

Solution

  • standardize workflow environment routing on dev, stage, and prod
  • upgrade the Rust Sentry SDK to 0.47, enable Sentry Logs, and keep OpenTelemetry available in the default release feature set
  • pass runtime Sentry metadata through Sentry-native and CI-native environment variables instead of Zebra-prefixed config-like variables
  • use github-slug-action's cleaned ref values for Sentry git.ref, while keeping the compiled build SHA as the primary git.sha
  • simplify the zebrad Sentry integration so application startup only calls a single Sentry init helper
  • update the user and operations docs to match the new observability model

Tests

  • cargo fmt --all -- --check
  • cargo check -p zebrad --features default-release-binaries --locked
  • cargo test -p zebrad metadata_ --features default-release-binaries --locked
  • cargo clippy --workspace --all-features --all-targets -- -D warnings

Follow-up Work

  • Split the live Sentry alert rules by environment once the first stage event exists in the Sentry project.
  • Keep the GitHub stage environment variables aligned with dev in repository settings.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: Codex for implementation, workflow/doc updates, validation runs, and PR drafting.

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand, or is maintainer-authored work covered by the AGENTS.md bypass.
  • The solution is tested.
  • The documentation and changelogs are up to date.

Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Dismissed
Comment thread .github/workflows/zfnd-deploy-nodes-gcp.yml Dismissed
@gustavovalverde gustavovalverde added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement I-usability P-Medium ⚡ labels Apr 16, 2026
@gustavovalverde
gustavovalverde requested a review from Copilot April 16, 2026 16:56
@gustavovalverde gustavovalverde changed the title feat(observability): align Sentry CI metadata and environments feat(zebrad): align Sentry CI metadata and environments Apr 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns Zebra’s observability metadata across runtime (Sentry SDK), CI (GitHub Actions), and GCP deployments by standardizing environment naming (dev / stage / prod) and moving Sentry metadata to Sentry/GitHub-native env vars.

Changes:

  • Refactors zebrad Sentry initialization to a single helper that applies consistent tags/CI context and enables Sentry Logs + a filtered tracing layer.
  • Updates release feature defaults and docs so OpenTelemetry support is included in official release builds (export still opt-in via endpoint config).
  • Adjusts GCP/GitHub Actions workflows and documentation to use standardized environment labels.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
zebrad/src/sentry.rs New metadata collection (env + CI), unified Sentry init helper, and custom tracing layer filtering.
zebrad/src/lib.rs Makes the sentry module crate-private.
zebrad/src/components/tracing/component.rs Switches to the crate’s Sentry tracing layer helper.
zebrad/src/application.rs Simplifies Sentry init call site to use the new helper.
zebrad/Cargo.toml Adds opentelemetry to default-release-binaries; enables Sentry logs feature.
Cargo.toml Bumps workspace sentry dependency to 0.47.
Cargo.lock Updates dependency graph for Sentry 0.47 and transitive deps.
docker/docker-compose.observability.yml Builds with default-release-binaries only (now includes OTel).
docs/decisions/devops/0006-gcp-deployment-naming.md Documents standardized environment label values.
book/src/user/tracing.md Documents OTel export + new Sentry env var model/metadata.
book/src/user/run.md Lists opentelemetry as included in release builds.
book/src/user/docker.md Updates feature-build examples and observability compose wording.
book/src/dev/gcp-deployment-operations.md Updates ops docs to use dev/stage/prod labels.
book/src/dev/continuous-delivery.md Updates continuous delivery model/table to use dev/stage/prod.
.github/workflows/zfnd-find-cached-disks.yml Adds environment input and updates environment routing expression.
.github/workflows/zfnd-deploy-nodes-gcp.yml Standardizes environment mapping and passes Sentry metadata env vars into containers.
.github/workflows/zfnd-deploy-integration-tests-gcp.yml Adds job environments + passes Sentry metadata env vars into test containers.
.github/workflows/zfnd-build-docker-image.yml Updates environment input default and environment routing expression.

Comment thread .github/workflows/zfnd-build-docker-image.yml Outdated
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Outdated
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Outdated
Comment thread .github/workflows/zfnd-deploy-integration-tests-gcp.yml Outdated
Comment thread Cargo.toml
Comment thread docker/docker-compose.observability.yml Outdated
Comment thread .github/workflows/zfnd-find-cached-disks.yml
Sentry scope tags only flow to Events; Logs go through a separate
`prepare_log` path where `Scope::apply_to_log` only propagates
trace/user fields. CI and git metadata set via `scope.set_tag`
were therefore missing from every Log record we emit.

Wire `ClientOptions.before_send_log` to merge the same tags and
CI context (namespaced under `ci.*`) into each outgoing Log, with
tracing event fields taking precedence via entry/or_insert_with.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

…ility

# Conflicts:
#	CHANGELOG.md
#	Cargo.lock

@oxarbitrage oxarbitrage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The enriched metadata should make Sentry issues more actionable. I'll keep an eye on the dashboard after merge to confirm the tags are flowing through as expected and that WARN-level log volume stays reasonable.

CI failures are unrelated: cargo-vet needs new audit entries for the v4.3.1 deps (main-branch issue), and the integration test failures are GitHub infra flakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement C-feature Category: New features P-Medium ⚡ run-stateful-tests Allos to manually trigger a stateful tests run in GCP in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Improve Sentry integration

5 participants