From 2c0e6cd7ff8690046855a0fb38b737aec830fa6d Mon Sep 17 00:00:00 2001 From: justwph <2732352+wph95@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:41:30 +0800 Subject: [PATCH 1/2] [tracing] Update OpenTelemetry dependencies and improve error messaging for tracing setup Signed-off-by: justwph <2732352+wph95@users.noreply.github.com> --- .../ray-observability/user-guides/ray-tracing.rst | 6 +++--- python/ray/util/tracing/tracing_helper.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/ray-observability/user-guides/ray-tracing.rst b/doc/source/ray-observability/user-guides/ray-tracing.rst index de21c2da425a..25193125482d 100644 --- a/doc/source/ray-observability/user-guides/ray-tracing.rst +++ b/doc/source/ray-observability/user-guides/ray-tracing.rst @@ -15,9 +15,9 @@ First, install OpenTelemetry: .. code-block:: shell - pip install opentelemetry-api==1.1.0 - pip install opentelemetry-sdk==1.1.0 - pip install opentelemetry-exporter-otlp==1.1.0 + pip install opentelemetry-api==1.34.1 + pip install opentelemetry-sdk==1.34.1 + pip install opentelemetry-exporter-otlp==1.34.1 Tracing startup hook -------------------- diff --git a/python/ray/util/tracing/tracing_helper.py b/python/ray/util/tracing/tracing_helper.py index 080acbe31aba..78a1c1fcb354 100644 --- a/python/ray/util/tracing/tracing_helper.py +++ b/python/ray/util/tracing/tracing_helper.py @@ -76,12 +76,12 @@ def _try_import(self, module): try: return importlib.import_module(module) except ImportError: - if os.getenv("RAY_TRACING_ENABLED", "False").lower() in ["true", "1"]: + if _is_tracing_enabled(): raise ImportError( - "Install opentelemetry with " - "'pip install opentelemetry-api==1.0.0rc1' " - "and 'pip install opentelemetry-sdk==1.0.0rc1' to enable " - "tracing. See more at docs.ray.io/tracing.html" + "Install OpenTelemetry with " + "'pip install opentelemetry-api==1.34.1 opentelemetry-sdk==1.34.1' " + "to enable tracing. See the Ray documentation for details: " + "https://docs.ray.io/en/latest/ray-observability/user-guides/ray-tracing.html#installation" ) From 4d587a608eea1803c6b7a31fe02752b23ebf7c68 Mon Sep 17 00:00:00 2001 From: JustWPH <2732352+wph95@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:55:34 +0800 Subject: [PATCH 2/2] Update python/ray/util/tracing/tracing_helper.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: JustWPH <2732352+wph95@users.noreply.github.com> --- python/ray/util/tracing/tracing_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ray/util/tracing/tracing_helper.py b/python/ray/util/tracing/tracing_helper.py index 78a1c1fcb354..e0231da69296 100644 --- a/python/ray/util/tracing/tracing_helper.py +++ b/python/ray/util/tracing/tracing_helper.py @@ -79,7 +79,7 @@ def _try_import(self, module): if _is_tracing_enabled(): raise ImportError( "Install OpenTelemetry with " - "'pip install opentelemetry-api==1.34.1 opentelemetry-sdk==1.34.1' " + "'pip install opentelemetry-api==1.34.1 opentelemetry-sdk==1.34.1 opentelemetry-exporter-otlp==1.34.1' " "to enable tracing. See the Ray documentation for details: " "https://docs.ray.io/en/latest/ray-observability/user-guides/ray-tracing.html#installation" )