Skip to content

Conversation

@amychisholm03
Copy link
Contributor

This PR resolves #3441

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 99.07621% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.64%. Comparing base (37c43f5) to head (8318d26).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/subscribers/google-genai/embed-content.js 96.77% 2 Missing ⚠️
...ubscribers/google-genai/generate-content-stream.js 98.16% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3467       +/-   ##
===========================================
+ Coverage   81.46%   97.64%   +16.17%     
===========================================
  Files         409      424       +15     
  Lines       54383    55846     +1463     
  Branches        1        1               
===========================================
+ Hits        44305    54532    +10227     
+ Misses      10078     1314     -8764     
Flag Coverage Δ
integration-tests-cjs-20.x 73.58% <51.03%> (?)
integration-tests-cjs-22.x 73.63% <51.03%> (?)
integration-tests-cjs-24.x 74.38% <51.03%> (?)
integration-tests-esm-20.x 52.43% <51.03%> (-0.08%) ⬇️
integration-tests-esm-22.x 52.47% <51.03%> (-0.08%) ⬇️
integration-tests-esm-24.x 53.66% <51.03%> (-0.10%) ⬇️
unit-tests-20.x 88.67% <51.03%> (?)
unit-tests-22.x 88.70% <51.03%> (?)
unit-tests-24.x 88.71% <51.03%> (?)
versioned-tests-20.x 81.05% <99.07%> (-0.27%) ⬇️
versioned-tests-22.x 81.06% <99.07%> (-0.27%) ⬇️
versioned-tests-24.x 80.99% <99.07%> (-0.26%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amychisholm03 amychisholm03 marked this pull request as ready for review October 27, 2025 19:12
@amychisholm03 amychisholm03 force-pushed the NR-3441/google-genai-subscriber branch 2 times, most recently from e5ddbe6 to 802f0a4 Compare October 30, 2025 21:36
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

Nice work, I had a few comments around some things. I think we can also file a ticket to abstract LLM based instrumentation to have a base LLM class to remove this copy pasta around recording messages, errors, etc but for a different story.

}
}
return result
}.bind(this)
Copy link
Member

Choose a reason for hiding this comment

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

you could just save off this references as const self = this and use self.<fn> within the wrapped stream

@amychisholm03 amychisholm03 force-pushed the NR-3441/google-genai-subscriber branch 2 times, most recently from 7dc5606 to bb58196 Compare November 3, 2025 20:46
}

handler(data, ctx) {
if (!this.agent?.config?.ai_monitoring?.enabled) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!this.agent?.config?.ai_monitoring?.enabled) {
if (!this?.config?.ai_monitoring?.enabled) {

Copy link
Member

Choose a reason for hiding this comment

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

I'm confused why is this being checked? It's build into the google gen ai base handler?

Copy link
Member

Choose a reason for hiding this comment

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

OIC, this is because you can dynamically set this config after start up. I missed that when porting over openai. We should clean this up to reduce redundancy though but we can handle that in the AIM subscriber abstraction. Can you make sure you file that ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I was planning on making the ticket shortly

@amychisholm03
Copy link
Contributor Author

agent.config -> config will be addressed in #3487

@amychisholm03 amychisholm03 force-pushed the NR-3441/google-genai-subscriber branch from a0c5b10 to 8318d26 Compare November 11, 2025 21:42
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

We may have to re-check the spec for ai monitoring. Right now when the subscriber is registered it checks if ai_monitoring.enabled is set to true. If not, it will not subscribe. Any subsequent checks will never be false. This may be broken in openai as well. You should use this.config to check config, not this.agent.config. Yes they are the same thing but we're trying to create consistency.

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

Labels

None yet

Projects

Status: Needs PR Review

Development

Successfully merging this pull request may close these issues.

Update google genai instrumentation to rely on tracing channel instrumentation

2 participants