By default, Atla instrumentation automatically captures LLM generations and agent framework information when available. This is great, but especially complex workflows often require more granular tracking, such as define which LLM generations belong to which agent execution. Advanced instrumentation gives you the tools to capture this additional context and create more meaningful traces.

Instrumenting Functions

from atla_insights import instrument

@instrument("My Customer Support Agent")  
def my_customer_support_agent():
    ...

@instrument("My Analysis Agent")  
def my_analysis_agent():
    ...

@instrument("My Orchestrator")  
def my_orchestrator(task: str):
    if task == "customer_support":
        my_customer_support_agent()
    elif task == "analysis":
        my_analysis_agent()
    else:
        ...
As a best practice, we recommend wrapping the orchestrating function in your application.If you have a multi-agent system, we recommend wrapping each agents’ functions as well.