GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — observability: annotate Session+SessionPool events by odeke-em · Pull Request #1207 · googleapis/python-spanner
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4bc937e to
0d5bf26
Compare
0d5bf26 to
3617921
Compare
f71d05c to
eb9dd5a
Compare
b1ea772 to
ab23f09
Compare
|
Kindly cc-ing you @harshachinta. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Kindly please take another look @harshachinta, feedback addressed, thank you for the code review! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| if requested_session_count > 0: | ||
| current_span.add_event( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
current_span is not initialized.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sheesh, sorry I had a bunch of benchmarks running locally and they interrupted my nox -s unit-3.8 tests so didn't see those but all fixed now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e60b662 to
3a1611e
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| if self._transaction_id is None and len(self._mutations) > 0: | ||
| self.begin() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| if self._transaction_id is None and len(self._mutations) > 0: | |
| self.begin() |
Why is this added here? This is already getting executed in the beginning of commit() call, so not needed
| if self._transaction_id is None and len(self._mutations) > 0: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) | ||
| session = self._sessions.get(block=True, timeout=timeout) | ||
| except queue.Empty as e: | ||
| add_span_event(current_span, "No session available", span_event_attributes) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| add_span_event(current_span, "No session available", span_event_attributes) | |
| add_span_event(current_span, "No session available in the pool", span_event_attributes) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| "exception", | ||
| "exception", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why are there 2 exception events?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is a quirk with opentelemetry-python; they add "exception" on every exit call whether or not you set your own, I'll file a bug later on but for now I'll just remove our explicit invocation of "span.record_exception" and instead add our comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thank you @harshachinta for the review, I've addressed the feedback. Please take a look again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b6187d8 to
e654029
Compare
|
@harshachinta kindly help me run the bots. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please fix lint
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| yield span | ||
| except Exception as error: | ||
| span.set_status(Status(StatusCode.ERROR, str(error))) | ||
| span.record_exception(error) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Lets not remove this exception. We are not sure if there are any cases where the span will end up not recording an exception.
I would suggest adding this back here and let us discuss more during our demo.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also I was wondering that this behavior of exception getting added twice was not seen earlier since this code exists from very long.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's because OpenTelemetry was upgraded only recently.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We do have locked tests to check for the exceptions to ensure that they are in there and from Span.enter. I had to dive back into OpenTelemetry-Python's code as it isn't even documented and in our demos it was very distracting to have mysteriously both errors. I think for the sake of our sanity and project stability let's leave that comment in and if anything happens it is a trivial one to add back @harshachinta
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hmm. But the opentelemetry documentation for Python guides to record exception for instrumentation libraries.
https://opentelemetry.io/docs/languages/python/instrumentation/#record-exceptions-in-spans
Can you share the code pointer on where the opentelemetry records exception by default when exiting?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@harshachinta it was the cause of us seeing 2 exceptions and took a ton of confusion and time for me to debug, they don't seem to document this condition.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@harshachinta kindly help me re-run the bots; all unit tests pass locally. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
498a70a to
060d17c
Compare
060d17c to
b400718
Compare
This change adds annotations for session and session pool events to aid customers in debugging latency issues with session pool malevolence and also for maintainers to figure out which session pool type is the most appropriate. Updates googleapis#1170
b400718 to
1d7e440
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.