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: Add Subscribe Side OpenTelemetry Support #1243

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

mukund-ananthu
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

* Current code incorrectly attempts trace context propagation outside of
  the context of the create span. This results in trace context
  propagation not occurring and the "googclient_" prefixed attributes
  never being added to the message.
* The fix adds moves the TraceContextPropagation code to the create span
  function, where its context is available and also adds in a test to
  verify that the attributes are populated as expected.
* Also fix a mistake introduced in an earlier commit where I only
  initialize the PublishMessageWrapper with the message when
  Open Telemetry is enabled. This was resulting in PublishMessageWrapper
  not None and hence the message not being passed to the sequencers when
  Open Telemetry is disabled. The tests I've added caught this issue and
  the issue is now resolved at this point in development.
* Also refactor pytest fixtures by abstracting / reusing OpenTelemetry
  setup across tests
* Fix import ordering
* Add typing wherever missing
* Update unit tests with additional tests
@mukund-ananthu mukund-ananthu requested review from a team as code owners September 8, 2024 00:26
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: pubsub Issues related to the googleapis/python-pubsub API. labels Sep 8, 2024
@mukund-ananthu mukund-ananthu changed the title Add SubscriberOptions and OpenTelemetry Subscriber option feat: Add Subscribe Side OpenTelemetry Support Sep 8, 2024
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Sep 8, 2024
@mukund-ananthu mukund-ananthu force-pushed the otel_subscribe branch 3 times, most recently from b014c28 to 4606288 Compare September 8, 2024 01:15
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: m Pull request size is medium. labels Sep 8, 2024
@mukund-ananthu mukund-ananthu changed the base branch from main to otel_publish September 8, 2024 01:45
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: xl Pull request size is extra large. labels Sep 8, 2024
@mukund-ananthu mukund-ananthu changed the base branch from otel_publish to main September 8, 2024 02:14
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: m Pull request size is medium. labels Sep 8, 2024
@mukund-ananthu mukund-ananthu force-pushed the otel_subscribe branch 2 times, most recently from 60bacb7 to 9590aaa Compare September 9, 2024 03:07
@mukund-ananthu mukund-ananthu force-pushed the otel_subscribe branch 3 times, most recently from 6391fa3 to d871fd2 Compare September 9, 2024 17:22
@mukund-ananthu mukund-ananthu force-pushed the otel_subscribe branch 6 times, most recently from 547f7e7 to e1238e0 Compare September 10, 2024 18:33
Subscriber messages

* The wrappers are required to pass the Open Telemetry information along
  the different code paths
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 googleapis/python-pubsub API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant