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

fix(pubsub): add attributes before startSpan #10800

Merged

Conversation

jameshartig
Copy link
Contributor

Attributes can be used for sampling and so they should be added before span creation, if possible. See [1].

We had an configuration AST that lets us set the sample rate based on the span attributes but it requires the span attributes to be sent to the create span so they can be used for sampling. In particular we wanted to increase the sample rate for code.function: receive so we could help debug the recent redelivery issues.

[1] https://opentelemetry.io/docs/concepts/signals/traces/#attributes

/cc @hongalex

@jameshartig jameshartig requested review from shollyman and a team as code owners August 30, 2024 23:00
Copy link

google-cla bot commented Aug 30, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Aug 30, 2024
Attributes can be used for sampling and so they should be added before
span creation, if possible. See [1].

[1] https://opentelemetry.io/docs/concepts/signals/traces/#attributes
@jameshartig jameshartig force-pushed the x-pubsub-span-attrs-before-creation branch from c8520d8 to bc476e4 Compare August 30, 2024 23:02
@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 48addbf into googleapis:main Sep 6, 2024
8 checks passed
@hongalex
Copy link
Member

hongalex commented Sep 6, 2024

Thanks for creating this PR! This will be part of the next release

@jameshartig jameshartig deleted the x-pubsub-span-attrs-before-creation branch September 6, 2024 12:14
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.

3 participants