GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add OpenTelemetry support for Subscribe Side by mukund-ananthu · Pull Request #1252 · googleapis/python-pubsub

This repository was archived by the owner on Oct 13, 2026. It is now read-only.

Conversation

@mukund-ananthu

@mukund-ananthu mukund-ananthu commented Sep 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Subscribe Side OpenTelemetry Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mukund-ananthu
mukund-ananthu requested review from a team September 16, 2024 20:42
@conventional-commit-lint-gcf

conventional-commit-lint-gcf Bot commented Sep 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🤖 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/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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. size: m Pull request size is medium. size: l Pull request size is large. and removed size: s Pull request size is small. size: m Pull request size is medium. labels Sep 16, 2024
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 05eeb93 to fedbe39 Compare September 18, 2024 05:59
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. size: l Pull request size is large. and removed size: l Pull request size is large. size: m Pull request size is medium. labels Sep 18, 2024
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch 2 times, most recently from 6deb637 to 1703dd2 Compare September 18, 2024 19:29
mukund-ananthu added 9 commits September 18, 2024 19:32
@mukund-ananthu
Add SubscriberOptions and OpenTelemetry Subscriber option
04c3881
@mukund-ananthu
Set / Override OpenTelemetry Subscriber settings based on Python Version
0a679a5
@mukund-ananthu
Add OpenTelemetryContextGetter used for trace propagation
40a2996
@mukund-ananthu
Add Subscribe Span and SubscribeOpenTelemetry class
b10f2f6
@mukund-ananthu
Add receipt modack start and end events to subscribe span
95a1d32
@mukund-ananthu
Modify SubscriberMessage to include opentelemetry data and include
c556f99
SubscribeSpan information in the SubscriberMessage's Open Telemetry data
@mukund-ananthu
Add ack, modack, nack start events to subscribe span
f52fbac
@mukund-ananthu
Add Open Telemetry data to Ack, Modack, Nack request objects
b5ab6bb
* This is required for the Open Telemetry information to be percolated
  to the dispatcher which performs acks, nacks and modacks async.
* The Open Telemetry data passed into the dispatcher will be used to add
  events such as ack, modack, nack end to the subscribe span
@mukund-ananthu
Add ack result, ack end event to subscribe span and end it
a695c99
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 1703dd2 to a695c99 Compare September 18, 2024 19:32
mukund-ananthu added 3 commits September 18, 2024 20:00
@mukund-ananthu
Add tests for ack and ack_with_response methods of Subscriber Message
694cfde
* Both these methods should add the "ack start" event to the subscribe
  span
@mukund-ananthu
Add tests for nack and nack_with_response methods of Subscriber Message
27edc0f
* Both these methods should add "nack start" events to the subscribe
  span
@mukund-ananthu
Add tests for modify_ack_deadline and modify_ack_deadline_with_response
c1f0ad8
* Both these methods should add the "modack start" event to the
  subscribe span
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from e5c89fc to c1f0ad8 Compare September 18, 2024 20:10
mukund-ananthu added 3 commits September 23, 2024 00:08
@mukund-ananthu
Add is_receipt_modack attribute to modack span
2410a4e
@mukund-ananthu
Add ack span
b66fd19
@mukund-ananthu
Add ack span for dispatcher._retry_ack
54a88ba
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 6ab4432 to 65aae0f Compare September 23, 2024 18:48
@mukund-ananthu
Add nack span
28a192a
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 65aae0f to 28a192a Compare September 23, 2024 21:19
mukund-ananthu added 3 commits September 23, 2024 21:41
@mukund-ananthu
Add nack span for dispatcher._retry_modacks
c8c5eb9
@mukund-ananthu
Fix modacks
6ec7c35
* Currently, subscribe_span is ended after modack end event is added to
  the subscribe_span. This should not happen, since subscribe_span
  should be ended only after ack,nack or drop, but not modack
* Remove an extraneous modack start that was present in
  streaming_pull_manager.send_lease_modacks(). This is not required,
  since modack start and end events will anyways be added to the
  subscribe span in the dispatcher.modify_ack_deadline() method.
* Replace the NamedTuple._replace() methods with creation of new
  NamedTuple ModackRequest items. This is because NamedTuple._replace()
  returns a new NamedTuple, rather than replacing the existing one. This
  results in the opentelemetry data not being plumbed down into the
  dispatcher.modify_ack_deadline_method.
@mukund-ananthu
Fix mypy errors
7936911
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 21a5716 to 4e17352 Compare September 24, 2024 14:56
@mukund-ananthu
Add links to subscribe span of the sampled ack_spans in dispatcher.ack
5874a96
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 4e17352 to 5874a96 Compare September 24, 2024 15:13
mukund-ananthu added 2 commits September 24, 2024 15:19
@mukund-ananthu
Add links to ack_span in the subscribe_spans in dispatcher.retry_ack()
a791570
@mukund-ananthu
Add links to nack spans in the subscribe span in
3206c19
dispatcher.modify_ack_deadlin()
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 481f7a5 to 3206c19 Compare September 24, 2024 15:33
mukund-ananthu added 4 commits September 24, 2024 15:39
@mukund-ananthu
Add links to nack_spans in subscribe_span in dispatcher.retry_nacks()
14250a1
@mukund-ananthu
Add attributes to the links from subscribe_span to ack_span
815f2a3
@mukund-ananthu
Add attributes to links in subscribe_spans to nack_spans
94feeec
@mukund-ananthu
Add links to modack spans in subscribe span
5dd8fb8
@mukund-ananthu
mukund-ananthu force-pushed the otel_subscribe_feature branch from 91d6344 to 5dd8fb8 Compare September 24, 2024 16:13
@mukund-ananthu

mukund-ananthu commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

@hongalex PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mukund-ananthu
mukund-ananthu requested a review from parthea September 24, 2024 19:39
@mukund-ananthu

mukund-ananthu commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

@parthea PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mukund-ananthu
Create nack span even if there are no sampled subscribe span
b4fdd40
hongalex
hongalex approved these changes Sep 24, 2024
View reviewed changes
Comment thread google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/pubsub_v1/open_telemetry/subscribe_opentelemetry.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

mukund-ananthu added 2 commits September 24, 2024 21:47
@mukund-ananthu
Add a note stating that OpenTelemetry traces are subject to change
ad13b59
@mukund-ananthu
Split the subscription name at one place
3977a6a
* Addressing the review comment
@mukund-ananthu
mukund-ananthu merged commit 1b6f3d2 into main Sep 24, 2024
@mukund-ananthu
mukund-ananthu deleted the otel_subscribe_feature branch September 24, 2024 22:54
@release-please release-please Bot mentioned this pull request Sep 17, 2024
chore(main): release 2.24.0 #1251
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@parthea parthea Awaiting requested review from parthea
1 more reviewer
@hongalex hongalex hongalex approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mukund-ananthu mukund-ananthu

Labels

api: pubsub Issues related to the googleapis/python-pubsub API. size: xl Pull request size is extra large.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mukund-ananthu @hongalex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.