Share via


Microsoft Agent Framework Workflows - Observability

Observability provides insights into the internal state and behavior of workflows during execution. This includes logging, metrics, and tracing capabilities that help monitor and debug workflows.

Aside from the standard GenAI telemetry, Agent Framework Workflows emits additional spans, logs, and metrics to provide deeper insights into workflow execution. These observability features help developers understand the flow of messages, the performance of executors, and any errors that may occur.

Enable Observability

Observability is enabled framework-wide by setting the ENABLE_OTEL=true environment variable or calling setup_observability() at the beginning of your application.

# This is not required if you run `setup_observability()` in your code
ENABLE_OTEL=true
# Sensitive data (e.g., message content) will be included in logs and traces if this is set to true
ENABLE_SENSITIVE_DATA=true
from agent_framework.observability import setup_observability

setup_observability(enable_sensitive_data=True)

Workflow Spans

Span Name Description
workflow.build For each workflow build
workflow.run For each workflow execution
message.send For each message sent to an executor
executor.process For each executor processing a message
edge_group.process For each edge group processing a message

When an executor sends a message to another executor, the message.send span is created as a child of the executor.process span. However, the executor.process span of the target executor will not be a child of the message.send span because the execution is not nested. Instead, the executor.process span of the target executor is linked to the message.send span of the source executor. This creates a traceable path through the workflow execution.

For example:

Span Relationships

Next Steps