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/observability.md
+25-10Lines changed: 25 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -333,11 +333,20 @@ The `configure_otel_providers()` function automatically reads standard OpenTelem
333
333
334
334
See the [OpenTelemetry spec](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) for more details.
335
335
336
-
### Azure AI Foundry setup
336
+
### Microsoft Foundry setup
337
337
338
-
Azure AI Foundry has built-in support for tracing with visualization for your spans.
338
+
Microsoft Foundry has built-in support for tracing with visualization for your spans.
339
339
340
-
For Azure AI projects, use the `client.configure_azure_monitor()` method:
340
+
Make sure you have your Foundry configured with a Azure Monitor instance, for details see [Foundry docs](/azure/ai-foundry/how-to/monitor-applications?view=foundry-classic)
341
+
342
+
#### Install the `azure-monitor-opentelemetry` package:
343
+
344
+
```bash
345
+
pip install azure-monitor-opentelemetry
346
+
```
347
+
348
+
#### Configure observability directly from the `AzureAIClient`:
349
+
For Azure AI Foundry projects, you can configure observability directly from the `AzureAIClient`:
For non-Azure AI projects with Application Insights:
358
366
359
-
1) Install the `azure-monitor-opentelemetry` package:
367
+
#### Configure azure monitor and optionally enable instrumentation:
368
+
For non-Azure AI projects with Application Insights, make sure you setup a custom agent in Foundry, see [details](azure/ai-foundry/control-plane/register-custom-agent?view=foundry).
360
369
361
-
```bash
362
-
pip install azure-monitor-opentelemetry
363
-
```
364
-
365
-
2) Configure observability:
370
+
Then run your agent with the same _OpenTelemetry agent ID_ as registered in Foundry, and configure azure monitor as follows:
366
371
367
372
```python
368
373
from azure.monitor.opentelemetry import configure_azure_monitor
@@ -373,7 +378,17 @@ configure_azure_monitor(
373
378
resource=create_resource(),
374
379
enable_live_metrics=True,
375
380
)
381
+
# optional if you do not have ENABLE_INSTRUMENTATION in env vars
376
382
enable_instrumentation()
383
+
384
+
# Create your agent with the same OpenTelemetry agent ID as registered in Foundry
0 commit comments