feat(zebrad): align Sentry CI metadata and environments - #10490
Conversation
There was a problem hiding this comment.
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
zebradSentry 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. |
d7ceaa5 to
9cfac98
Compare
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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Motivation
Align Zebra's observability metadata and environment naming across GitHub Actions, GCP labels, and Sentry.
Closes #10169
Solution
dev,stage, andprod0.47, enable Sentry Logs, and keep OpenTelemetry available in the default release feature setgithub-slug-action's cleaned ref values for Sentrygit.ref, while keeping the compiled build SHA as the primarygit.shazebradSentry integration so application startup only calls a single Sentry init helperTests
cargo fmt --all -- --checkcargo check -p zebrad --features default-release-binaries --lockedcargo test -p zebrad metadata_ --features default-release-binaries --lockedcargo clippy --workspace --all-features --all-targets -- -D warningsFollow-up Work
stageevent exists in the Sentry project.stageenvironment variables aligned withdevin repository settings.AI Disclosure
PR Checklist
type(scope): descriptionAGENTS.mdbypass.