GoogleCloudPlatform / functions-framework

The Contract for Building New Function Frameworks
Apache License 2.0
120 stars 12 forks source link

Assign HTTP header `traceparent` as `cloudevent.traceparent` #47

Closed grant closed 3 years ago

grant commented 3 years ago

More narrow definition of https://github.com/GoogleCloudPlatform/functions-framework/issues/34, the Functions Framework contract should have a specific section around exposing the trace ID of an event-driven function to the user.

Specifically, we can expose:

Header

User Function parameter

See CloudEvent extension for more details: https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md


The older x-cloud-trace-context does not need to be propagated. This is an older value that is replaced by the standard W3C trace context header.

See: https://cloud.google.com/endpoints/docs/openapi/tracing#supported_headers