functions-framework-php icon indicating copy to clipboard operation
functions-framework-php copied to clipboard

Expose trace IDs in cloud event functions

Open roffjulie opened this issue 5 years ago • 1 comments

The X-Cloud-Trace-Context header is included in requests, but as we don't expose headers to the event-style functions it is inaccessible. This value is the only means of grouping StackDriver logs by request, and so we should expose it to the user function code.

The trace ID should be encoded as an extension on the event, leveraging the traceparent extension field as described in https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md.

roffjulie avatar Aug 13 '20 22:08 roffjulie

General discussion about exposing HTTP headers in https://github.com/GoogleCloudPlatform/functions-framework/issues/34

grayside avatar Sep 08 '20 16:09 grayside

Closing this in favor of the https://github.com/GoogleCloudPlatform/functions-framework/issues/34 issue which we'll use to standardize behavior across languages.

josephlewis42 avatar Apr 21 '23 18:04 josephlewis42