Is there an open inference instrumentation that stores retriever traces OpenInferenceSpanKindValues.RETRIEVER storing SpanAttributes.RETRIEVAL_DOCUMENTS inside attributes
Yes, OpenInference instrumentation libraries (such as for LangChain and LlamaIndex) automatically create spans with kind OpenInferenceSpanKindValues.RETRIEVER and store retrieved documents in the SpanAttributes.RETRIEVAL_DOCUMENTS attribute. This is confirmed by test cases and code in openinference-instrumentation-llama-index and openinference-instrumentation-langchain, where retriever spans are checked for these attributes.For custom retrievers, you can also manually set the span kind to RETRIEVER and add the RETRIEVAL_DOCUMENTS attribute using the OpenInference semantic conventions, as shown in instrumentation examples and manual instrumentation docs.Would you like more detail or a code example?Sources: - openinference-instrumentation-llama-index/test_handler.py - Slack: Instrumentation Example - openinference-instrumentation-langchain
馃挕聽Hint: Mention RunLLM in the thread for followups.
