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 — feat: Add OpenTelemetry integration by sethmaxwl · Pull Request #149 · googleapis/python-pubsub
This repository was archived by the owner on Oct 13, 2026. It is now read-only.
Conversation
|
|
This requires dropping Python 2 support, right? (#131) The samples PR is more or less ready to be merged (IMO) and we can then make one final Python 2 compatible release, and drop Python 2 support immediately afterwards. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, OpenTelemetry does not support any Python version before 3.4. |
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.
Disclaimer - I would have to familiarize myself with the opentelemetry library more, thus I primarily focused on the code aspects, and less on the actual semantics. Added suggestions at places where the code could benefit from them.
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.
All suggestions have been addressed. |
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.
LGTM now, although we might have to do some additional changes once #158 is merged.
If you have time, you might want to rebase your branch onto that PR branch and see if things work there, too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| trace.set_tracer_provider(TracerProvider()) | ||
| trace.get_tracer_provider().add_span_processor( | ||
| SimpleExportSpanProcessor(CloudTraceSpanExporter()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You should be using a BatchSpanProcessor here. SimpleExportSpanProcessor exports all spans sequentially and will be very slow.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if "googclient_OpenTelemetrySpanContext" in attrs: | ||
| _LOGGER.warning( | ||
| "googclient_OpenTelemetrySpanContext set on message" | ||
| "as an attribute, but will be overridden." |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No space between "message" and "as".
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.
There are still a couple of suggestions from previous reviews, though they are mostly documentation and log warning formatting issues.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "opentelemetry-api and opentelemetry-instrumentation" | ||
| "pip modules. See also" | ||
| "https://opentelemetry-python.readthedocs.io/en/stable/getting-started.html" | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There are no spaces at the end of these lines, which will cause words to be displayed together (e.g. couldnot, rather than could not).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "A parent span was provided but it could not be" | ||
| "converted into a SpanContext. Ensure that the" | ||
| "parent is a mapping with at least a trace_id, span_id" | ||
| "and is_remote keys." |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same issue from above, where spaces are missing at the end of the lines.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| python.py_samples() | ||
|
|
||
| # ---------------------------------------------------------------------------- | ||
| # Additional unit test dependincies |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Typo: dependencies.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "pip modules. See also" | ||
| "https://opentelemetry-python.readthedocs.io/en/stable/getting-started.html" | ||
| ) | ||
| USE_OPENTELEMETRY = False |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion: In addition to the import try, wouldn't it be possible to use an environment variable for explicitly disabling opentelemetry? That way the tests below would not need to mess with sys.modules.
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.
Seems like lint is not passing, plus there are a few failing tests. Please review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Side note - before merging this (after releasing a new major version, of course), we must also run a few benchmarks to verify that the tracing does not hinder the performance, especially throughput. Mentioning as a a reminder to ourselves. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi all, Seth (author of this PR) finished his Google internship in mid-August so I assume is not actively maintaining this PR now. I would be willing to address the remaining comments here but will not be able to get to it for a couple of weeks. Seth if I'm mistaken and you are indeed still following/working on this let us know, but I assume you have other things to do! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@johnbryan That sounds good, thanks! No rush, though, as we need too release a new major version first anyway. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@johnbryan FYI, a new major version has been released, unblocking this PR (which needs an update now, however). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@johnbryan Will you have a chance to rebase this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, any news on this PR? This could be of use :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@johnbryan What's the status of this PR, do we have an ETA for bringing it to completion? Thanks in advance! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Just as a quick status update, it is still not clear what exactly do want to be tracked, still awaiting the official specs. We can thus consider this PR blocked until further notice. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, is there any update/ETA on this PR? :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This PR has been open a while - any updates as to why it's still blocked? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| data=data, ordering_key=ordering_key, attributes=attrs | ||
| ) | ||
| span_name = "{} publisher".format(topic) | ||
| span_attributes = {"data": data.decode()} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What is the argument for doing this? It seems to me that, best case, it results in the duplication of data in the message. But in the worst case it actually leaks sensitive information into observability stack, just like logging the output of a SQL query would.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing this, since its now done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
PubSub add OpenTelemetry support
There was an error while loading. Please reload this page.