Skip to content

Commit

Permalink
Split the subscription name at one place
Browse files Browse the repository at this point in the history
* Addressing the review comment
  • Loading branch information
mukund-ananthu committed Sep 24, 2024
1 parent ad13b59 commit 3977a6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ def start_subscribe_span(
getter=OpenTelemetryContextGetter(),
)
self._publisher_create_span_context = parent_span_context
assert len(subscription.split("/")) == 4
subscription_short_name = subscription.split("/")[3]
self._project_id = subscription.split("/")[1]
split_subscription: List[str] = subscription.split("/")
assert len(split_subscription) == 4
subscription_short_name = split_subscription[3]
self._project_id = split_subscription[1]
self._subscription_id = subscription_short_name
with tracer.start_as_current_span(
name=f"{subscription_short_name} subscribe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,10 @@ def _send_lease_modacks(
if self._client.open_telemetry_enabled:
subscribe_span_links: List[trace.Link] = []
subscribe_spans: List[trace.Span] = []
assert len(self._subscription.split("/")) == 4
subscription_id: str = self._subscription.split("/")[3]
project_id: str = self._subscription.split("/")[1]
subscription_split: List[str] = self._subscription.split("/")
assert len(subscription_split) == 4
subscription_id: str = subscription_split[3]
project_id: str = subscription_split[1]
for data in opentelemetry_data:
subscribe_span: Optional[trace.Span] = data.subscribe_span
if (
Expand Down

0 comments on commit 3977a6a

Please sign in to comment.