Skip to main content

Install

Instrument

instrument_autogen wraps a single ConversableAgent (or subclass — AssistantAgent, UserProxyAgent). Call it per agent you want traced.

What gets captured

  • An agent span around every initiate_chat() call, with the initiating message as input and the final message history as output.
  • One child span per generate_reply() call — captures the sender, the message being replied to, and the generated reply.
  • LLM calls nested under replies appear as llm spans when you also instrument the underlying provider.

Known gotchas

  • Instrument every agent in the conversation. initiate_chat on agent A triggers generate_reply on agent B; both need to be instrumented to get a complete waterfall.
  • human_input_mode="ALWAYS" — when a human is in the loop, the wait for stdin is captured as span duration. Expect long-lived spans; set alerting thresholds accordingly.
  • GroupChat. Spans are recorded per agent, not per group. To get a single trace per group run, initiate the chat inside one trulayer.trace(...) block and instrument every member.