Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vectorstore instrumentation automation #1279

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

lrafeei
Copy link
Contributor

@lrafeei lrafeei commented Dec 28, 2024

This PR adds a new LangChain Vectorstore instrumentation populator to the scripts directory as well as some tweaks to the existing instrumentation.

@lrafeei lrafeei requested a review from a team as a code owner December 28, 2024 00:34
Copy link

github-actions bot commented Dec 28, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 2 0 5.88s
✅ PYTHON black 4 0 0 2.23s
✅ PYTHON flake8 4 0 1.21s
✅ PYTHON isort 4 0 0 0.23s
✅ PYTHON pylint 4 0 7.06s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.28%. Comparing base (415dc73) to head (e7bb389).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1279      +/-   ##
==========================================
- Coverage   81.28%   81.28%   -0.01%     
==========================================
  Files         201      201              
  Lines       22174    22173       -1     
  Branches     3519     3519              
==========================================
- Hits        18025    18024       -1     
  Misses       2982     2982              
  Partials     1167     1167              

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

@TimPansino TimPansino changed the base branch from main to develop-tests January 8, 2025 23:45
Comment on lines 2177 to 2180
_process_module_definition(
"langchain_community.vectorstores.redis.base",
"langchain_community.vectorstores.redis",
"newrelic.hooks.mlmodel_langchain",
"instrument_langchain_vectorstore_similarity_search",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not need the old hook too for backwards compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The location of these hooks did not actually move from previous versions. In the case of Redis and Docarray, there is an init.py file that imports these classes, so I'm just moving our hook for these vectorstores to be on the same level as the others.

@lrafeei lrafeei requested a review from TimPansino January 9, 2025 18:13
@TimPansino TimPansino changed the base branch from develop-tests to main January 18, 2025 00:27
@mergify mergify bot removed the tests-failing label Jan 18, 2025
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.

3 participants