You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As of pubsub v1.42.0 and PR #10709 we now have OpenTelemetry tracing with spans propagating over publishers and pull subscribers! This is a very welcomed feature that will be very useful for understanding and debugging distributed systems.
However, there is currently no support in this library to extract the trace information when using HTTP push subscriptions.
Describe the solution you'd like
When receiving pubsub messages on a HTTP push endpoint, it would be nice to end up with a context which has the tracing information extracted from the pubsub message (specifically from its attributes, as it is implemented now).
We have a library that helps us handle pubsub push endpoints where we'd like to implement the trace extraction: cloudpubsub in our cloudrunner-go package (Go docs).
In our cloudpubsub library, we unmarshal the incoming HTTP data into a protobuf PubsubMessage as a reasonable typed message for the library users. Given this type, it would be nice to have a public function that can extract trace information from such a message.
I have a draft implementation on how that could look like here: #10827
with a corresponding change to our usage in cloudrunner-go here: cloudrunner-go#700
I have tested this locally with the pubsub emulator and the trace information are propagated nicely between publisher and subscribers.
Describe alternatives you've considered
As the solution above is implemented given our already existing handlers and types, I'm open for discussing a better approach which we can later adapt to inside cloudrunner-go 🙂
If it is possible for us to create a pubsub.Message in our HTTP handler, that would make it easier to just export the newMessageCarrier function.
A bigger alternative would be to have HTTP push subscription handlers in the cloud.google.com/go/pubsub package, which could do similar to what we're doing in our cloudpubsub library, but with trace extraction etc managed as well.
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
As of pubsub v1.42.0 and PR #10709 we now have OpenTelemetry tracing with spans propagating over publishers and pull subscribers! This is a very welcomed feature that will be very useful for understanding and debugging distributed systems.
However, there is currently no support in this library to extract the trace information when using HTTP push subscriptions.
Describe the solution you'd like
When receiving pubsub messages on a HTTP push endpoint, it would be nice to end up with a context which has the tracing information extracted from the pubsub message (specifically from its attributes, as it is implemented now).
We have a library that helps us handle pubsub push endpoints where we'd like to implement the trace extraction: cloudpubsub in our cloudrunner-go package (Go docs).
In our cloudpubsub library, we unmarshal the incoming HTTP data into a protobuf PubsubMessage as a reasonable typed message for the library users. Given this type, it would be nice to have a public function that can extract trace information from such a message.
I have a draft implementation on how that could look like here: #10827
with a corresponding change to our usage in cloudrunner-go here: cloudrunner-go#700
I have tested this locally with the pubsub emulator and the trace information are propagated nicely between publisher and subscribers.
Describe alternatives you've considered
As the solution above is implemented given our already existing handlers and types, I'm open for discussing a better approach which we can later adapt to inside cloudrunner-go 🙂
If it is possible for us to create a
pubsub.Message
in our HTTP handler, that would make it easier to just export thenewMessageCarrier
function.A bigger alternative would be to have HTTP push subscription handlers in the
cloud.google.com/go/pubsub
package, which could do similar to what we're doing in our cloudpubsub library, but with trace extraction etc managed as well.Additional context
The text was updated successfully, but these errors were encountered: