Skip to content

Commit 8c75022

Browse files
Updated examples
1 parent 45e0365 commit 8c75022

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

articles/ai-studio/how-to/develop/trace-local-sdk.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,11 @@ pip install azure-core-tracing-opentelemetry
4141
pip install azure-monitor-opentelemetry
4242
```
4343

44-
Use the following code to enable instrumentation of the Azure AI Foundry SDK and logging to your AI project:
44+
Refer the following samples to get started with tracing using Azure AI Project SDK:
45+
- [Python Sample with console tracing](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py) containing fully runnable Python code for tracing using synchronous and asynchronous clients.
46+
- [Python Sample with Azure Monitor](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-inference/samples/sample_chat_completions_with_tracing.py) containing fully runnable Python code for tracing using synchronous and asynchronous clients.
4547

46-
```Python
47-
from azure.monitor.opentelemetry import configure_azure_monitor
4848

49-
# Enable instrumentation of AI packages (inference, agents, openai, langchain)
50-
project.telemetry.enable()
51-
52-
# Log traces to the project's application insights resource
53-
application_insights_connection_string = project.telemetry.get_connection_string()
54-
if application_insights_connection_string:
55-
configure_azure_monitor(connection_string=application_insights_connection_string)
56-
```
57-
In additional, you might find helpful to see the tracing logs in console. You can achieve by the following code:
58-
59-
```Python
60-
project_client.telemetry.enable(destination=sys.stdout)
61-
```
6249

6350
# [JavaScript](#tab/javascript)
6451

@@ -82,7 +69,10 @@ Install the package `opentelemetry-instrumentation-openai-v2 2.0b0` using your p
8269
pip install opentelemetry-instrumentation-openai-v2
8370
```
8471

85-
Once necessary packages are installed, you can easily enable tracing via [Tracing using Azure AI Foundry Project](#tracing-using-azure-ai-foundry-project)
72+
Refer the following samples to get started with tracing using Azure AI Project SDK:
73+
- [Python Sample with console tracing](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/inference/sample_chat_completions_with_azure_openai_client_and_console_tracing.py) containing fully runnable Python code for tracing using synchronous and asynchronous clients.
74+
- [Python Sample with Azure Monitor](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/inference/sample_chat_completions_with_azure_openai_client_and_azure_monitor_tracing.py) containing fully runnable Python code for tracing using synchronous and asynchronous clients.
75+
8676

8777
### [JavaScript](#tab/javascript)
8878
Currently this is supported in Python only.

0 commit comments

Comments
 (0)