fix(Watsonx):Correct the package Name to enable Traces #3693
fix(Watsonx):Correct the package Name to enable Traces #3693elinacse wants to merge 3 commits intotraceloop:mainfrom
Conversation
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to e9a5688 in 15 seconds. Click for details.
- Reviewed
13lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_2dTEiRcNDeAeNNtY
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Fix for #3692 |
📝 WalkthroughWalkthroughA package detection conditional in the Watsonx instrumentor was updated from using dash-separated package names to underscore-separated package names for IBM Watson machine learning package identification. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py (1)
976-989: Check both package name forms for consistency with codebase pattern.The change to
"ibm_watson_machine_learning"(underscores) is correct, as the actual Python modules use underscores. However, sinceis_package_installedperforms no normalization (only lowercasing), the current approach is inconsistent with the established pattern:
init_qdrant_instrumentor()checks both"qdrant_client"and"qdrant-client"init_llama_index_instrumentor()checks both"llama-index"and"llama_index"Additionally, line 978 still checks only
"ibm-watsonx-ai"(dashes), but all sample apps and tests importibm_watsonx_ai(underscores).Suggested improvement for robustness
- if is_package_installed("ibm-watsonx-ai") or is_package_installed( - "ibm_watson_machine_learning" - ): + if ( + is_package_installed("ibm-watsonx-ai") + or is_package_installed("ibm_watsonx_ai") + or is_package_installed("ibm-watson-machine-learning") + or is_package_installed("ibm_watson_machine_learning") + ):🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py` around lines 976 - 989, The init_watsonx_instrumentor function currently only checks one form each for the Watsonx packages inconsistently; update it to check both dashed and underscored package names (e.g., "ibm-watsonx-ai" and "ibm_watsonx_ai", and "ibm-watson-machine-learning" and "ibm_watson_machine_learning") using is_package_installed so it matches the pattern used by init_qdrant_instrumentor and init_llama_index_instrumentor and the actual import names used in sample apps and tests; keep the same try/except and the WatsonxInstrumentor usage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py`:
- Around line 976-989: The init_watsonx_instrumentor function currently only
checks one form each for the Watsonx packages inconsistently; update it to check
both dashed and underscored package names (e.g., "ibm-watsonx-ai" and
"ibm_watsonx_ai", and "ibm-watson-machine-learning" and
"ibm_watson_machine_learning") using is_package_installed so it matches the
pattern used by init_qdrant_instrumentor and init_llama_index_instrumentor and
the actual import names used in sample apps and tests; keep the same try/except
and the WatsonxInstrumentor usage unchanged.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py

feat(instrumentation): ...orfix(instrumentation): ....Important
Corrects package name in
init_watsonx_instrumentor()to ensure proper initialization of Watsonx instrumentor.init_watsonx_instrumentor()intracing.pyfromibm-watson-machine-learningtoibm_watson_machine_learning.This description was created by
for e9a5688. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit