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

pymongo instrumentation: Invalid COLLECTION_METHODS_V3 names #791

Open
lancetarn opened this issue Aug 5, 2024 · 0 comments
Open

pymongo instrumentation: Invalid COLLECTION_METHODS_V3 names #791

lancetarn opened this issue Aug 5, 2024 · 0 comments

Comments

@lancetarn
Copy link
Contributor

The pymongo instrumentation generates some harmless-but-noisy logs for versions 3.0.0 - 4.5. There are several method names that get added to the methods we assume will be on pymongo Collections that are not valid until at least version 4.5 AFAICT. It is possible that they existed earlier and were removed for a stretch of releases.

    "drop_search_index",
    "create_search_indexes",
    "create_search_index",
    "list_search_indexes",
    "update_search_index",

These should be removed from pymongo < 4.5 instrumentation attempts.

Example log record:

WARNING:scout_apm.instruments.pymongo:Failed to instrument pymongo.Collection.create_search_indexes: AttributeError("type object 'Collection' has no attribute 'create_search_indexes'")
Traceback (most recent call last):
  File "/.../scout_apm_python/src/scout_apm/instruments/pymongo.py", line 39, in ensure_installed
    Collection, name, wrap_collection_method(getattr(Collection, name))
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Collection' has no attribute 'create_search_indexes'
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

No branches or pull requests

1 participant