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
> Using this method implicitly enables telemetry, so you do not need to set the `ENABLE_OTEL` environment variable. You can still set `ENABLE_SENSITIVE_DATA` to control whether sensitive data is included in the telemetry, or call the `setup_observability()` function with the `enable_sensitive_data` parameter set to `True`.
90
97
91
98
#### Logging
99
+
Agent Framework has a built-in logging configuration that works well with telemetry. It sets the format to a standard format that includes timestamp, pathname, line number, and log level. You can use that by calling the `setup_logging()` function from the `agent_framework` module.
100
+
101
+
```python
102
+
from agent_framework import setup_logging
103
+
104
+
setup_logging()
105
+
```
92
106
You can control at what level logging happens and thus what logs get exported, you can do this, by adding this:
93
107
94
108
```python
@@ -105,7 +119,7 @@ This folder contains different samples demonstrating how to use telemetry in var
105
119
106
120
| Sample | Description |
107
121
|--------|-------------|
108
-
|[setup_observability_with_parameters.py](./setup_observability_with_parameters.py)| A simple example showing how to setup telemetry by passing in parameters to the `setup_observability()` function. |
122
+
|[setup_observability_with_parameters.py](./setup_observability_with_parameters.py)| A simple example showing how to setup telemetry by passing in parameters to the `setup_observability()` function. This sample also uses the `setup_logging()` function to configure logging. |
109
123
|[setup_observability_with_env_var.py](./setup_observability_with_env_var.py)| A simple example showing how to setup telemetry with the `setup_observability()` function using environment variables. |
110
124
|[agent_observability.py](./agent_observability.py)| A simple example showing how to setup telemetry for an agentic application. |
111
125
|[azure_ai_agent_observability.py](./azure_ai_agent_observability.py)| A simple example showing how to setup telemetry for an agentic application with an Azure AI project. |
0 commit comments