Skip to content

Commit 1bb621e

Browse files
committed
edits.
1 parent 5e3519a commit 1bb621e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

articles/ai-foundry/how-to/develop/trace-agents-sdk.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this article, you learn how to:
2222
- Trace and observe AI agents in Azure AI Foundry
2323
- Interpret spans (steps, tool calls, nested operations).
2424
- View agent threads in the Agents playground.
25-
- View traces in Azure AI Foundry portal and Azure Monitor
25+
- View traces in the Azure AI Foundry portal and Azure Monitor
2626

2727
Determining the reasoning behind your agent's executions is important for troubleshooting and debugging. However, it can be difficult for complex agents for many reasons:
2828

@@ -41,7 +41,7 @@ Here's a brief overview of key concepts before getting started:
4141
|---------------------|-----------------------------------------------------------------|
4242
| Traces | Traces capture the journey of a request or workflow through your application by recording events and state changes (function calls, values, system events). See [OpenTelemetry Traces](https://opentelemetry.io/docs/concepts/signals/traces/). |
4343
| Spans | Spans are the building blocks of traces, representing single operations within a trace. Each span captures start and end times, attributes, and can be nested to show hierarchical relationships, allowing you to see the full call stack and sequence of operations. |
44-
| Attributes | Attributes are key-value pairs attached to traces and spans, providing contextual metadata such as function parameters, return values, or custom annotations. These enrich trace data making it more informative and useful for analysis. |
44+
| Attributes | Attributes are key-value pairs attached to traces and spans, providing contextual metadata such as function parameters, return values, or custom annotations. These enrich trace data, making it more informative and useful for analysis. |
4545
| Semantic conventions| OpenTelemetry defines semantic conventions to standardize names and formats for trace data attributes, making it easier to interpret and analyze across tools and platforms. To learn more, see [OpenTelemetry's Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/). |
4646
| Trace exporters | Trace exporters send trace data to backend systems for storage and analysis. Azure AI supports exporting traces to Azure Monitor and other OpenTelemetry-compatible platforms, enabling integration with various observability tools. |
4747

@@ -53,7 +53,7 @@ Here's a brief overview of key concepts before getting started:
5353

5454
## Extending OpenTelemetry with multi-agent observability
5555

56-
Microsoft is enhancing multi-agent observability by introducing new semantic conventions to [OpenTelemetry](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/), developed, collaboratively with Outshift, Cisco's incubation engine.These additions—built upon OpenTelemetry and W3C Trace Context—establish standardized practices for tracing and telemetry within multi-agent systems, facilitating consistent logging of key metrics for quality, performance, safety, and cost. This systematic approach enables more comprehensive visibility into multi-agent workflows, including tool invocations and collaboration.
56+
Microsoft is enhancing multi-agent observability by introducing new semantic conventions to [OpenTelemetry](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/), developed collaboratively with Outshift, Cisco's incubation engine. These additions—built upon OpenTelemetry and W3C Trace Context—establish standardized practices for tracing and telemetry within multi-agent systems, facilitating consistent logging of key metrics for quality, performance, safety, and cost. This systematic approach enables more comprehensive visibility into multi-agent workflows, including tool invocations and collaboration.
5757
These advancements have been integrated into Azure AI Foundry, Microsoft Agent Framework, Semantic Kernel, and Azure AI packages for LangChain, LangGraph, and the OpenAI Agents SDK, enabling customers to get unified observability for agentic systems built using any of these frameworks with Azure AI Foundry. The additional semantic conventions and integration across different frameworks equip developers to monitor, troubleshoot, and optimize their AI agents in a unified solution with increased efficiency and valuable insights.
5858

5959
| New Span/Trace/Attributes | Name | Purpose |
@@ -69,12 +69,12 @@ These advancements have been integrated into Azure AI Foundry, Microsoft Agent F
6969
|New attributes in "execute_tool" span|tool.call.results|Records the results returned by the tool|
7070
|New event|Evaluation - attributes (name, error.type, label)|Enables structured evaluation of agent performance and decision-making|
7171
72-
More details can be found in the following pull-requests merged into OpenTelemetry
72+
More details can be found in the following pull requests merged into OpenTelemetry:
7373
* Add tool definition plus tool-related attributes in invoke-agent, inference, and execute-tool spans
7474
* Capture evaluation results for GenAI applications
7575

7676

77-
## Setup tracing in Azure AI Foundry SDK
77+
## Set up tracing in Azure AI Foundry SDK
7878

7979
For chat completions or building agents with Azure AI Foundry, install:
8080

@@ -96,7 +96,7 @@ To view traces in Azure AI Foundry, you need to connect an Application Insights
9696

9797
## Instrument tracing in your code
9898

99-
To trace the content of chat messages, set the `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED` environment variable to true (case insensitive). Keep in mind this might contain personal data. To learn more, see [Azure Core Tracing OpenTelemetry client library for Python](/python/api/overview/azure/core-tracing-opentelemetry-readme).
99+
To trace the content of chat messages, set the `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED` environment variable to true (case insensitive). Keep in mind that this might contain personal data. To learn more, see [Azure Core Tracing OpenTelemetry client library for Python](/python/api/overview/azure/core-tracing-opentelemetry-readme).
100100

101101
```python
102102
import os
@@ -141,11 +141,11 @@ with tracer.start_as_current_span("example-tracing"):
141141
run = project_client.agents.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
142142
```
143143

144-
After running your agent, you can go begin to [view traces in Azure AI Foundry Portal](#view-traces-in-azure-ai-foundry-portal).
144+
After running your agent, you can begin to [view traces in Azure AI Foundry Portal](#view-traces-in-azure-ai-foundry-portal).
145145

146146
### Log traces locally
147147

148-
To connect to [Aspire Dashboard](https://aspiredashboard.com/#start) or another OpenTelemetry compatible backend, install the OpenTelemetry Protocol (OTLP) exporter. This enables you to print traces to the console or use a local viewer such as Aspire Dashboard.
148+
To connect to [Aspire Dashboard](https://aspiredashboard.com/#start) or another OpenTelemetry-compatible backend, install the OpenTelemetry Protocol (OTLP) exporter. This enables you to print traces to the console or use a local viewer such as Aspire Dashboard.
149149

150150
```bash
151151
pip install azure-core-tracing-opentelemetry opentelemetry-exporter-otlp opentelemetry-sdk
@@ -233,7 +233,7 @@ For detailed instructions and advanced usage, refer to the [OpenTelemetry docume
233233

234234
To attach user feedback to traces and visualize it in the Azure AI Foundry portal, you can instrument your application to enable tracing and log user feedback using OpenTelemetry's semantic conventions.
235235

236-
By correlating feedback traces with their respective chat request traces using the response ID or thread ID, you can view and manage these traces in Azure AI Foundry portal. OpenTelemetry's specification allows for standardized and enriched trace data, which can be analyzed in Azure AI Foundry portal for performance optimization and user experience insights. This approach helps you use the full power of OpenTelemetry for enhanced observability in your applications.
236+
By correlating feedback traces with their respective chat request traces using the response ID or thread ID, you can view and manage these traces in the Azure AI Foundry portal. OpenTelemetry's specification allows for standardized and enriched trace data, which can be analyzed in the Azure AI Foundry portal for performance optimization and user experience insights. This approach helps you use the full power of OpenTelemetry for enhanced observability in your applications.
237237

238238
To log user feedback, follow this format:
239239

@@ -261,10 +261,10 @@ To query trace data for a given service name, query for the `cloud_roleName` pro
261261
```
262262

263263
## Integrations
264-
Foundry makes it easy to log traces with minimal changes by using our tracing integrations with Microsoft Agent Framework,Semantic Kernel, LangChain, LangGraph and OpenAI Agent SDK.
264+
Azure AI Foundry makes it easy to log traces with minimal changes by using our tracing integrations with Microsoft Agent Framework, Semantic Kernel, LangChain, LangGraph and OpenAI Agent SDK.
265265

266266
### Agents built on Microsoft Agent Framework and Semantic Kernel
267-
Foundry has native integrations with Microsoft Agent Framework and Semantic Kernel. Agents built on these two frameworks get out-of-box tracing and evaluations support in Foundry Observability.
267+
Azure AI Foundry has native integrations with Microsoft Agent Framework and Semantic Kernel. Agents built on these two frameworks get out-of-the-box tracing and evaluations support in Foundry Observability.
268268

269269
### Enable tracing for Agents built on LangChain & LangGraph
270270

@@ -358,7 +358,7 @@ You have access to two tools:
358358
- get_user_location: use this to get the user's location
359359
360360
If a user asks you for the weather, make sure you know the location.
361-
If you can tell from the question that they mean whereever they are,
361+
If you can tell from the question that they mean wherever they are,
362362
use the get_user_location tool to find their location."""
363363

364364
# Mock user locations keyed by user id (string)
@@ -712,17 +712,17 @@ After selecting **Thread logs**, review:
712712
> [!NOTE]
713713
> Observability features such as Risk and Safety Evaluation are billed based on consumption as listed in the [Azure pricing page](https://azure.microsoft.com/pricing/details/ai-foundry/).
714714
715-
## View traces in Azure AI Foundry portal
715+
## View traces in the Azure AI Foundry portal
716716

717-
In your project, go to `Tracing` to filter your traces as you see fit.
717+
In your project, go to **Tracing** to filter your traces as you see fit.
718718

719719
By selecting a trace, you can step through each span and identify issues while observing how your application is responding. This can help you debug and pinpoint issues in your application.
720720

721721
## View traces in Azure Monitor
722722

723-
If you logged traces using the previous code snippet, then you're all set to view your traces in Azure Monitor Application Insights. You can open in Application Insights from **Manage data source** and use the **End-to-end transaction details view** to further investigate.
723+
If you logged traces using the previous code snippet, then you're all set to view your traces in Azure Monitor Application Insights. You can open Application Insights from **Manage data source** and use the **End-to-end transaction details view** to further investigate.
724724

725-
For more information on how to send Azure AI Inference traces to Azure Monitor and create Azure Monitor resource, see [Azure Monitor OpenTelemetry documentation](/azure/azure-monitor/app/opentelemetry-enable).
725+
For more information on how to send Azure AI Inference traces to Azure Monitor and create an Azure Monitor resource, see [Azure Monitor OpenTelemetry documentation](/azure/azure-monitor/app/opentelemetry-enable).
726726

727727
## Related content
728728

0 commit comments

Comments
 (0)