WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@yizhao1998
Copy link

@yizhao1998 yizhao1998 commented Dec 23, 2025

  • I have added tests that cover my changes.
  • If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • (If applicable) I have updated the documentation accordingly.

Important

Update Qdrant client support to 1.16+, modify instrumentation and tests for new client methods.

  • Dependencies:
    • Update qdrant-client dependency to ^1.16.1 in pyproject.toml.
    • Change _instruments in __init__.py to require qdrant-client >= 1.16.
  • Instrumentation:
    • Remove methods upload_records, search, search_batch, search_groups, discover, discover_batch, recommend, recommend_batch, recommend_groups from async_qdrant_client_methods.json and qdrant_client_methods.json.
    • Add methods query_points, query_batch_points, query_points_groups, scroll, retrieve, facet, search_matrix_offsets, search_matrix_pairs to both JSON files.
    • Update _wrap() in wrapper.py to handle new methods and remove handling for removed methods.
  • Tests:
    • Update test functions in test_qdrant_instrumentation.py to use new methods query_points and query_batch_points instead of search and search_batch.
    • Fix typo in test fixture docstring in test_qdrant_instrumentation.py.

This description was created by Ellipsis for eb89d20. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Updated OpenTelemetry instrumentation to support Qdrant client version 1.16 and later (previously 1.7+).
    • Instrumentation methods aligned with latest Qdrant client API, including new query and search matrix operations.
    • Deprecated method tracking removed.
  • Chores

    • Updated test dependency to Qdrant client 1.16.1.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Dec 23, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

Updated OpenTelemetry instrumentation for Qdrant client to support version 1.16+, introducing renamed query-centric methods (search → query_points, recommend → query_batch_points), removing deprecated methods, adding facet and matrix search capabilities, and updating all corresponding instrumentation wrappers and tests.

Changes

Cohort / File(s) Summary
Version constraints
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/__init__.py, packages/opentelemetry-instrumentation-qdrant/pyproject.toml
Updated minimum qdrant-client version constraint from 1.7 to 1.16 in instrumentation metadata; updated test dependency from ^1.9.1 to ^1.16.1
Method instrumentation manifests
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/async_qdrant_client_methods.json, packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/qdrant_client_methods.json
Removed deprecated methods (upload_records, search, search_batch, search_groups, discover, discover_batch, recommend, recommend_batch, recommend_groups, scroll); added new methods (query_points, query_batch_points, query_points_groups, retrieve, facet, search_matrix_offsets, search_matrix_pairs)
Instrumentation wrapper logic
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py
Updated method dispatch mapping and attribute-setting helper functions to use new query-centric method names; renamed _set_search_attributes and _set_batch_search_attributes to _set_query_attributes and _set_batch_query_attributes
Tests and fixtures
packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py
Renamed test helpers (search → query_points, search_batch → query_batch_points); updated test function names and span attribute lookups to match new method names; updated API calls to use new Qdrant client method signatures (models.SearchRequest → models.QueryRequest, parameter vector → query)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating qdrant instrumentation support from 1.7 to 1.16+, which is the primary objective of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to eb89d20 in 59 seconds. Click for details.
  • Reviewed 375 lines of code in 6 files
  • Skipped 1 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/__init__.py:23
  • Draft comment:
    Updated qdrant-client dependency from >=1.7 to >=1.16. Ensure this breaking change is intentional and that users are aware of the upgrade.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is about a dependency change, specifically updating the qdrant-client dependency version. The comment asks the author to ensure the change is intentional and that users are aware, which violates the rule against asking the author to confirm intentions or ensure awareness. Therefore, this comment should be removed.
2. packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/async_qdrant_client_methods.json:8
  • Draft comment:
    Removed deprecated methods (e.g. upload_records, search, search_batch, search_groups, discover, recommend, etc.) and added new methods (query_points, query_batch_points, query_points_groups, scroll, retrieve, facet, search_matrix_offsets, search_matrix_pairs) to align with qdrant-client 1.16+ API.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/qdrant_client_methods.json:8
  • Draft comment:
    Updated method mappings in QdrantClient JSON similarly to the async client. Deprecated methods are removed and replaced with new query methods. Verify that these mappings match the updated client API.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py:50
  • Draft comment:
    Removed branch for 'upload_records' and updated conditionals to handle new query methods. Also, renamed helper functions from _set_search_attributes to _set_query_attributes and _set_batch_search_attributes to _set_batch_query_attributes to reflect API changes.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. packages/opentelemetry-instrumentation-qdrant/pyproject.toml:37
  • Draft comment:
    Updated the qdrant-client dependency version in test dependencies to ^1.16.1. Confirm that all tests and behavior are compatible with this newer version.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to confirm compatibility with a new dependency version, which violates the rule against asking for confirmation or ensuring behavior is intended. It also relates to dependency changes, which should not be commented on unless there's a specific issue identified.
6. packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py:7
  • Draft comment:
    Fixed typo in fixture docstring ('in-memroy' to 'in-memory') and updated test cases to reflect new method names (query_points, query_batch_points) as well as updated attribute keys.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, describing what changes were made in the PR. It does not provide any suggestions, ask for confirmation, or highlight any potential issues. According to the rules, purely informative comments should be removed.

