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
-[How to trace your own functions](#how-to-trace-your-own-functions)
58
+
-[Adding custom attributes to spans](#adding-custom-attributes-to-spans)
57
59
-[Troubleshooting](#troubleshooting)
58
60
-[Logging](#logging)
59
61
-[Reporting issues](#reporting-issues)
@@ -1564,6 +1566,14 @@ from azure.ai.agents.telemetry import enable_telemetry
1564
1566
1565
1567
enable_telemetry(destination=sys.stdout)
1566
1568
```
1569
+
1570
+
### Enabling content recording
1571
+
Content recording controles whether message contents and tool call related details, such as parameters and return values, are captured with the traces.
1572
+
To enable content recording set the `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED` environment variable value to `true`. If the environment variable is not set, then the value will default to `false`.
1573
+
1574
+
1575
+
**Important:** The `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED` environment variable only controls content recording for built-in agent traces. When you use the `@trace_function` decorator on your own functions, all parameters and return values are always traced.
1576
+
1567
1577
### How to trace your own functions
1568
1578
1569
1579
The decorator `trace_function` is provided for tracing your own function calls using OpenTelemetry. By default the function name is used as the name for the span. Alternatively you can provide the name for the span as a parameter to the decorator.
@@ -1579,6 +1589,44 @@ Object types are omitted, and the corresponding parameter is not traced.
1579
1589
1580
1590
The parameters are recorded in attributes `code.function.parameter.<parameter_name>` and the return value is recorder in attribute `code.function.return.value`
1581
1591
1592
+
### Adding custom attributes to spans
1593
+
1594
+
Define your own span processor which adds your custom attributes:
Copy file name to clipboardExpand all lines: sdk/ai/azure-ai-agents/samples/agents_telemetry/sample_agents_basics_with_console_tracing_custom_attributes.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@
48
48
49
49
# Define the custom span processor that is used for adding the custom
0 commit comments