File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
google/cloud/pubsub_v1/publisher Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,22 @@ def __init__(
153153
154154 # The object controlling the message publishing flow
155155 self ._flow_controller = FlowController (self .publisher_options .flow_control )
156+
157+ self ._open_telemetry_enabled = (
158+ self .publisher_options .enable_open_telemetry_tracing
159+ )
160+ # OpenTelemetry features used by the library are not supported in Python versions <= 3.7.
161+ # Refer https://github.com/open-telemetry/opentelemetry-python/issues/3993#issuecomment-2211976389
162+ if (
163+ self .publisher_options .enable_open_telemetry_tracing
164+ and sys .version_info .major == 3
165+ and sys .version_info .minor < 8
166+ ):
167+ warnings .warn (
168+ message = "Open Telemetry for Python version 3.7 or lower is not supported. Disabling Open Telemetry tracing." ,
169+ category = RuntimeWarning ,
170+ )
171+ self ._open_telemetry_enabled = False
156172
157173 self ._open_telemetry_enabled = (
158174 self .publisher_options .enable_open_telemetry_tracing
You can’t perform that action at this time.
0 commit comments