Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit e82bce4

Browse files
committed
fix: if otel is enabled, run user callback under process span
1 parent 2b7e423 commit e82bce4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ def _wrap_callback_errors(
148148
try:
149149
if message.opentelemetry_data:
150150
message.opentelemetry_data.end_subscribe_concurrency_control_span()
151-
message.opentelemetry_data.start_process_span()
152-
callback(message)
151+
with message.opentelemetry_data.start_process_span():
152+
callback(message)
153+
else:
154+
callback(message)
153155
except BaseException as exc:
154156
# Note: the likelihood of this failing is extremely low. This just adds
155157
# a message to a queue, so if this doesn't work the world is in an

0 commit comments

Comments
 (0)