Hello all, I am seeing a weird issue. When I activate the handler in llamaindex:
set_global_handler("arize_phoenix")
etriever = VectorIndexRetriever(
index=vector_index,
similarity_top_k=10,
)
# configure response synthesizer
response_synthesizer = get_response_synthesizer(
llm=llm,
)
# assemble query engine
query_engine = RetrieverQueryEngine(
retriever=retriever,
response_synthesizer=response_synthesizer,
# node_postprocessors=[SimilarityPostprocessor(similarity_cutoff=0.7)],
)It keeps creating my spans like this:
But this is wrong, it should be looking more like this:
where it is a chain i can dive into. I cannot even see the llm context prompt as well, so something is wrong.
Hi Adam, thanks for your interest in Phoenix! There鈥檚 currently an issue with llamaindex instrumentation where sometimes slans aren鈥檛 grouped correctly due to changes in their callback system, we鈥檙e currently working with the their team to get this resolved on their end. Meanwhile there can be several causes for this, the spans might not group until the root span is closed, if you鈥檙e producing streaming results, can you try consuming all the streams? Sometimes it will group the spans then
writing code like this groups them
No problem! Glad to hear that鈥檚 working for now. We鈥檙e hoping to resolve this soon
Adam K. darn :(. We鈥檙e hoping to fix this as soon as possible, though last I checked we鈥檙e waiting on some updates on LlamaIndex as well that they鈥檙e actively working on. There are manual instrumentation approaches that might help resolve the issue temporarily, is there any chance you can give us a MRE to look at?
Adam K. sorry about that! Here鈥檚 our tutorial for manual instrumentation: https://github.com/Arize-ai/phoenix/tree/main/examples/manually-instrumented-chatbot. I鈥檓 hoping depending on what your setup looks like we can manually add a span that ties everything together for you. By an MRE I mean a minimal reproducible example that we can use to test out
that looks pretty painful to add all that manually
Yeah, the hope is we only need to add one so your traces can be grouped together, it'd hard for us to tell for sure without an example to think about though
Dustin N. the MRE is really something like this:
set_global_handler("arize_phoenix")
query_engine = vector_index.as_query_engine(
llm=llm,
similarity_top_k=20,
node_postprocessors=[reranker],
refine_template=PromptTemplate(prompt_str),
# text_qa_template=PromptTemplate(prompt_str),
)
output = query_engine.query("my query")