Skip to content

Commit b6e970f

Browse files
committed
fixes
1 parent 61e2575 commit b6e970f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

articles/ai-foundry/how-to/develop/trace-application.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: How to trace AI applications using OpenAI SDK
33
titleSuffix: Azure AI Foundry
4-
description: Learn how to trace applications that uses OpenAI SDK in Azure AI Foundry
4+
description: Learn how to trace applications that use OpenAI SDK in Azure AI Foundry
55
author: lgayhardt
66
ms.author: lagayhar
77
manager: scottpolly
@@ -13,13 +13,13 @@ ms.topic: how-to
1313

1414
# Trace AI applications using OpenAI SDK
1515

16-
Tracing provides deep visibility into execution of your application by capturing detailed telemetry at each execution step. This helps diagnose issues and enhance performance by identifying problems such as inaccurate tool calls, misleading prompts, high latency, low-quality evaluation scores, and more.
16+
Tracing provides deep visibility into execution of your application by capturing detailed telemetry at each execution step. Such helps diagnose issues and enhance performance by identifying problems such as inaccurate tool calls, misleading prompts, high latency, low-quality evaluation scores, and more.
1717

1818
This article explains how to implement tracing for AI applications using OpenAI SDK with OpenTelemetry in Azure AI Foundry.
1919

2020
## Prerequisites
2121

22-
To complete this tutorial you need:
22+
Ensure you have the following:
2323

2424
* An Azure AI Foundry project created.
2525

@@ -40,7 +40,7 @@ The following steps show how to configure:
4040

4141
:::image type="content" source="../../media/how-to/develop/trace-application/configure-app-insight.png" alt-text="A screenshot showing how to configure Azure Application Insights to the Azure AI Foundry resource." lightbox="../../media/how-to/develop/trace-application/configure-app-insight.png":::
4242

43-
4. To reuse an existing Azure Application Insights, use the drop down **Application Insights resource name** to locate the resource and select **Connect**.
43+
4. To reuse an existing Azure Application Insights, use the drop-down **Application Insights resource name** to locate the resource and select **Connect**.
4444

4545
> [!TIP]
4646
> To connect to an existing Azure Application Insights, you need at least contributor access to the Azure AI Foundry resource (or Hub).
@@ -68,7 +68,7 @@ The following steps show how to configure:
6868

6969
## Instrument the OpenAI SDK
7070

71-
If you are using the OpenAI SDK to develop intelligent applications you can instrument it so traces are sent to Azure AI Foundry. Follow this steps:
71+
If you are using the OpenAI SDK to develop intelligent applications you can instrument it so traces are sent to Azure AI Foundry. Follow these steps:
7272

7373
1. Install `azure-ai-projects`, `azure-monitor-opentelemetry`, and `opentelemetry-instrumentation-openai-v2` in your environment. The following example uses `pip`:
7474

@@ -111,7 +111,7 @@ If you are using the OpenAI SDK to develop intelligent applications you can inst
111111
configure_azure_monitor(connection_string=connection_string)
112112
```
113113

114-
1. By default, OpenTelemetry doesn't capture the inputs and outputs. To enable that, use the environment variable `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`. Ensure this environment variable is configure in the environment level where you code is running.
114+
1. By default, OpenTelemetry doesn't capture the inputs and outputs. To enable that, use the environment variable `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true`. Ensure this environment variable is configured in the environment level where your code is running.
115115

116116
1. Use the OpenAI SDK in the same way you are used to:
117117

@@ -130,15 +130,15 @@ If you are using the OpenAI SDK to develop intelligent applications you can inst
130130

131131
:::image type="content" source="../../media/how-to/develop/trace-application/tracing-display-simple.png" alt-text="A screenshot showing how a simple chat completion request is displayed in the trace." lightbox="../../media/how-to/develop/trace-application/tracing-display-simple.png":::
132132

133-
1. When developing complex applications, it may be useful to capture sections of your code that mixes business logic with models. You can do that by first getting an instance of the current tracer.
133+
1. It may be useful to capture sections of your code that mixes business logic with models when developing complex applications. You can do that by first getting an instance of the current tracer.
134134

135135
```python
136136
from opentelemetry import trace
137137

138138
tracer = trace.get_tracer(__name__)
139139
```
140140

141-
1. Then, use decorators in your method to capture specific scenarios in your code that you are interested in. The following example assess if a list of claims with a list of contexts.
141+
1. Then, use decorators in your method to capture specific scenarios in your code that you are interested in. The following example assesses if a list of claims with a list of contexts.
142142

143143
```python
144144
def build_prompt_with_context(claim: str, context: str) -> str:
@@ -167,7 +167,7 @@ If you are using the OpenAI SDK to develop intelligent applications you can inst
167167
return responses
168168
```
169169

170-
1. Then, traces will look as follow:
170+
1. Then, traces will look as follows:
171171

172172
:::image type="content" source="../../media/how-to/develop/trace-application/tracing-display-decorator.png" alt-text="A screenshot showing how a method using a decorator is displayed in the trace." lightbox="../../media/how-to/develop/trace-application/tracing-display-decorator.png":::
173173

0 commit comments

Comments
 (0)