|
| 1 | +--- |
| 2 | +title: Monitor Azure AI Agent Service |
| 3 | +description: Start here to learn how to use Azure Monitor tools like Log Analytics to capture and analyze metrics and data logs for your Azure AI Agent Service. |
| 4 | +ms.date: 03/20/2025 |
| 5 | +ms.custom: horz-monitor, subject-monitoring |
| 6 | +ms.topic: conceptual |
| 7 | +author: aahill |
| 8 | +ms.author: aahi |
| 9 | +ms.service: azure-ai-agents |
| 10 | +--- |
| 11 | + |
| 12 | +# Monitor Azure AI Agent Service |
| 13 | + |
| 14 | +[!INCLUDE [horz-monitor-intro](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-intro.md)] |
| 15 | + |
| 16 | +## Dashboards |
| 17 | + |
| 18 | +Azure AI Agent Service provides out-of-box dashboards for each of your agents. There are two key dashboards to monitor your resource: |
| 19 | + |
| 20 | +- The metrics dashboard in the AI Foundry resource view |
| 21 | +- The dashboard in the overview pane within the Azure portal |
| 22 | + |
| 23 | +To access the monitoring dashboards, sign in to the [Azure portal](https://portal.azure.com) and then select **Monitoring** in the left navigation menu, then click **Metrics**. |
| 24 | + |
| 25 | + |
| 26 | +:::image type="content" source="../media/monitoring/dashboard.png" alt-text="Screenshot that shows out-of-box dashboards for a resource in the Azure portal." lightbox="../media/monitoring/dashboard.png" border="false"::: |
| 27 | + |
| 28 | + |
| 29 | +## Data collection and routing in Azure Monitor |
| 30 | + |
| 31 | +Azure AI Agent Service collects the same kinds of monitoring data as other Azure resources. You can configure Azure Monitor to generate data in activity logs, resource logs, virtual machine logs, and platform metrics. For more information, see [Monitoring data from Azure resources](/azure/azure-monitor/essentials/monitor-azure-resource#monitoring-data-from-azure-resources). |
| 32 | + |
| 33 | +Platform metrics and the Azure Monitor activity log are collected and stored automatically. This data can be routed to other locations by using a diagnostic setting. Azure Monitor resource logs aren't collected and stored until you create a diagnostic setting and then route the logs to one or more locations. |
| 34 | + |
| 35 | +When you create a diagnostic setting, you specify which categories of logs to collect. For more information about creating a diagnostic setting by using the Azure portal, the Azure CLI, or PowerShell, see [Create diagnostic setting to collect platform logs and metrics in Azure](/azure/azure-monitor/platform/diagnostic-settings). |
| 36 | + |
| 37 | +Keep in mind that using diagnostic settings and sending data to Azure Monitor Logs has other costs associated with it. For more information, see [Azure Monitor Logs cost calculations and options](/azure/azure-monitor/logs/cost-logs). |
| 38 | + |
| 39 | +The metrics and logs that you can collect are described in the following sections. |
| 40 | + |
| 41 | +[!INCLUDE [horz-monitor-resource-types](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-resource-types.md)] |
| 42 | + |
| 43 | +For more information about the resource types, see the [monitoring data reference](../monitor-openai-reference.md). |
| 44 | + |
| 45 | +[!INCLUDE [horz-monitor-data-storage](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-data-storage.md)] |
| 46 | + |
| 47 | +[!INCLUDE [horz-monitor-platform-metrics](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-platform-metrics.md)] |
| 48 | + |
| 49 | +Azure AI Agent Service has commonality with a subset of Azure AI services. For a list of available metrics for Azure AI Agent Service, see the [monitoring data reference](../monitor-openai-reference.md#metrics). |
| 50 | + |
| 51 | +<!-- ## OPTIONAL [TODO-replace-with-service-name] metrics |
| 52 | +If your service uses any non-Azure Monitor based metrics, add the following include and more information. |
| 53 | +[!INCLUDE [horz-monitor-custom-metrics](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-non-monitor-metrics.md)] --> |
| 54 | + |
| 55 | +[!INCLUDE [horz-monitor-resource-logs](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-resource-logs.md)] |
| 56 | + |
| 57 | +For the available resource log categories, their associated Log Analytics tables, and the log schemas for Azure AI Agent Service, see the [monitoring data reference](../monitor-openai-reference.md#resource-logs). |
| 58 | + |
| 59 | +<!-- OPTIONAL. If your service doesn't collect Azure Monitor resource logs, use the following include [!INCLUDE [horz-monitor-no-resource-logs](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-no-resource-logs.md)] --> |
| 60 | + |
| 61 | +[!INCLUDE [horz-monitor-activity-log](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-activity-log.md)] |
| 62 | + |
| 63 | +[!INCLUDE [horz-monitor-analyze-data](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-analyze-data.md)] |
| 64 | + |
| 65 | +### Configure diagnostic settings |
| 66 | + |
| 67 | +All of the metrics are exportable with [diagnostic settings in Azure Monitor](/azure/azure-monitor/essentials/diagnostic-settings). To analyze logs and metrics data with Azure Monitor Log Analytics queries, you need to configure diagnostic settings for your Azure resource and your Log Analytics workspace. |
| 68 | + |
| 69 | +:::image type="content" source="../media/monitoring/diagnostic-settings.png" alt-text="Screenshot that shows how to open the Diagnostic setting page for a resource in the Azure portal." lightbox="../media/monitoring/diagnostic-settings.png"::: |
| 70 | + |
| 71 | +After you configure the diagnostic settings, you can work with metrics and log data for your resource in your Log Analytics workspace. |
| 72 | + |
| 73 | +[!INCLUDE [horz-monitor-external-tools](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-external-tools.md)] |
| 74 | + |
| 75 | +[!INCLUDE [horz-monitor-kusto-queries](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-kusto-queries.md)] |
| 76 | + |
| 77 | +After you deploy an AI model, you can send some completions calls by using the **playground** environment in [Azure AI Foundry](https://ai.azure.com/). |
| 78 | + |
| 79 | +Any text that you enter in the **Agents playground** generates metrics and log data for your resource. In the Log Analytics workspace for your resource, you can query the monitoring data by using the [Kusto](/azure/data-explorer/kusto/query/) query language. |
| 80 | + |
| 81 | +> [!IMPORTANT] |
| 82 | +> The **Open query** option on the resource page browses to Azure Resource Graph, which isn't described in this article. |
| 83 | +> The following queries use the query environment for Log Analytics. Be sure to follow the steps in [Configure diagnostic settings](#configure-diagnostic-settings) to prepare your Log Analytics workspace. |
| 84 | +
|
| 85 | +1. From your resource page, under **Monitoring** on the left pane, select **Logs**. |
| 86 | +1. Select the Log Analytics workspace that you configured with diagnostics for your resource. |
| 87 | +1. From the **Log Analytics workspace** page, under **Overview** on the left pane, select **Logs**. |
| 88 | + |
| 89 | + The Azure portal displays a **Queries** window with sample queries and suggestions by default. You can close this window. |
| 90 | + |
| 91 | +For the following examples, enter the Kusto query into the edit region at the top of the **Query** window, and then select **Run**. The query results display below the query text. |
| 92 | + |
| 93 | +The following Kusto query is useful for an initial analysis of Azure Diagnostics (`AzureDiagnostics`) data about your resource: |
| 94 | + |
| 95 | +```kusto |
| 96 | +AzureDiagnostics |
| 97 | +| take 100 |
| 98 | +| project TimeGenerated, _ResourceId, Category, OperationName, DurationMs, ResultSignature, properties_s |
| 99 | +``` |
| 100 | + |
| 101 | +This query returns a sample of 100 entries and displays a subset of the available columns of data in the logs. In the query results, you can select the arrow next to the table name to view all available columns and associated data types. |
| 102 | + |
| 103 | +:::image type="content" source="../media/monitoring/log-analytics-diagnostics-query.png" alt-text="Screenshot that shows the Log Analytics query results for Azure Diagnostics data about the resource." lightbox="../media/monitoring/log-analytics-diagnostics-query.png"::: |
| 104 | + |
| 105 | +To see all available columns of data, you can remove the scoping parameters line `| project ...` from the query: |
| 106 | + |
| 107 | +```kusto |
| 108 | +AzureDiagnostics |
| 109 | +| take 100 |
| 110 | +``` |
| 111 | + |
| 112 | +To examine the Azure Metrics (`AzureMetrics`) data for your resource, run the following query: |
| 113 | + |
| 114 | +```kusto |
| 115 | +AzureMetrics |
| 116 | +| take 100 |
| 117 | +| project TimeGenerated, MetricName, Total, Count, Maximum, Minimum, Average, TimeGrain, UnitName |
| 118 | +``` |
| 119 | + |
| 120 | +The query returns a sample of 100 entries and displays a subset of the available columns of Azure Metrics data: |
| 121 | + |
| 122 | +:::image type="content" source="../media/monitoring/log-analytics-metrics-query.png" alt-text="Screenshot that shows the Log Analytics query results for Azure Metrics data about the resource." lightbox="../media/monitoring/log-analytics-metrics-query.png"::: |
| 123 | + |
| 124 | +> [!NOTE] |
| 125 | +> When you select **Monitoring** > **Logs** in the menu for your resource, Log Analytics opens with the query scope set to the current resource. The visible log queries include data from that specific resource only. To run a query that includes data from other resources or data from other Azure services, select **Logs** from the **Azure Monitor** menu in the Azure portal. For more information, see [Log query scope and time range in Azure Monitor Log Analytics](/azure/azure-monitor/logs/scope) for details. |
| 126 | +
|
| 127 | +[!INCLUDE [horz-monitor-alerts](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-alerts.md)] |
| 128 | + |
| 129 | +### Set up alerts |
| 130 | + |
| 131 | +Every organization's alerting needs vary and can change over time. Generally, all alerts should be actionable and have a specific intended response if the alert occurs. If an alert doesn't require an immediate response, the condition can be captured in a report rather than an alert. Some use cases might require alerting anytime certain error conditions exist. In other cases, you might need alerts for errors that exceed a certain threshold for a designated time period. |
| 132 | + |
| 133 | +Errors below certain thresholds can often be evaluated through regular analysis of data in Azure Monitor Logs. As you analyze your log data over time, you might discover that a certain condition doesn't occur for an expected period of time. You can track for this condition by using alerts. Sometimes the absence of an event in a log is just as important a signal as an error. |
| 134 | + |
| 135 | +Depending on what type of application you're developing with your use of Azure AI Agent Service, [Azure Monitor Application Insights](/azure/azure-monitor/overview) might offer more monitoring benefits at the application layer. |
| 136 | + |
| 137 | +### Azure AI Agent service alert rules |
| 138 | + |
| 139 | +You can set alerts for any metric, log entry, or activity log entry listed in the [monitoring data reference](../monitor-openai-reference.md). |
| 140 | + |
| 141 | +[!INCLUDE [horz-monitor-advisor-recommendations](~/reusable-content/ce-skilling/azure/includes/azure-monitor/horizontals/horz-monitor-advisor-recommendations.md)] |
| 142 | + |
| 143 | +## Related content |
| 144 | + |
| 145 | +- See [Monitoring data reference](../monitor-openai-reference.md) for a reference of the metrics, logs, and other important values created for Azure AI Agent Service. |
| 146 | +- See [Monitoring Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource) for general details on monitoring Azure resources. |
| 147 | +- See [Understand log searches in Azure Monitor logs](/azure/azure-monitor/logs/log-query-overview) about logs. |
0 commit comments