Skip to content

Decouple request context and trace header from package:appengine - #9617

Merged
sigurdm merged 6 commits into
mainfrom
decouple-appengine-context-and-logging
Oct 1, 2026
Merged

sigurdm merged 6 commits into
mainfrom
decouple-appengine-context-and-logging

Conversation

@sigurdm

@sigurdm sigurdm commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Decouples request handling and trace propagation from package:appengine's ClientContext:

  • X-Cloud-Trace-Context propagation (app/lib/shared/utils.dart, app/lib/shared/handler_helpers.dart):
    • Extract the 32-character hex trace ID from X-Cloud-Trace-Context at the start of _logRequestWrapper and bind it to the request zone via withTraceId.
    • Read currentTraceId in cloudTraceHeaders() and _logRequestWrapper error responses instead of package:appengine's context.traceId.
  • HTTPS wrapper & FakeClientContext (app/lib/shared/handler_helpers.dart, app/lib/service/services.dart):
    • Use !envConfig.isRunningLocally instead of context.isProductionEnvironment in _httpsWrapper and remove FakeClientContext.

@sigurdm sigurdm changed the title Decouple request context, trace header, and logging from package:appengine Decouple request context and trace header from package:appengine Oct 1, 2026
@sigurdm
sigurdm added this pull request to stack #9640 October 1, 2026 09:58
@sigurdm
sigurdm requested a review from isoos October 1, 2026 10:49
@sigurdm
sigurdm merged commit 2082ce9 into main Oct 1, 2026
40 checks passed
@sigurdm
sigurdm deleted the decouple-appengine-context-and-logging branch October 1, 2026 11:08
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.

2 participants