feat: APMテレメトリ基盤 - #487
Draft
Ojoxux wants to merge 1 commit into
Draft
Conversation
Add shared createLogger utility and client-side telemetry sinks so debug console.log can be replaced with environment-aware logging. Sentry hooks are stubbed for web (window.Sentry) and API (SENTRY_DSN) until DSN is configured. Document observability env vars in .env.example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request 概要
ブラウザの
console.log氾濫(SON-10)への対応として、APM 連携の土台となるテレメトリ基盤を追加する。デバッグログは本番で破棄し、エラー・警告のみ外部サービスへ転送できる構成にする。変更内容
packages/utilsにcreateLoggerを追加(レベル制御・シンク差し替え可能)apps/web/src/lib/telemetryにcreateClientLoggerを追加debug/infoはコンソール出力debug/infoは破棄、warn/errorは Sentry シンクへ(DSN 未設定時は no-op)apps/apiにcaptureExceptionプレースホルダーとSENTRY_DSN型定義を追加monitoring.tsの Sentry 連携 TODO をcaptureException呼び出しに接続.env.exampleに Sentry 関連の環境変数を追記動作確認
npm run build --workspace=@sonory/utilsが成功することnpm run type-check --workspace=@sonory/webが成功することnpm run type-check --workspace=@sonory/apiが成功することconsole.log動作に影響がないこと関連Issue
レビューポイント
debug/infoがコンソールに出ない設計になっているか