2026-04 staging Sentry diagnostics workflow 要件¶
位置づけ¶
staging 環境で実施する Storefront 向け E2E / smoke の失敗時に、GitHub Actions の raw log だけでなく、Sentry 上の issue / event / trace 情報も同じ workflow run から辿れるようにするための追加要件。
本要件は Sentry Logs を二次相関チャネルとして限定採用する。JS runtime(Storefront / Vendure / React Dashboard)では warn / error の console ログ転送と browser failed request capture を有効化する一方、ログの system of record は引き続き GitHub Actions artifact / アプリ側構造化ログとする。Storefront browser は Session Replay を有効とし、React Dashboard browser も admin API 相関付きの Session Replay を有効にして、triage 時に feedback / event / trace を横断できるようにする。Vendure runtime は staging でも Node Profiling を有効化し、slow transaction では Profile タブから CPU profile を辿れるようにする。また Vendure の source map は staging でも CI から artifact upload した sourcemap を正本とし、Fly runtime の source-map 解決は fallback として扱う。
あわせて、triage の初動短縮のため Storefront の Vendure GraphQL 失敗は
storefront.graphql_operation / graphql.operation_type / graphql.error_code
/ http.status_code / dependency.name=vendure を付与し、browser
surface(Storefront / React Dashboard)は conservative な beforeSend
で browser
extension 由来ノイズを除外しつつ、request/context/breadcrumb の sensitive
field を redactする。
適用範囲¶
staging-smoke-storefront.ymlstaging-sentry-smoke-storefront.yml- Storefront の non-production debug route
/api/debug-sentry/api/client-logs
合意事項¶
- deploy 後レーン
staging-smoke-storefront.ymlは引き続きDeploy Staging成功後に起動する。- safe probe / critical smoke / 既存の real Playwright checks を維持しつつ、failure / cancelled 時に Sentry diagnostics snapshot を回収する。
-
diagnostics は、少なくとも deployed Storefront release と staging environment をキーに recent issues / events を取得する。
-
定期 canary レーン
staging-sentry-smoke-storefront.ymlは定期実行と手動実行で起動する。- browser feedback は常設 smoke に載せず、関係者が
?sentry-feedback=1を付けた manual 確認導線で扱う。 - staging 専用の intentional debug event を 1 件発生させる synthetic canary を行う。
- synthetic canary の認証は
SENTRY_DEBUG_SIGNING_SECRETを元鍵にした marker 束縛の request token を正本とし、他用途の secret を流用しないこと。 SENTRY_DEBUG_TOKENは非本番の手動疎通確認用に残してよいが、scheduled canaryの認証材料としては扱わないこと。-
canary 後に Sentry API から該当 event を取得し、workflow run ごとの相関を確認する。
-
run marker
- synthetic canary は workflow run ごとの marker を持つ。
- marker は request header
x-sentry-debug-markerまたは querymarkerから受け取れるようにする。 - Storefront 側は marker を Sentry tag
storefront.sentry_debug_markerと contextstorefront_debug.markerに付与する。 -
marker は英小文字、数字、
.、_、:、-を中心に扱い、長さは 96 文字以内に正規化する。 -
Sentry diagnostics artifact
- diagnostics collector は少なくとも以下を出力する。
manifest.jsonevents.jsonmatched-events.jsonissues.jsonsummary.md
summary.mdはGITHUB_STEP_SUMMARYに追記できる形式にする。- 既存の
collect-job-attachmentsで diagnostics bundle を artifact に含める。 - diagnostics
manifest.jsonとsummary.mdには、workflow archive / Playwright manifest と join するためのworkflowTraceIdを含める。 -
collect-job-attachmentsの attachment manifest は nested manifest を検出し、sentry-diagnostics/playwright-artifacts/workflow-archiveを列挙できること。 -
workflow log archive
staging-sentry-smoke-storefront.ymlにも workflow-level log archive を追加する。-
workflow_run起点で動いた場合はsource_workflow_run_idを保持できるようにする。 -
release 解決
- diagnostics collector が参照する release は GitHub の checkout
SHA ではなく、staging に現在配備されている Storefront の
/api/versionから解決する。 -
releaseが欠ける場合はcommitからstorefront@<commit>を組み立てる。 -
runtime triage metadata
- Storefront の Vendure GraphQL / HTTP failure は、少なくとも
storefront.graphql_operation、graphql.operation_type、graphql.error_code、http.status_code、dependency.name=vendureを Sentry tag/context に残す。 - Storefront の warn/error logger と browser client log は、
requestId/route/sourceを含む breadcrumb 相関を残す。 - Storefront / React Dashboard の browser surface は、browser
extension 由来ノイズを
beforeSendで除外し、token / cookie / authorization などの sensitive field は送信前に redact する。 - Storefront browser は Session Replay を有効とし、sample rate は
VITE_PUBLIC_SENTRY_REPLAYS_SESSION_SAMPLE_RATE/VITE_PUBLIC_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATEを正本とする。 - React Dashboard browser も Session Replay を有効とし、sample rate はコード定数(production: session 10%、non-production: session 100%、on-error 100%)を正本とする。
- React Dashboard の admin API request は
x-request-idを付与し、browser event / Replay から Vendure 側のrequest_id,actor_id,actor_type, contextdashboard_request,dashboard_adminを辿れること。 -
Vendure staging runtime は trace sample が 0 より大きいとき Node Profiling を有効化し、slow transaction の Profile タブから CPU profile を参照できること。
-
Vendure の stack trace は staging でも upload 済み sourcemap を通じて TypeScript の file/line まで遡れること。
受け入れ観点¶
staging-smoke-storefront.ymlが失敗またはキャンセルしたとき、artifact に Sentry diagnostics bundle が含まれること。staging-sentry-smoke-storefront.ymlが定期実行でSENTRY_DEBUG_SIGNING_SECRETから marker 束縛 token を生成して debug event を発生させ、その marker に一致する event を Sentry API から取得できること。- debug route が production では引き続き 404 / 無効であること。
- Storefront の Sentry tag / context に
storefront.sentry_debug_marker/storefront_debug.markerが含まれること。 monitoring-operations.mdとinfrastructure-and-environment.mdに triage 手順が反映されること。- Storefront の Vendure failure event に
graphql.error_code/http.status_code/dependency.name=vendureが含まれること。 - Storefront / React Dashboard の browser event が、browser extension 由来ノイズを送信せず、sensitive field を redact すること。
- React Dashboard の admin API 起点 event / Replay に
request_id,actor_id,actor_type,dashboard_request,dashboard_adminが含まれること。 - staging の Vendure slow transaction で Profile タブが利用でき、stack trace が upload 済み sourcemap を通じて TypeScript の file/line まで解決されること。