trace_map
in end_trace
to be None? In attempting to add arize-phoenix to privateGPT I'm noticing significantly different behavior than the toy project i created to test phoenix. For some reason the traces never get emmited in privateGPT and it seems to be because OpenInferenceTraceCallbackHandler.end_trace()
is not called with trace_map
. end_trace
is called from as wellend_trace
is in fact getting called in both projects. @graceful_fallback(_null_fallback) def end_trace( self, trace_id: Optional[str] = None, trace_map: Optional[ChildEventIds] = None, ) -> None: if not trace_map: print("trace_map is None") return # TODO: investigate when empty or None trace_map is passed print (f"adding spans") _add_spans_to_tracer( event_id_to_event_data=self._event_id_to_event_data, trace_map=trace_map, tracer=self._tracer, ) self._event_id_to_event_data = defaultdict(lambda: CBEventData())
trace_map
is always None is the privateGPT project and not none in the toy tester project built in the same conda envon_event_start
and on_event_end
are called multiple timesllama_index.set_global_handler("simple")
SimpleChatEngine.stream_chat()
function which is all i'm trying to get observability on for the momentadding to trace map in base: dd3e7ed6-a2c8-42aa-bd8d-fa1ae636d701 -> root trace map is now {"root": ["dd3e7ed6-a2c8-42aa-bd8d-fa1ae636d701"]} in on_event_start adding to trace map in base: fc6d5d59-09df-401d-bc33-728d8fed509d -> root trace map is now {"root": ["dd3e7ed6-a2c8-42aa-bd8d-fa1ae636d701", "fc6d5d59-09df-401d-bc33-728d8fed509d"]} in on_event_start stream_chat was called adding to trace map in base: 1adb7661-bbd7-4b21-aba2-4aea9b05b3d9 -> root trace map is now {"root": ["dd3e7ed6-a2c8-42aa-bd8d-fa1ae636d701", "fc6d5d59-09df-401d-bc33-728d8fed509d", "1adb7661-bbd7-4b21-aba2-4aea9b05b3d9"]} ending trace: chat, trace_map: defaultdict(<class 'list'>, {}), handler: <phoenix.trace.llama_index.callback.OpenInferenceTraceCallbackHandler object at 0x2a3a6db90> in on_event_start json stringified trace_map: {} trace_map is None