Skip to content

fix(traceloop-sdk): add google-generativeai to span processor allowlist - #1033

Open
nishmethuku wants to merge 1 commit into
traceloop:mainfrom
nishmethuku:feat/instrumentation-google-genai
Open

fix(traceloop-sdk): add google-generativeai to span processor allowlist#1033
nishmethuku wants to merge 1 commit into
traceloop:mainfrom
nishmethuku:feat/instrumentation-google-genai

Conversation

@nishmethuku

@nishmethuku nishmethuku commented Jul 22, 2026

Copy link
Copy Markdown

Fixes #621

The @traceloop/instrumentation-google-generativeai package instruments
@google/genai (the replacement for the deprecated @google-cloud/vertexai),
but it was missing from the traceloopInstrumentationLibraries allowlist in
span-processor.ts. This caused GenAI spans to be dropped by the default
Traceloop span processor, while VertexAI spans were exported correctly.

This one-line fix adds the package to the allowlist so spans are exported as expected.

Summary by CodeRabbit

  • New Features
    • Added support for tracing Google Generative AI instrumentation by default.
    • Google Generative AI activity can now be included automatically in span processing unless custom instrumentation settings are provided.

@CLAassistant

CLAassistant commented Jul 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a6cb2d9-eeef-4e33-a0aa-ffddefac80d5

📥 Commits

Reviewing files that changed from the base of the PR and between 1faf69d and d5d983e.

📒 Files selected for processing (1)
  • packages/traceloop-sdk/src/lib/tracing/span-processor.ts

📝 Walkthrough

Walkthrough

The default Traceloop instrumentation library list now includes @traceloop/instrumentation-google-generativeai, allowing the span processor to recognize it unless a custom library allowlist is provided.

Changes

Google Generative AI instrumentation support

Layer / File(s) Summary
Default instrumentation library registration
packages/traceloop-sdk/src/lib/tracing/span-processor.ts
Adds the Google Generative AI instrumentation package to the exported default library list used by createSpanProcessor.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change to add the Google Generative AI instrumentation to the span processor allowlist.
Linked Issues check ✅ Passed The allowlist update supports @google/genai by preventing its spans from being dropped, which matches issue #621.
Out of Scope Changes check ✅ Passed The PR is narrowly scoped to the allowlist change and shows no unrelated code additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

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.

Support @google/genai

2 participants