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

🐛 Bug Report: milvus get span attributes coming as search and query span attributes #2686

Open
1 task done
elinacse opened this issue Feb 26, 2025 · 1 comment · May be fixed by #2687
Open
1 task done

🐛 Bug Report: milvus get span attributes coming as search and query span attributes #2686

elinacse opened this issue Feb 26, 2025 · 1 comment · May be fixed by #2687
Labels
bug Something isn't working

Comments

@elinacse
Copy link

Which component is this bug for?

Milvus Instrumentation

📜 Description

  1. for Milvusclient.get() there is no distinct span attribute defined for get method as of existing code we are using search, query and insert semantic conventions for get(), which is misleading for a user .
    Image

👟 Reproduction steps

implement milvusclinet.get() and we will see search and query span attributes in the traces .
here is the screenshot

Image

👍 Expected behavior

We should declare span attributes specific to get method so that we will see it in traces .

Image

👎 Actual Behavior with Screenshots

Image

🤖 Python Version

3.11

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

Copy link

dosubot bot commented Feb 26, 2025

Hey @elinacse! 👋 I'm here to help you with any bugs, questions, or contributions you have for Milvus. Let me know how I can assist you!

To address the issue of misleading span attributes for the milvusclient.get() method, you can define distinct span attributes using the _set_get_attributes function. This function sets specific attributes for the get method, avoiding the use of search, query, and insert semantic conventions. Here is how the attributes are set for the get method:

@dont_throw
def _set_get_attributes(span, kwargs):
    _set_span_attribute(
        span, AISpanAttributes.MILVUS_GET_COLLECTION_NAME, kwargs.get("collection_name")
    )
    _set_span_attribute(
        span, AISpanAttributes.MILVUS_QUERY_IDS_COUNT, count_or_none(kwargs.get("ids"))
    )
    _set_span_attribute(
        span,
        AISpanAttributes.MILVUS_SEARCH_OUTPUT_FIELDS_COUNT,
        count_or_none(kwargs.get("output_fields")),
    )
    _set_span_attribute(
        span, AISpanAttributes.MILVUS_INSERT_TIMEOUT, kwargs.get("timeout")
    )
    _set_span_attribute(
        span,
        AISpanAttributes.MILVUS_GET_PARTITION_NAMES_COUNT,
        count_or_none(kwargs.get("partition_names")),
    )

These attributes include the collection name, the count of IDs, the count of output fields, the timeout, and the count of partition names, which are specific to the get operation [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the bug Something isn't working label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant