Skip to content

Re-land Google Cloud Logging routing with kill-switch and startup diagnostics - #178

Merged
anth-volk merged 3 commits into
mainfrom
fix/gcl-routing-reland
Jul 3, 2026
Merged

Re-land Google Cloud Logging routing with kill-switch and startup diagnostics#178
anth-volk merged 3 commits into
mainfrom
fix/gcl-routing-reland

Conversation

@anth-volk

@anth-volk anth-volk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #141

Re-lands #142 (reverted in f743750 after the production outage) now that the root cause is fixed and verified, plus the operational rails that make a recurrence recoverable in seconds instead of a revert cycle.

Root cause of the outage — fixed and proven

The WIF provider mapped google.subject = assertion.sub; Modal's sub (full function identity) exceeds GCP's 127-byte limit, so every STS exchange failed after ~25s of internal retries, per log write, inside the request path. The provider now maps google.subject = assertion.workspace_id + "/" + assertion.app_name, which is provably ≤ 90 bytes for any app this workspace can create (measured workspace_id: 25 bytes; Modal caps app names at 64). Verified end to end: a Modal container exchanged its real identity token through the remapped provider and wrote to Cloud Logging in 2.1s, and the entry is queryable in policyengine-api.

What this PR adds beyond the revert-of-revert

  • OBSERVABILITY_LOG_DESTINATIONS set explicitly in every Modal secret: previews default to google_cloud_logging (the live test bed — peukchat-* is already in the provider trust condition); production stays on stdout until the OBSERVABILITY_LOG_DESTINATIONS_PRODUCTION repo variable flips it. Any future destination failure is recoverable by changing a variable and redeploying — no revert.
  • Startup diagnostic line: platform, chosen destinations, and identity-token presence logged in each container's first seconds.

Merge preconditions

Rollout

  1. Merge → previews exercise WIF+GCL live; verify entries arrive (jsonPayload.service_name="policyengine-uk-chat" in policyengine-api).
  2. Set OBSERVABILITY_LOG_DESTINATIONS_PRODUCTION=google_cloud_logging → next deploy routes production logs; smoke test guards it.

Verification

Backend suite with this branch: 241 passed, 10 skipped.

🤖 Generated with Claude Code

anth-volk and others added 2 commits July 4, 2026 01:24
Set OBSERVABILITY_LOG_DESTINATIONS explicitly in every Modal secret:
previews default to google_cloud_logging as the live test bed, and
production stays on stdout until the repo variable flips it — recovery
from any future destination failure is a secret change, not a revert.
Log one startup line (platform, destinations, identity-token presence)
so a misrouted destination is visible in a container's first seconds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-uk-chat Ready Ready Preview, Comment Jul 3, 2026 11:40pm

Request Review

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Beta preview has been cleaned up because this PR was closed.

…breaker

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anth-volk
anth-volk marked this pull request as ready for review July 3, 2026 23:43
@anth-volk
anth-volk merged commit f172d7c into main Jul 3, 2026
7 of 8 checks passed
@anth-volk
anth-volk deleted the fix/gcl-routing-reland branch July 3, 2026 23:43
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.

Route UK Chat observability logs to Google Cloud Logging

1 participant