Skip to content

Comments

fix(Watsonx):Correct the package Name to enable Traces #3693

Open
elinacse wants to merge 3 commits intotraceloop:mainfrom
elinacse:watsonxIssueFix
Open

fix(Watsonx):Correct the package Name to enable Traces #3693
elinacse wants to merge 3 commits intotraceloop:mainfrom
elinacse:watsonxIssueFix

Conversation

@elinacse
Copy link
Contributor

@elinacse elinacse commented Feb 18, 2026

  • I have added tests that cover my changes.
  • If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • (If applicable) I have updated the documentation accordingly.

Important

Corrects package name in init_watsonx_instrumentor() to ensure proper initialization of Watsonx instrumentor.

  • Behavior:
    • Corrects package name in init_watsonx_instrumentor() in tracing.py from ibm-watson-machine-learning to ibm_watson_machine_learning.
    • Ensures correct package is checked for installation, enabling proper initialization of Watsonx instrumentor.

This description was created by Ellipsis for e9a5688. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed IBM Watson Machine Learning package detection to use the correct naming convention, ensuring proper instrumentation initialization when the package is installed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to e9a5688 in 15 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft 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 Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@elinacse
Copy link
Contributor Author

Screenshot 2026-02-18 at 4 23 54 PM

@elinacse
Copy link
Contributor Author

Fix for #3692

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

A 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

Cohort / File(s) Summary
Package Detection Fix
packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py
Updated IBM Watson machine learning package name check from "ibm-watson-machine-learning" to "ibm_watson_machine_learning" for proper package detection in init_watsonx_instrumentor.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A dash became an underscore's delight,
The Watson package now detected right,
One tiny swap, no logic in sight,
Just naming conventions set tight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting the package name from 'ibm-watson-machine-learning' (dash) to 'ibm_watson_machine_learning' (underscore) to enable Watsonx traces.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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, since is_package_installed performs 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 import ibm_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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4ee45c6 and 3f27b42.

📒 Files selected for processing (1)
  • packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant