Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pubsub): allow trace extraction from protobuf message #10827

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

radhus
Copy link
Contributor

@radhus radhus commented Sep 5, 2024

Export the function NewMessageCarrierFromPB which, given a protobuf PubsubMessage, returns a TextMapCarrier which can be used to extract trace contexts.

This allows it to be used in e.g. HTTP push endpoints.

Fixes #10828

Export the function NewMessageCarrierFromPB which, given a protobuf
PubsubMessage, returns a TextMapCarrier which can be used to extract
trace contexts.

This allows it to be used in e.g. HTTP push endpoints.
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Sep 5, 2024
@radhus radhus marked this pull request as ready for review September 5, 2024 19:10
@radhus radhus requested review from shollyman and a team as code owners September 5, 2024 19:10
@hongalex hongalex added the kokoro:run Add this label to force Kokoro to re-run the tests. label Sep 6, 2024
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Sep 6, 2024
@hongalex hongalex merged commit caa826c into googleapis:main Sep 6, 2024
8 checks passed
@radhus radhus deleted the pubsub-push-subscription-tracing branch September 6, 2024 06:02
radhus added a commit to einride/cloudrunner-go that referenced this pull request Sep 10, 2024
Pass a context that contains trace information extracted from the
incoming message, allowing traces to span from publishers over to
subscribers.

In order for publishers to include tracing information, the pubsub
client should be created with:
```go
client, err := pubsub.NewClientWithConfig(
	ctx,
	cloudrunner.Runtime(ctx).ProjectID,
	&pubsub.ClientConfig{
		EnableOpenTelemetryTracing: true,
	},
```

Depends on googleapis/google-cloud-go#10827
which is included in
[v1.43.0](https://github.com/googleapis/google-cloud-go/releases/tag/pubsub%2Fv1.43.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pubsub: extract trace information on push subscriptions
3 participants