Workflow ID: wflow_RMNaM7zl5ezLoqTP

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py (1)

101-109: Consider prefixing unused args with underscore to silence linter.

Static analysis flags args as unused in both _set_query_attributes and _set_batch_query_attributes. If args is kept for API consistency or future use, prefix it with _ to indicate intentional non-use.

🔎 Proposed fix
 @dont_throw
-def _set_query_attributes(span, args, kwargs):
+def _set_query_attributes(span, _args, kwargs):
     limit = kwargs.get("limit") or 10
     _set_span_attribute(span, SpanAttributes.VECTOR_DB_QUERY_TOP_K, limit)


 @dont_throw
-def _set_batch_query_attributes(span, args, kwargs, method):
+def _set_batch_query_attributes(span, _args, kwargs, method):
     requests = kwargs.get("requests") or []
     _set_span_attribute(span, f"qdrant.{method}.requests_count", len(requests))
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0fc7340 and eb89d20.

⛔ Files ignored due to path filters (1)
  • packages/opentelemetry-instrumentation-qdrant/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/__init__.py
  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/async_qdrant_client_methods.json
  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/qdrant_client_methods.json
  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py
  • packages/opentelemetry-instrumentation-qdrant/pyproject.toml
  • packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Store API keys only in environment variables/secure vaults; never hardcode secrets in code
Use Flake8 for code linting and adhere to its rules

Files:

  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/__init__.py
  • packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py
  • packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py
🧬 Code graph analysis (2)
packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py (1)
packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py (1)
  • SpanAttributes (64-245)
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py (2)
packages/opentelemetry-instrumentation-chromadb/opentelemetry/instrumentation/chromadb/wrapper.py (2)
  • _set_query_attributes (154-180)
  • _set_span_attribute (26-30)
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/utils.py (1)
  • dont_throw (6-28)
🪛 Ruff (0.14.10)
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py

101-101: Unused function argument: args

(ARG001)


107-107: Unused function argument: args

(ARG001)

🔇 Additional comments (10)
packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/wrapper.py (1)

58-65: LGTM - Method dispatch updated for query-centric API.

The updated dispatch logic correctly routes the new query-related methods (query_points, query_points_groups, query_batch, query_batch_points) to the appropriate attribute-setting functions.

packages/opentelemetry-instrumentation-qdrant/tests/test_qdrant_instrumentation.py (3)

43-44: Attribute key correctly updated to match dynamic naming pattern.

The change from SpanAttributes.QDRANT_UPSERT_COLLECTION_NAME to the hardcoded string "qdrant.upsert.collection_name" is correct, as the wrapper dynamically generates collection name attributes using f"qdrant.{method}.collection_name".


73-85: Tests properly updated for query_points API.

The test correctly uses the new query_points method with the renamed query parameter (previously vector) and validates the expected span attributes.


88-108: Tests properly updated for query_batch_points API.

The test correctly uses query_batch_points with models.QueryRequest (replacing SearchRequest) and validates the batch request count attribute.

Consider adding test coverage for new methods.

The PR introduces several new instrumented methods (facet, search_matrix_offsets, search_matrix_pairs, scroll, retrieve) in the JSON configs, but tests only cover query_points and query_batch_points. Consider adding basic tests for the new methods to ensure instrumentation works correctly.

packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/qdrant_client_methods.json (2)

32-56: New query-centric methods added correctly.

The method configurations for query_points, query_batch_points, query_points_groups, scroll, and retrieve follow the established naming pattern and align with the qdrant-client 1.16+ API changes.


92-106: New facet and matrix search methods added.

The additions of facet, search_matrix_offsets, and search_matrix_pairs extend instrumentation coverage for facet counting and distance matrix calculation capabilities available in qdrant-client since version 1.12.

Likely an incorrect or invalid review comment.

packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/__init__.py (1)

23-23: Breaking change: Minimum qdrant-client version raised from 1.7 to 1.16.

This constraint update is necessary since the instrumentation wraps methods (query_points, query_batch_points, etc.) that only exist in qdrant-client 1.16+. Users on older versions will need to upgrade or pin to an older instrumentation version.

Consider adding a note to the changelog or release notes about this breaking change for users currently on qdrant-client versions 1.7-1.15.

packages/opentelemetry-instrumentation-qdrant/opentelemetry/instrumentation/qdrant/async_qdrant_client_methods.json (2)

32-56: Async methods correctly mirror sync client updates.

The AsyncQdrantClient method configurations are symmetric with QdrantClient, using consistent qdrant.{method} span names for both sync and async operations.


92-106: New async facet and matrix methods added.

Consistent with the sync client, the async configurations for facet, search_matrix_offsets, and search_matrix_pairs complete the instrumentation coverage for the new qdrant-client 1.16+ capabilities.

packages/opentelemetry-instrumentation-qdrant/pyproject.toml (1)

37-37: Verify that qdrant-client 1.16.1 is available on PyPI.

Version 1.16.1 is available on PyPI (released November 25, 2025), and no security advisories were found for this release. The caret version constraint ^1.16.1 allows versions from 1.16.1 through <2.0.0, which aligns with the runtime requirements.

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.

2 participants