Skip to content

Commit 284eded

Browse files
Updated examples
1 parent 8bc5fed commit 284eded

File tree

1 file changed

+11
-30
lines changed

1 file changed

+11
-30
lines changed

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

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: lagayhar
1414
author: lgayhardt
1515
---
1616

17-
# How to trace your application with Azure AI Foundry Project
17+
# How to trace your application with Azure AI Foundry Project Library
1818

1919
[!INCLUDE [feature-preview](../../includes/feature-preview.md)]
2020

@@ -28,7 +28,7 @@ In this article you'll learn how to trace your application with Azure AI Foundry
2828
- If using Python, you need Python 3.8 or later installed, including pip.
2929
- If using JavaScript, the supported environments are LTS versions of Node.js.
3030

31-
## Tracing using Azure AI Foundry Project
31+
## Tracing using Azure AI Foundry Project Library
3232
# [Python](#tab/python)
3333
The best way to get started using the Azure AI Foundry SDK is by using a project. AI projects connect together different data, assets, and services you need to build AI applications. The AI project client allows you to easily access these project components from your code by using a single connection string. First follow steps to [create an AI Project](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/create-projects?tabs=ai-studio) if you don't have one already.
3434
To enable tracing, first ensure your project has an attached Application Insights resource. Go to the **Tracing** page of your project in Azure AI Foundry portal and follow instructions to create or attach Application Insights. If one was enabled, you can get the Application Insights connection string, and observe the full execution path through Azure Monitor.
@@ -42,10 +42,10 @@ pip install azure-monitor-opentelemetry
4242
```
4343

4444
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.
47-
48-
45+
- [Python Sample with console tracing for Azure AI Inference Client](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/inference/sample_chat_completions_with_azure_ai_inference_client_and_console_tracing.py) containing fully runnable Python code for tracing using synchronous and asynchronous clients.
46+
- [Python Sample with Azure Monitor for Azure AI Inference Client](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.
47+
- [Python Sample with console tracing for Azure Open AI](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.
48+
- [Python Sample with Azure Monitor for Azure Open AI](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.
4949

5050
# [JavaScript](#tab/javascript)
5151

@@ -57,21 +57,8 @@ Tracing is not yet integrated into the Azure AI Projects SDK for C#. For instruc
5757

5858
----
5959

60-
## Enable Tracing for Azure Open AI
61-
The Azure OpenAI Service provides access to OpenAI's models including the GPT-4o, GPT-4o mini, GPT-4, GPT-4 Turbo with Vision, DALLE-3, Whisper, and Embeddings model series with the data residency, scalability, safety, security and enterprise capabilities of Azure. Refer this to learn more on how to get started with [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/develop/sdk-overview?tabs=sync&pivots=programming-language-python#azure-openai-service)
62-
63-
### [Python](#tab/python)
64-
Tracing in Azure Open AI follows Opentelemetry standards as per [opentelemetry-instrumentation-openai-v2 2.0b0](https://pypi.org/project/opentelemetry-instrumentation-openai-v2/) To enable tracing for Azure Open AI, follow following steps:
65-
66-
Install the package `opentelemetry-instrumentation-openai-v2 2.0b0` using your package manager, like pip:
67-
68-
```bash
69-
pip install opentelemetry-instrumentation-openai-v2
70-
```
71-
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.
60+
\
61+
Refer the following samples to get started with tracing using Azure AI Project Library for Azure OpenAI:
7562

7663

7764
### [JavaScript](#tab/javascript)
@@ -82,7 +69,7 @@ Currently this is supported in Python only.
8269

8370
----
8471

85-
## Enable Tracing using Azure AI Inference SDK
72+
## Enable Tracing using Azure AI Inference Library
8673

8774
### Installation
8875

@@ -135,14 +122,6 @@ To learn more , see the [Inference SDK reference](../../reference/reference-mode
135122
You need to add following configuration settings as per your use case:
136123

137124
- To capture prompt and completion contents, set the `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED` environment variable to true (case insensitive). By default, prompts, completions, function names, parameters, or outputs aren't recorded.
138-
- To enable Azure SDK tracing, set the `AZURE_SDK_TRACING_IMPLEMENTATION` environment variable to opentelemetry. Alternatively, you can configure it in the code with the following snippet:
139-
140-
```python
141-
from azure.core.settings import settings
142-
143-
settings.tracing_implementation = "opentelemetry"
144-
```
145-
146125
To learn more, see [Azure Core Tracing OpenTelemetry client library for Python](/python/api/overview/azure/core-tracing-opentelemetry-readme).
147126

148127
# [JavaScript](#tab/javascript)
@@ -324,5 +303,7 @@ The user feedback event body has the following structure:
324303
## Related content
325304

326305
- [Python samples](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.
306+
- [Sample Agents with Console tracing](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/agents/sample_agents_functions_with_console_tracing.py)
307+
- [Sample Agents with Azure Monitor](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/agents/sample_agents_basics_with_azure_monitor_tracing.py)
327308
- [JavaScript samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-inference-rest/samples/v1-beta/typescript/src) containing fully runnable JavaScript code for tracing using synchronous and asynchronous clients.
328309
- [C# Samples](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.Inference_1.0.0-beta.2/sdk/ai/Azure.AI.Inference/samples/Sample8_ChatCompletionsWithOpenTelemetry.md) containing fully runnable C# code for doing inference using synchronous and asynchronous methods.

0 commit comments

Comments
 (0)