Skip to content

Commit 0f101be

Browse files
M-HietalaCopilot
andauthored
Fixing tracing section documentation to README (#44118)
* Fixing tracing section documentation to README Fixing tracing section documentation to README. * Update sdk/ai/azure-ai-projects/README.md Co-authored-by: Copilot <[email protected]> * adding version to project installation * updating code snippets --------- Co-authored-by: Copilot <[email protected]>
1 parent bc745f0 commit 0f101be

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

sdk/ai/azure-ai-projects/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,42 @@ print(fine_tuning_job)
921921

922922
<!-- END SNIPPET -->
923923

924+
## Tracing
925+
926+
**Note:** Tracing functionality is in preliminary preview and is subject to change. Spans, attributes, and events may be modified in future versions.
927+
928+
You can add an Application Insights Azure resource to your Microsoft Foundry project. See the Tracing tab in your AI Foundry project. If one was enabled, you can get the Application Insights connection string, configure your AI Projects client, and observe traces in Azure Monitor. Typically, you might want to start tracing before you create a client or Agent.
929+
930+
### Installation
931+
932+
Make sure to install OpenTelemetry and the Azure SDK tracing plugin via
933+
934+
```bash
935+
pip install "azure-ai-projects>=2.0.0b1" azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry azure-monitor-opentelemetry
936+
```
937+
938+
You will also need an exporter to send telemetry to your observability backend. You can print traces to the console or use a local viewer such as [Aspire Dashboard](https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash).
939+
940+
To connect to Aspire Dashboard or another OpenTelemetry compatible backend, install OTLP exporter:
941+
942+
```bash
943+
pip install opentelemetry-exporter-otlp
944+
```
945+
946+
### How to enable tracing
947+
948+
Here is a code sample that shows how to enable Azure Monitor tracing:
949+
950+
<!-- SNIPPET:sample_agent_basic_with_azure_monitor_tracing.setup_azure_monitor_tracing -->
951+
952+
```python
953+
# Enable Azure Monitor tracing
954+
application_insights_connection_string = project_client.telemetry.get_application_insights_connection_string()
955+
configure_azure_monitor(connection_string=application_insights_connection_string)
956+
```
957+
958+
<!-- END SNIPPET -->
959+
924960
You may also want to create a span for your scenario:
925961

926962
<!-- SNIPPET:sample_agent_basic_with_azure_monitor_tracing.create_span_for_scenario -->

0 commit comments

Comments
 (0)