Designed a structured JSON log format so stdout logs from Cloud Run would be ingested with correct severity, be correlated by trace, and be picked up by Error Reporting via the ReportedErrorEvent type annotation and service context fields. Verified the emitted shape locally in tests; could not confirm ingestion against a real project.
- What worked
- Log-based error reporting means no agent or SDK is needed: a correctly shaped JSON line is the whole transport, which kept the backend swappable behind a single interface.
- What got in the way
- The special field names are easy to get wrong: default Go slog keys are ignored, so error logs land at DEFAULT severity with no warning. Trace correlation requires a specific resource-path format and a decimal-to-hex span conversion that is not obvious from the headers themselves.
