Skip to content

fix(llamaindex): LlamaIndex instrumentor init for llama-index-core#3695

Open
rylamb wants to merge 1 commit intotraceloop:mainfrom
rylamb:fix-llamaindex-core-instrumentor-init
Open

fix(llamaindex): LlamaIndex instrumentor init for llama-index-core#3695
rylamb wants to merge 1 commit intotraceloop:mainfrom
rylamb:fix-llamaindex-core-instrumentor-init

Conversation

@rylamb
Copy link

@rylamb rylamb 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

Update init_llama_index_instrumentor() in tracing.py to initialize LlamaIndexInstrumentor for llama-index-core and llama_index_core packages.

  • Behavior:
    • Update init_llama_index_instrumentor() in tracing.py to check for llama-index-core and llama_index_core packages.
    • Ensures LlamaIndexInstrumentor is initialized if any of llama-index, llama_index, llama-index-core, or llama_index_core are installed.

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

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced package detection to recognize additional naming conventions for llama-index installations, improving compatibility and ensuring proper instrumentation across different package configurations.

@CLAassistant
Copy link

CLAassistant commented Feb 18, 2026

CLA assistant check
All committers have signed the CLA.

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 22c3619 in 9 seconds. Click for details.
  • Reviewed 18 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_I8X6GIiTgjcgz31m

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

The condition in init_llama_index_instrumentor is broadened to check for additional package variants (llama-index-core and llama_index_core) alongside the existing llama-index and llama_index checks. If any of these packages are installed, the LlamaIndexInstrumentor is imported and instantiated.

Changes

Cohort / File(s) Summary
LlamaIndex Instrumentation
packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py
Expanded package detection logic to recognize additional llama-index package name variants (llama-index-core, llama_index_core) for instrumentor initialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 More llama-index paths we now explore,
With core packages added to our store,
Variations handled, both dash and underscore,
Our tracing instruments work evermore! ✨

🚥 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 clearly and specifically describes the main change: fixing the LlamaIndex instrumentor initialization to support llama-index-core package.

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

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

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.

@rylamb
Copy link
Author

rylamb commented Feb 18, 2026

Currently, if using llama-index-core you will need to explicitly call the following block of code post Traceloop.init() in order to initialize LlamaIndex instrumentation, otherwise no tracing will be generated:

llamaindex_instrumentor = LlamaIndexInstrumentor()
if not llamaindex_instrumentor.is_instrumented_by_opentelemetry:
    llamaindex_instrumentor.instrument()

This is effectively duplicating what tracing.py init_llama_index_instrumentor() should already be doing if it were checking for the correct package names.

@rylamb rylamb changed the title fix(instrumentation): LlamaIndex instrumentor init for llama-index-core fix(llamaindex): LlamaIndex instrumentor init for llama-index-core Feb 18, 2026
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.

2 participants