You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agent-framework/user-guide/workflows/core-concepts/executors.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,46 @@ class SampleExecutor(Executor):
147
147
await ctx.send_message(number *2)
148
148
```
149
149
150
+
### The `WorkflowContext` Object
151
+
152
+
The `WorkflowContext` object provides methods for the handler to interact with the workflow during execution. The `WorkflowContext` is parameterized with the type of messages the handler will emit and the type of outputs it can yield.
153
+
154
+
The most commonly used method is `send_message`, which allows the handler to send messages to connected executors.
A handler can use `yield_output` to produce outputs that will be considered as workflow outputs and be returned/streamed to the caller as an output event:
Copy file name to clipboardExpand all lines: agent-framework/user-guide/workflows/observability.md
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,10 @@ ms.service: semantic-kernel
11
11
12
12
# Microsoft Agent Framework Workflows - Observability
13
13
14
+
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.
15
+
16
+
Aside from the standard [GenAI telemetry](https://opentelemetry.io/docs/specs/semconv/gen-ai/), 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.
17
+
14
18
::: zone pivot="programming-language-csharp"
15
19
16
20
Coming soon...
@@ -19,6 +23,46 @@ Coming soon...
19
23
20
24
::: zone pivot="programming-language-python"
21
25
22
-
Coming soon...
26
+
## Enable Observability
27
+
28
+
Observability is enabled framework-wide by setting the `ENABLE_OTEL=true` environment variable or calling `setup_observability()` at the beginning of your application.
29
+
30
+
```env
31
+
# This is not required if you run `setup_observability()` in your code
32
+
ENABLE_OTEL=true
33
+
# Sensitive data (e.g., message content) will be included in logs and traces if this is set to true
34
+
ENABLE_SENSITIVE_DATA=true
35
+
```
36
+
37
+
```python
38
+
from agent_framework.observability import setup_observability
|`message.send`| For each message sent to an executor |
50
+
|`executor.process`| For each executor processing a message |
51
+
|`edge_group.process`| For each edge group processing a message |
52
+
53
+
### Links between Spans
54
+
55
+
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.
0 commit comments