From 79e42f9837eb94f35808eab2b28c950f38b3f9da Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Mon, 29 Apr 2024 10:37:37 -0700 Subject: [PATCH] [Python Otel] Remove opentelemetry version pin (#36448) Closes #36448 PiperOrigin-RevId: 629113962 --- examples/python/observability/requirements.txt | 2 +- .../grpcio_observability/grpc_observability/BUILD.bazel | 3 +-- src/python/grpcio_observability/setup.py | 2 +- src/python/grpcio_tests/tests/observability/BUILD.bazel | 4 ++++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/python/observability/requirements.txt b/examples/python/observability/requirements.txt index f7997817571..cb2d4d4b904 100644 --- a/examples/python/observability/requirements.txt +++ b/examples/python/observability/requirements.txt @@ -1,3 +1,3 @@ grpcio>=1.62.0 grpcio-observability>=1.62.0 -opentelemetry-sdk==1.21.0 +opentelemetry-sdk>=1.21.0 diff --git a/src/python/grpcio_observability/grpc_observability/BUILD.bazel b/src/python/grpcio_observability/grpc_observability/BUILD.bazel index 1a760338114..0ae6bb46db4 100644 --- a/src/python/grpcio_observability/grpc_observability/BUILD.bazel +++ b/src/python/grpcio_observability/grpc_observability/BUILD.bazel @@ -53,7 +53,7 @@ pyx_library( ], ) -# Since `opentelemetry-sdk` and `opentelemetry-api` are non-hermetic, +# Since `opentelemetry-api` is non-hermetic, # pyobservability is for internal use only. py_library( name = "_opentelemetry_observability", @@ -63,7 +63,6 @@ py_library( "_open_telemetry_plugin.py", ], deps = [ - requirement("opentelemetry-sdk"), requirement("opentelemetry-api"), ], ) diff --git a/src/python/grpcio_observability/setup.py b/src/python/grpcio_observability/setup.py index 53e7b3d8de7..3c7f45c9098 100644 --- a/src/python/grpcio_observability/setup.py +++ b/src/python/grpcio_observability/setup.py @@ -290,7 +290,7 @@ setuptools.setup( install_requires=[ "grpcio=={version}".format(version=grpc_version.VERSION), "setuptools>=59.6.0", - "opentelemetry-api==1.21.0", + "opentelemetry-api>=1.21.0", ], cmdclass={ "build_ext": BuildExt, diff --git a/src/python/grpcio_tests/tests/observability/BUILD.bazel b/src/python/grpcio_tests/tests/observability/BUILD.bazel index b7a531423a7..bcc1e618e42 100644 --- a/src/python/grpcio_tests/tests/observability/BUILD.bazel +++ b/src/python/grpcio_tests/tests/observability/BUILD.bazel @@ -11,6 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +load("@grpc_python_dependencies//:requirements.bzl", "requirement") + package(default_visibility = ["//visibility:public"]) py_library( @@ -34,6 +37,7 @@ py_test( "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_observability/grpc_observability:pyobservability", "//src/python/grpcio_tests/tests/testing", + requirement("opentelemetry-sdk"), ], )