Retrieval Span Support#2924
Conversation
lmolkova
left a comment
There was a problem hiding this comment.
Retrieval is in many cases based on the database retrieval. e.g. postgreds or MongoDB instrumentation has no knowledge that it's used in the context of GenAI application.
So retrieval in a general case is just a DB call with semantics described in https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/README.md
There is a question of whether search engines are databases or should be covered by a separate or additional set of the conventions - #1869 - this is where OpenAI retrieval API should probably belong.
|
Adding more context from GenAI SIG call:
My take: Reading through lanchain, llamaindex, haystack docs, retriever is in most cases is an thin layer on top of a database or a search client which may be instrumented using database conventions and/or hypothetical search conventions. Retrievers could be more complicated and combine multiple source of data or perform additional logic, in these cases, the spans they emit might be significantly different than underlying DB calls and then multiple layers may be instrumented at the same time. In the case of thin layer abstraction / wrapper, having two spans does not improve observability, but increases costs and noise. When it comes to abstractions, there is a classic problem of instrumentation layers (ORM vs database spans, lanchain LLM vs underlying model-client spans, etc): both layers could be instrumented and there are pros and cons (DB layer has more low-level info, framework layer represents caller perspective better). The duplication is a common problem. Solutions may include:
I think path forward for this PR:
|
|
Also related #1231 |
|
Hi @lmolkova, Here are a few examples from trace loop and our instrumentation of proposed retrieval spans, also updated in the google doc linked to the issue I believe, we also discussed that we are fine moving retrieval spans from the genai to db spaces, but would the optionality to have or enable/disable genai attributes be possible as well, similar to enabling/disabling retrievals as a whole? So that retrievals could parent a db + embedding operation. |
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
|
This PR contains changes to area(s) that do not have an active SIG/project and will be auto-closed:
Such changes may be rejected or put on hold until a new SIG/project is established. Please refer to the Semantic Convention Areas |
080e240 to
64ff6d9
Compare
|
Retrieval Semconv Proposal doc (sample telemetry, attributes), adding from the open issue to the PR for more exposure: |
b683a35 to
e6e52f8
Compare
dca14ba to
b0be4af
Compare
|
This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days. |
|
Commenting to keep PR open |
lmolkova
left a comment
There was a problem hiding this comment.
Left a few minor comments, but LGTM in general!
# Conflicts: # docs/registry/attributes/gen-ai.md
# Conflicts: # docs/db/retrieval.md # docs/registry/attributes/db.md
# Conflicts: # docs/registry/attributes/gen-ai.md # Conflicts: # docs/gen-ai/gen-ai-spans.md
b4c15f5 to
2ef09a4
Compare


Fixes #2907
Changes
Add retrieval span support to db spans
Important
Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.
Merge requirement checklist
[chore]Implementations: