From dbe2d7ac47fbf8add76fbfea14cf9dd0ac6e90b4 Mon Sep 17 00:00:00 2001 From: Andreas Christou Date: Thu, 12 Dec 2024 16:38:26 +0000 Subject: [PATCH] Azure: Add documentation for Basic Logs (#97193) * Add documentation for Basic Logs * Lint * Update docs/sources/datasources/azure-monitor/query-editor/index.md Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com> --------- Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com> --- .../sources/datasources/azure-monitor/_index.md | 1 + .../azure-monitor/query-editor/index.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/sources/datasources/azure-monitor/_index.md b/docs/sources/datasources/azure-monitor/_index.md index 9b30cd66e21..7474ba3165d 100644 --- a/docs/sources/datasources/azure-monitor/_index.md +++ b/docs/sources/datasources/azure-monitor/_index.md @@ -116,6 +116,7 @@ For details, refer to [Configuring using Workload Identity](#configuring-using-w | **Application (client) ID** | Sets the application/client ID for the Azure AD app registration to use for authentication. | | **Client secret** | Sets the application client secret for the Azure AD app registration to use for authentication. For details, see the [Azure application secret docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret). | | **Default subscription** | _(Optional)_ Sets a default subscription for template variables to use. | +| **Enable Basic Logs** | Allows this data source to execute queries against [Basic Logs tables](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1) in supported Log Analytics Workspaces. These queries may incur additional costs. | ### Provision the data source diff --git a/docs/sources/datasources/azure-monitor/query-editor/index.md b/docs/sources/datasources/azure-monitor/query-editor/index.md index ccfc12a81bb..28256b66000 100644 --- a/docs/sources/datasources/azure-monitor/query-editor/index.md +++ b/docs/sources/datasources/azure-monitor/query-editor/index.md @@ -126,6 +126,8 @@ Azure Monitor Logs collects and organises log and performance data from [support While Azure Monitor Metrics stores only simplified numerical data, Logs can store different data types, each with their own structure. You can also perform complex analysis of Logs data by using KQL. +The Azure Monitor data source also supports querying of [Basic Logs](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1) tables (if they exist in your Log Analytics workspace). This feature must be enabled in the data source configuration. + {{< figure src="/static/img/docs/azure-monitor/query-editor-logs.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor Logs sample query comparing successful requests to failed requests" >}} ### Create a Logs query @@ -146,6 +148,21 @@ You can also perform complex analysis of Logs data by using KQL. You can also augment queries by using [template variables]({{< relref "./template-variables" >}}). +**To create a Basic Logs query:** + +1. Ensure that the data source has the `Enable Basic Logs` toggle enabled. +1. In a Grafana panel, select the **Azure Monitor** data source. +1. Select the **Logs** service. +1. Select a resource to query. Multiple resources can be selected as long as they are of the same type. +1. Switch the `Logs` toggle from `Analytics` to `Basic`. A modal will display to notify users of potential additional costs. + {{% admonition type="note" %}} + Basic Logs queries do not support time-ranges specified in the query. The time-range will be hardcoded to the dashboard time-range. There are also other query limitations. See the + [documentation for details.](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1#limitations) + {{% /admonition %}} +1. Enter your KQL query. + +You can also augment queries by using [template variables](https://grafana.com/docs/grafana//datasources/azure-monitor/template-variables/). + ### Logs query examples Azure Monitor Logs queries are written using the Kusto Query Language (KQL), a rich language similar to SQL.