GoogleCloudPlatform / functions-framework-python

FaaS (Function as a service) framework for writing portable Python functions
https://pypi.org/p/functions-framework/
Apache License 2.0
869 stars 118 forks source link

Expose trace IDs in background and cloud event functions #79

Open roffjulie opened 4 years ago

roffjulie commented 4 years ago

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.

Background events: The trace ID should be available in the context parameter.

CloudEvents: 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.

jacobg commented 3 years ago

I'd love to have this header available in pubsub-triggered functions please!

swa-licand commented 3 years ago

and I'd love to have this header available in cloud storage triggered functions :)

jaksky commented 1 year ago

Any update on this?