Skip to content

feat(observability): add gateway structured request logs - #68

Merged
seonghobae merged 1 commit into
mainfrom
feat/gateway-structured-logging
Aug 3, 2026
Merged

feat(observability): add gateway structured request logs#68
seonghobae merged 1 commit into
mainfrom
feat/gateway-structured-logging

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

Implements #66 as the next bounded slice of #64 after the gateway SLO foundation in #65.

  • adds an AsyncLocalStorage request context containing only a validated UUIDv4 correlation identifier
  • adds a fixed-schema CredentialFreeJsonLogger for HTTP completion and sanitized observability-failure records
  • emits exactly one completion record for normal, synchronous-failure, and client-aborted gateway requests
  • preserves the bounded route inventory and collapses unknown concrete paths to /unmatched
  • excludes headers, query strings, payloads, concrete identifiers, tenant data, credentials, exception messages, and stacks from the logger API
  • isolates metrics, clock, context, and writer failures from the request pipeline
  • adds deterministic package and gateway tests for async propagation, nested restoration, exact schemas, secret exclusion, de-duplication, aborted requests, metric failures, writer failures, and synchronous failures
  • updates the gateway SLO runbook and formatting gate

Scope boundary

This slice does not implement HTTP trace-context parsing, downstream propagation, service-to-service instrumentation, OpenTelemetry exporters, managed log storage, retention automation, dashboards, or alert delivery. Those remain follow-up work in #64.

Validation gate

Merge only when formatting, lint, type checking, tests, build, AppGuardrail, SAST Semgrep, Security Scan, Commercial Readiness, CodeRabbit, and all human/security review feedback pass on the exact current head with no unresolved actionable findings.

Closes #66. Refs #64 and #21.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07621ca9-c003-4cd7-9593-209570fb74e0

📥 Commits

Reviewing files that changed from the base of the PR and between df35e53 and 2d28fb0.

📒 Files selected for processing (8)
  • apps/gateway/src/observability.test.ts
  • apps/gateway/src/observability.ts
  • docs/operations/service-level-objectives.md
  • docs/superpowers/plans/2026-08-04-gateway-structured-logging-slice.md
  • package.json
  • packages/observability/src/index.cjs
  • packages/observability/src/index.d.ts
  • packages/observability/src/index.test.cjs

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gateway request context and credential-free structured logs

1 participant