Observability 相関ガイド¶
概要¶
Storefront / Vendure / React Dashboard / Playwright / GitHub Actions / Sentry を横断して障害を辿るときは、個別のログや artifact を別々に見るのではなく、同じ相関 ID で join する。
本ドキュメントは、現在の実装で使う識別子、artifact の見方、triage の順序を 1 か所にまとめた正本である。個別 workflow や監視プローブの詳細は 監視・運用設計書 を参照する。
使う識別子¶
requestId¶
- HTTP / GraphQL リクエスト単位の相関 ID。
- 主に application log、browser log ingest、Sentry breadcrumb の join に使う。
- Storefront から Vendure へは
x-request-idで伝搬する。 - Playwright 実行時は test identity から決定的に生成し、runtime request と同じ値を使う。
traceId¶
- observability 全体で使う trace 単位の ID。
traceparentの 32 桁 16 進 trace id を使う。- runtime log、Sentry context、Playwright manifest、CI artifact summary を横断するときの主キーとして扱う。
requestIdと同一視しない。
spanId¶
traceId配下の span 単位の ID。traceparentの 16 桁 16 進 span id を使う。- Playwright から注入された request と、Vendure / Storefront の 1 回の処理を細かく追うときに使う。
workflowTraceId¶
- GitHub Actions の workflow run 単位の相関 ID。
- workflow archive、job attachment、Playwright manifest、Sentry diagnostics bundle を同じ run として join するときに使う。
repository,run_id,run_attemptから決定的に生成する。
testCorrelationId¶
- Playwright test case 単位の相関 ID。
- test title, project, retry から決定的に生成する。
- Playwright manifest の entry と runtime header 注入の seed を一致させるために使う。
伝搬ルール¶
HTTP headers¶
- Storefront inbound:
x-request-idtraceparent- Storefront -> Vendure:
x-request-idtraceparent- browser log ingest:
- browser logger payload に
requestId,traceId,spanId,route,sourceを含める
runtime surface¶
- Storefront server:
- 構造化ログに
requestId,traceId,spanId,surface,source,routeを出す - Storefront browser:
- browser logger と
/api/client-logspayload に同じ field 名を使う - Vendure runtime:
- Sentry context から
observationContextを作り、logger child binding と同じ field 名を使う - React Dashboard browser:
- admin API request と browser event で
x-request-idを共有する
構造化ログ contract¶
現在の構造化ログは、少なくとも以下の field を基準に join する。
timestampserviceenvironmentsurfacesourcemessagerequestIdtraceIdspanIdrouteoperationNameoperationTypecontexterror
補足:
- Vendure logger は
messagekey を正本とし、pino既定のmsgは使わない。 - Vendure の logger child binding は
requestId,traceId,spanId,operationName,operationType,fieldName,apiType,channelId,customerCode,actorTypeを保持できる。 - Sentry 側の
observationContextと logger binding は同じ vocabulary を使う。
Playwright artifact contract¶
Playwright artifact の manifest.json には以下を含める。
- top-level:
schemaVersiongeneratedAtappsuiteworkflowTraceIdrunIdrunAttempt- entry:
appsuiteprojecttestTitletestCorrelationIdrequestIdtraceIdspanIdretrystatusworkflowTraceIdartifacts[]
artifacts[] の kind は以下を使う。
tracevideoscreenshotattachment
GitHub Actions artifact chain¶
workflow 失敗時は、以下の順に辿る。
- workflow archive の
summary.mdでworkflowTraceIdを確認する。 - workflow archive の
artifacts.jsonで attachment artifact を確認する。 - job attachment artifact の
manifest.jsonを開き、detectedManifests[]を見る。 detectedManifests[]から nested manifest を選ぶ。playwright-artifactssentry-diagnosticsworkflow-archive- Playwright manifest の
requestId/traceId/spanIdから runtime log と Sentry event を辿る。
失敗時の基本 triage¶
browser / E2E failure¶
- workflow archive で
workflowTraceIdを確認する。 - job attachment manifest の
detectedManifests[]から Playwright artifact を開く。 - failure test の entry から
requestId/traceId/spanIdを取る。 - 同じ ID を持つ Storefront / Vendure の構造化ログを見る。
- 同じ
traceIdを持つ Sentry diagnostics / event / replay を見る。
observability chain failure¶
- workflow の
Verify observability chainstep を確認する。 - attachment manifest に
playwright-artifactsとsentry-diagnosticsが並んでいるか確認する。 - nested manifest の
workflowTraceIdが一致しているか確認する。 - Playwright entry に
requestId/traceId/spanIdが欠けていないか確認する。
どの文書を見るか¶
- workflow / monitor / fallback probe の運用手順: 監視・運用設計書
- workflow archive と attachment manifest の仕様: 2026-03 GitHub Actions ログ artifact 保管・構造化要件
- staging の Sentry diagnostics 要件: 2026-04 staging Sentry diagnostics workflow 要件