Skip to content

feat(qdrant): Add query_batch_points, query_points and query_points_groups semantic conventions #3227

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ class SpanAttributes:
QDRANT_SEARCH_COLLECTION_NAME = "qdrant.search.collection_name"
QDRANT_SEARCH_BATCH_COLLECTION_NAME = "qdrant.search_batch.collection_name"
QDRANT_SEARCH_BATCH_REQUESTS_COUNT = "qdrant.search_batch.requests_count"

QDRANT_QUERY_POINTS_COLLECTION_NAME = "qdrant.query_points.collection_name"
QDRANT_QUERY_POINTS_GROUPS_COLLECTION_NAME = "qdrant.query_points_groups.collection_name"
QDRANT_QUERY_BATCH_POINTS_COLLECTION_NAME = "qdrant.query_batch_points.collection_name"
QDRANT_QUERY_BATCH_POINTS_REQUESTS_COUNT = "qdrant.query_batch_points.requests_count"
Comment on lines +243 to +246
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Align new Qdrant attribute names with existing naming scheme.

Existing Qdrant attributes use the pattern qdrant.<operation>[_batch].collection_name / ...requests_count.
The newly-added constants introduce an extra “ points ” token, e.g. query_batch_points, which breaks that pattern and will sort far away from the related attributes in dashboards.

Consider renaming to keep the surface uniform:

-QDRANT_QUERY_POINTS_COLLECTION_NAME = "qdrant.query_points.collection_name"
-QDRANT_QUERY_POINTS_GROUPS_COLLECTION_NAME = "qdrant.query_points_groups.collection_name"
-QDRANT_QUERY_BATCH_POINTS_COLLECTION_NAME = "qdrant.query_batch_points.collection_name"
-QDRANT_QUERY_BATCH_POINTS_REQUESTS_COUNT = "qdrant.query_batch_points.requests_count"
+QDRANT_QUERY_COLLECTION_NAME = "qdrant.query.collection_name"
+QDRANT_QUERY_GROUPS_COLLECTION_NAME = "qdrant.query_groups.collection_name"
+QDRANT_QUERY_BATCH_COLLECTION_NAME = "qdrant.query_batch.collection_name"
+QDRANT_QUERY_BATCH_REQUESTS_COUNT = "qdrant.query_batch.requests_count"

This keeps “ query / query_batch / query_groups ” parallel to “ search / search_batch ”.

If the “points” wording is required by Qdrant’s API docs, at minimum add a short comment explaining the deviation to avoid confusion.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
QDRANT_QUERY_POINTS_COLLECTION_NAME = "qdrant.query_points.collection_name"
QDRANT_QUERY_POINTS_GROUPS_COLLECTION_NAME = "qdrant.query_points_groups.collection_name"
QDRANT_QUERY_BATCH_POINTS_COLLECTION_NAME = "qdrant.query_batch_points.collection_name"
QDRANT_QUERY_BATCH_POINTS_REQUESTS_COUNT = "qdrant.query_batch_points.requests_count"
QDRANT_QUERY_COLLECTION_NAME = "qdrant.query.collection_name"
QDRANT_QUERY_GROUPS_COLLECTION_NAME = "qdrant.query_groups.collection_name"
QDRANT_QUERY_BATCH_COLLECTION_NAME = "qdrant.query_batch.collection_name"
QDRANT_QUERY_BATCH_REQUESTS_COUNT = "qdrant.query_batch.requests_count"
🤖 Prompt for AI Agents
In
packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py
around lines 243 to 246, the new Qdrant attribute names include an extra
"points" token that breaks the existing naming pattern and affects sorting in
dashboards. Rename these constants to remove "points" so they follow the
established pattern like qdrant.query.collection_name,
qdrant.query_groups.collection_name, and qdrant.query_batch.collection_name. If
the "points" term is required by Qdrant's API, add a brief comment explaining
this exception to maintain clarity.


QDRANT_UPLOAD_COLLECTION_NAME = "qdrant.upload_collection.collection_name"
QDRANT_UPLOAD_POINTS_COUNT = "qdrant.upload_collection.points_count"
QDRANT_UPSERT_COLLECTION_NAME = "qdrant.upsert.collection_name"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.12"
__version__ = "0.4.13"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ show_missing = true

[tool.poetry]
name = "opentelemetry-semantic-conventions-ai"
version = "0.4.12"
version = "0.4.13"
description = "OpenTelemetry Semantic Conventions Extension for Large Language Models"
authors = [
"Gal Kleinman <[email protected]>",
Expand Down