Skip to content

fix(milvus): Added New Semantic Conventions for Milvus Search (Request for Version Update 0.4.5 -> 0.4.6) #2883

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

Merged
merged 11 commits into from
May 9, 2025

Conversation

divyapathak24
Copy link
Contributor

@divyapathak24 divyapathak24 commented May 5, 2025

Fixes #2808

  • 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

Added new semantic conventions for Milvus search and updated version to 0.4.6.

  • Semantic Conventions:
    • Added new attributes to SpanAttributes in __init__.py for Milvus search: MILVUS_SEARCH_PARTITION_NAMES, MILVUS_SEARCH_QUERY_VECTOR_DIMENSION, MILVUS_SEARCH_RESULT_COUNT, MILVUS_SEARCH_RESULT_DISTANCES, MILVUS_SEARCH_RESULT_TOP_IDS.
  • Version Update:
    • Updated version to 0.4.6 in version.py and pyproject.toml.

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

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 8555248 in 51 seconds. Click for details.
  • Reviewed 37 lines of code in 3 files
  • Skipped 0 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-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py:196
  • Draft comment:
    Added new Milvus search attributes (partition_names, query_vector_dimension, result_count, result_distances, result_top_ids). Ensure the documentation is updated to reflect these conventions.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/version.py:1
  • Draft comment:
    Version bump to 0.4.6 is consistent with changes. Confirm that dependent projects are updated.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. packages/opentelemetry-semantic-conventions-ai/pyproject.toml:11
  • Draft comment:
    Pyproject.toml version updated to 0.4.6. Ensure that package metadata aligns with the changes.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py:194
  • Draft comment:
    New Milvus search constants (PARTITION_NAMES, QUERY_VECTOR_DIMENSION, RESULT_COUNT, RESULT_DISTANCES, RESULT_TOP_IDS) are added and follow the naming pattern. Consider adding inline documentation or cross-reference to the feature issue for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/version.py:1
  • Draft comment:
    Version bump from 0.4.5 to 0.4.6 looks correct.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative and does not provide any actionable feedback or suggestions. It simply states that the version bump looks correct, which is not necessary for the PR author to know.
6. packages/opentelemetry-semantic-conventions-ai/pyproject.toml:11
  • Draft comment:
    The version in pyproject.toml is updated to 0.4.6 consistently with the version.py change.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative and does not provide any actionable feedback or suggestions. It simply acknowledges a change that was made, which violates the rule against making purely informative comments.

Workflow ID: wflow_8dTtgBVF4rXRRCRf

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

@divyapathak24
Copy link
Contributor Author

@nirga @galkleinman Added new milvus search attributes

MILVUS_SEARCH_TIMEOUT = "db.milvus.search.timeout"
MILVUS_SEARCH_RESULT_COUNT = "db.milvus.search.result_count"
MILVUS_SEARCH_RESULT_DISTANCES = "db.milvus.search.result_distances"
Copy link
Member

Choose a reason for hiding this comment

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

@divyapathak24 shouldn't we reuse existing attributes - so that we'll have the same attribute across vector DBs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nirga That makes sense. However, we don't currently have a results_count and query_vector_dimension attribute in EventAttributes. I'll add it so we can use it consistently for all DB events.

cc:@hk-bmi

DB_SEARCH_RESULT_METADATA = "db.search.result.metadata"
DB_SEARCH_RESULT_VECTOR = "db.search.result.vector"
DB_SEARCH_RESULT_DOCUMENT = "db.search.result.document"


Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nirga Reusing DB_QUERY* events and event attributes to represent search operation can be misleading, both are different operations. So, I introduced the DB_SEARCH* fields. These are intended to generically support search functionality across different vector DBs as well.

@@ -195,6 +195,9 @@ class SpanAttributes:
MILVUS_SEARCH_PARTITION_NAMES_COUNT = "db.milvus.search.partition_names_count"
MILVUS_SEARCH_SEARCH_PARAMS = "db.milvus.search.search_params"
MILVUS_SEARCH_TIMEOUT = "db.milvus.search.timeout"
MILVUS_SEARCH_PARTITION_NAMES = "db.milvus.search.partition_names_count"
MILVUS_SEARCH_RESULT_COUNT = "db.milvus.search.result_count"
MILVUS_SEARCH_QUERY_VECTOR_DIMENSION = "db.milvus.search.query_vector_dimension"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are better suited as span attributes since the result count serves as a summary of the overall search outcome, and the query vector dimension represents input query and is not part of the output.

@nirga nirga force-pushed the milvus-semconvai branch 3 times, most recently from 8b0ebda to 4a20541 Compare May 8, 2025 09:25
@nirga
Copy link
Member

nirga commented May 8, 2025

hey @divyapathak24 can you fix the lint issues?

@divyapathak24
Copy link
Contributor Author

hey @divyapathak24 can you fix the lint issues?

@nirga Done

@nirga nirga force-pushed the milvus-semconvai branch from 1049e61 to e6c14e4 Compare May 9, 2025 18:53
@nirga nirga merged commit a40b28b into traceloop:main May 9, 2025
15 of 16 checks passed
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.

🚀 Feature: Enhancing Milvus VectorDB Instrumentation for Improved search Monitoring
2 participants