Route observability logs to Google Cloud Logging - #142
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anth-volk
force-pushed
the
google-cloud-logging-consumer
branch
from
July 3, 2026 22:37
3a3415d to
8624e07
Compare
|
Beta preview has been cleaned up because this PR was closed. |
anth-volk
marked this pull request as ready for review
July 3, 2026 22:48
This was referenced Jul 3, 2026
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.
Fixes #141
Summary
Routes deployed observability logs to Google Cloud Logging, using the destination features of
policyengine-observability1.1–1.3 (now pinned on main as==1.3.1):policyengine-observabilitywith the[google]extra ([fastapi,httpx,google]==1.3.1).google_cloud_loggingdestination; local/dev stays onstdout. Platform detection gains Cloud Run (K_SERVICE/K_REVISION) alongside the existing Modal detection, with anOBSERVABILITY_PLATFORMoverride, andOBSERVABILITY_LOG_DESTINATIONSremains the escape hatch.cloud_run_service/cloud_run_revision/cloud_run_configuration/google_cloud_project, and those keys join the metric attribute allowlist.OBSERVABILITY_GOOGLE_CLOUD_PROJECT,OBSERVABILITY_GOOGLE_WORKLOAD_IDENTITY_PROVIDER,OBSERVABILITY_GOOGLE_SERVICE_ACCOUNT_EMAIL— repo vars with defaults) flows into the production and preview Modal secrets indeploy.yml/pr-beta-deploy.yml; no service-account JSON.OBSERVABILITY_LOG_DESTINATIONS=stdoutso unit tests never touch the Google network seam — including the pre-existing modal metadata test, which the new deployed-platform default would otherwise have turned into a live gRPC call.History note
An earlier revision carried a second commit ("Use dataset-free compiled parameter export") gated on PolicyEngine/policyengine-uk-v2#112. That commit was dropped in the rebase: #175 solved the same problem with explicit
dataset="frs"selection, and the upstream dataset-free export API remains unreleased. If uk-v2#112 ships, the simplification can return as a small follow-up PR.Verification
Full backend suite in a fresh Python 3.13 venv from this branch's requirements (observability 1.3.1 + google-cloud-logging 3.16.0): 241 passed, 10 skipped. The suite also caught and fixed a live-network hazard: with GCL as the deployed default, emission-path tests attempted real Cloud Logging writes (observed as a gRPC 404 against the placeholder project locally); those now pin stdout per the testing skill's network-seam rule.
Deploy prerequisites
observability-writerservice account referenced by the workflow defaults must exist and trust the Modal identity (see the observability repo's Stage 3 runbook).OBSERVABILITY_GOOGLE_*optionally override the defaults.🤖 Generated with Claude Code