Skip to content

Conversation

@amychisholm03
Copy link
Contributor

@amychisholm03 amychisholm03 commented Nov 5, 2025

This PR resolves #3442.

@amychisholm03 amychisholm03 changed the title Nr 3442/langchain subscriber refactor: Updated @langchain/core instrumentation to subscribe to events emitted Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

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

Files with missing lines Patch % Lines
lib/subscribers/langchain/runnable.js 89.28% 6 Missing ⚠️
lib/subscribers/langchain/tool.js 93.18% 6 Missing ⚠️
lib/subscribers/langchain/vectorstore.js 95.48% 6 Missing ⚠️
lib/subscribers/base.js 44.44% 5 Missing ⚠️
lib/subscribers/langchain/runnable-stream.js 97.81% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3493       +/-   ##
===========================================
+ Coverage   81.46%   97.64%   +16.17%     
===========================================
  Files         409      422       +13     
  Lines       54383    55857     +1474     
  Branches        1        1               
===========================================
+ Hits        44305    54539    +10234     
+ Misses      10078     1318     -8760     
Flag Coverage Δ
integration-tests-cjs-20.x 74.03% <50.60%> (?)
integration-tests-cjs-22.x 74.07% <50.60%> (?)
integration-tests-cjs-24.x 74.83% <50.60%> (?)
integration-tests-esm-20.x 52.70% <50.60%> (+0.20%) ⬆️
integration-tests-esm-22.x 52.75% <50.60%> (+0.20%) ⬆️
integration-tests-esm-24.x 53.95% <50.60%> (+0.19%) ⬆️
unit-tests-20.x 88.71% <50.60%> (?)
unit-tests-22.x 88.75% <50.60%> (?)
unit-tests-24.x 88.76% <50.60%> (?)
versioned-tests-20.x 81.08% <96.84%> (-0.25%) ⬇️
versioned-tests-22.x 81.08% <96.84%> (-0.25%) ⬇️
versioned-tests-24.x 81.02% <96.84%> (-0.24%) ⬇️

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 force-pushed the NR-3442/langchain-subscriber branch from 51a3401 to f44078a Compare November 5, 2025 22:58
@amychisholm03 amychisholm03 marked this pull request as ready for review November 5, 2025 23:32
@amychisholm03 amychisholm03 force-pushed the NR-3442/langchain-subscriber branch from 9f9d6b0 to 7c0304a Compare November 6, 2025 23:02
@amychisholm03 amychisholm03 force-pushed the NR-3442/langchain-subscriber branch from 7c0304a to 427f4c0 Compare November 11, 2025 16:36
@amychisholm03 amychisholm03 force-pushed the NR-3442/langchain-subscriber branch from 427f4c0 to a050bbb Compare November 11, 2025 21:43
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.

Same as google gen ai. we need to look at the spec for enabling/disabling AI monitoring, not sure if we have this correct

*/
const trackingPkgs = [
'@azure/openai',
'@langchain/core/tools',
Copy link
Member

Choose a reason for hiding this comment

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

this is not what you may think it is. This is to increment a tracking metric which doesn't apply here because we instrument these packages

Copy link
Member

Choose a reason for hiding this comment

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

Before this was technically broken. The package that currently gets registered is @langchain/core. So if a customer wants to disable langchain instrumentation they can set this.config.instrumentation['@langchain/core'].enabled to false. We will have to update angler to properly track this package though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will not create the Supportability metric if I omit this. Because @langchain/core itself is never required directly, I had to add its children packages here in order for the metrics to be created.

Copy link
Member

Choose a reason for hiding this comment

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

let's talk about this as well. this is not the place for this

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 langchain instrumentation to rely on tracing channel instrumentation

2 participants