Skip to content

Commit

Permalink
Explicitly pass observability_options into BatchCreateSessions for pools
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Nov 28, 2024
1 parent 65a2a27 commit 8db062a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions google/cloud/spanner_v1/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ def bind(self, database):
session_template=Session(creator_role=self.database_role),
)

while trace_call("Cloudspanner.FixedPool.BatchCreateSessions", self):
observability_options = getattr(database, "observability_options")
while trace_call(
"Cloudspanner.FixedPool.BatchCreateSessions",
observability_options=observability_options,
):
while not self._sessions.full():
resp = api.batch_create_sessions(
request=request,
Expand Down Expand Up @@ -424,7 +428,11 @@ def bind(self, database):
session_template=Session(creator_role=self.database_role),
)

while trace_call("Cloudspanner.PingingPool.BatchCreateSessions", self):
observability_options = getattr(database, "observability_options")
while trace_call(
"Cloudspanner.PingingPool.BatchCreateSessions",
observability_options=observability_options,
):
while created_session_count < self.size:
resp = api.batch_create_sessions(
request=request,
Expand Down

0 comments on commit 8db062a

Please sign in to comment.