Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/source/ray-observability/user-guides/ray-tracing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +18 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For conciseness and to ensure atomic installation of compatible versions, it's better to combine these pip install commands into a single line.

Suggested change
pip install opentelemetry-api==1.34.1
pip install opentelemetry-sdk==1.34.1
pip install opentelemetry-exporter-otlp==1.34.1
pip install opentelemetry-api==1.34.1 opentelemetry-sdk==1.34.1 opentelemetry-exporter-otlp==1.34.1


Tracing startup hook
--------------------
Expand Down
10 changes: 5 additions & 5 deletions python/ray/util/tracing/tracing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Tracing Configuration Error Handling Regression

The ImportError for missing OpenTelemetry dependencies now relies on _is_tracing_enabled(), which checks an internal global flag instead of the RAY_TRACING_ENABLED environment variable. This means setting the environment variable no longer triggers the helpful error, leading to silent failures and making dependency issues harder to diagnose. The _is_tracing_enabled() docstring is also inaccurate.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-checked:
RAY_TRACING_ENABLED is only used at tracing_helper.py line 78.
It’s safe to remove it.

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"
)


Expand Down