Llama Index span custom attributes ๐งต
๐กย Hint: Mention RunLLM in the thread for followups.
Hi guys, I'm trying to add custom attributes to the spans automatically created by Llama Index, which will help us better query them in Phoenix. Llama Index provides the instrument_tags method (in llama-index-core/llama_index/core/instrumentation/dispatcher.py:33) that allows binding custom tags:
with instrument_tags({"my_custom_attribute": "anything_i_want"}):
resp = llm.complete("Hello World!")These tags are passed to _SpanHandler.new_span in openinference/instrumentation/llama_index/_handler.py:769, but currently, the handler doesn't utilize these tags. Should we update openinference/instrumentation/llama_index to handle these tags explicitly, or is there another recommended approach to attach custom attributes to internal Llama Index spans? Thanks for your support!
