-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoundedDict was deprecated in opentelemetry-python 1.4.0 #226
Comments
This was just removed from the public API of OTel so should keep warning. I agree we should fix this to stop the log spam, probably just by copying the code for BoundedDict into this repo. |
This produces a lot of log noise which we are billed for. I have not been able to figure out how to suppress the warning as a consumer of this package. Is there any chance the warning could be suppressed until a better solution is implemented? |
Here's a workaround that suppresses the warning: import warnings
from opentelemetry.exporter import cloud_trace
class CloudTraceSpanExporterWithoutWarnings(cloud_trace.CloudTraceSpanExporter):
"""Suppresses DeprecationWarning raised by CloudTraceSpanExporter.
See for details:
https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/issues/226
"""
def export(self, *args, **kwargs):
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
super().export(*args, **kwargs) |
|
Glad to see that they resolved the log spam issue but it seems like we should resolve the underlying issue as well. It looks like Would it make more sense to just switch to the new non-deprecated class rather than pulling a copy of the deprecated class into this repo? |
The linked PR is not working but glad the log spam has stopped. Can I assign this to you @shevisj ? |
Changelog:
https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md#version-140023b0-2021-07-21
Used in in
opentelemetry-operations-python/opentelemetry-exporter-gcp-trace/src/opentelemetry/exporter/cloud_trace/__init__.py
Line 498 in 773ee41
Usage of the library will print:
The text was updated successfully, but these errors were encountered: