mirror of https://github.com/grafana/grafana
AzureMonitor: Refresh documentation (#35371)
* AzureMonitor: Refresh documentation * logs/kusto * finish up logs * variables for log analytics * Apply suggestions from code review Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * finish up main topics * finish docs? * typos and other review comments * add link to sample arg queries * split up azure docs * workaround weird code duplication issue * Update docs/sources/datasources/azuremonitor/template-variables.md Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * feedback Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>pull/36402/head
parent
09a96ad2ad
commit
ca5379d64d
@ -0,0 +1,28 @@ |
|||||||
|
+++ |
||||||
|
title = "Application Insights deprecation" |
||||||
|
description = "Template to provision the Azure Monitor data source" |
||||||
|
keywords = ["grafana", "microsoft", "azure", "monitor", "application", "insights", "log", "analytics", "guide"] |
||||||
|
weight = 999 |
||||||
|
+++ |
||||||
|
|
||||||
|
# Deprecated Application Insights and Insights Analytics |
||||||
|
|
||||||
|
Application Insights and Insights Analytics are two ways to query the same Azure Application Insights data, which can also be queried from Metrics and Logs. In Grafana 8.0, Application Insights and Insights Analytics are deprecated and made read-only in favor of querying this data through Metrics and Logs. Existing queries will continue to work, but you cannot edit them. New panels are not able to use Application Insights or Insights Analytics. |
||||||
|
|
||||||
|
Azure Monitor Metrics and Azure Monitor Logs do not use Application Insights API keys, so make sure the data source is configured with an Azure AD app registration that has access to Application Insights. |
||||||
|
|
||||||
|
## Application Insights |
||||||
|
|
||||||
|
New Application Insights queries can be made with the Metrics service and selecting the "Application Insights" resource type. Application Insights has metrics available between two different metric |
||||||
|
|
||||||
|
{{< figure src="/static/img/docs/azure-monitor/app-insights-metrics.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor Application Insights example" >}} |
||||||
|
|
||||||
|
## Insights Analytics |
||||||
|
|
||||||
|
New Insights Analaytics queries can be written with Kusto in the Logs query type by selecting your Application Insights resource. |
||||||
|
|
||||||
|
{{< figure src="/static/img/docs/azure-monitor/app-insights-logs.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Logs Application Insights example" >}} |
||||||
|
|
||||||
|
The new resource picker for Logs shows all resources on your Azure subscription compatible with Logs. |
||||||
|
|
||||||
|
{{< figure src="/static/img/docs/azure-monitor/app-insights-resource-picker.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Logs Application Insights resource picker" >}} |
@ -0,0 +1,56 @@ |
|||||||
|
+++ |
||||||
|
title = "Provisioning Azure Monitor" |
||||||
|
description = "Template to provision the Azure Monitor data source" |
||||||
|
keywords = ["grafana", "microsoft", "azure", "monitor", "application", "insights", "log", "analytics", "guide"] |
||||||
|
weight = 2 |
||||||
|
+++ |
||||||
|
|
||||||
|
# Configure the data source with provisioning |
||||||
|
|
||||||
|
You can configure data sources using config files with Grafana’s provisioning system. For more information on how it works and all the settings you can set for data sources on the [Provisioning documentation page]({{< relref "../../administration/provisioning/#datasources" >}}) |
||||||
|
|
||||||
|
Here are some provisioning examples for this data source. |
||||||
|
|
||||||
|
## Azure AD App Registration (client secret) |
||||||
|
|
||||||
|
```yaml |
||||||
|
apiVersion: 1 # config file version |
||||||
|
|
||||||
|
datasources: |
||||||
|
- name: Azure Monitor |
||||||
|
type: grafana-azure-monitor-datasource |
||||||
|
access: proxy |
||||||
|
jsonData: |
||||||
|
azureAuthType: clientsecret |
||||||
|
cloudName: azuremonitor # See table below |
||||||
|
tenantId: <tenant-id> |
||||||
|
clientId: <client-id> |
||||||
|
subscriptionId: <subscription-id> # Optional, default subscription |
||||||
|
secureJsonData: |
||||||
|
clientSecret: <client-secret> |
||||||
|
version: 1 |
||||||
|
``` |
||||||
|
|
||||||
|
## Managed Identity |
||||||
|
|
||||||
|
```yaml |
||||||
|
apiVersion: 1 # config file version |
||||||
|
|
||||||
|
datasources: |
||||||
|
- name: Azure Monitor |
||||||
|
type: grafana-azure-monitor-datasource |
||||||
|
access: proxy |
||||||
|
jsonData: |
||||||
|
azureAuthType: msi |
||||||
|
subscriptionId: <subscription-id> # Optional, default subscription |
||||||
|
version: 1 |
||||||
|
``` |
||||||
|
|
||||||
|
## Supported cloud names |
||||||
|
|
||||||
|
| Azure Cloud | Value | |
||||||
|
| ------------------------------------------------ | -------------------------- | |
||||||
|
| Microsoft Azure public cloud | `azuremonitor` (_default_) | |
||||||
|
| Microsoft Chinese national cloud | `chinaazuremonitor` | |
||||||
|
| US Government cloud | `govazuremonitor` | |
||||||
|
| Microsoft German national cloud ("Black Forest") | `germanyazuremonitor` | |
@ -0,0 +1,53 @@ |
|||||||
|
+++ |
||||||
|
title = "Azure Monitor template variables" |
||||||
|
description = "Using template variables with Azure Monitor in Grafana" |
||||||
|
keywords = ["grafana", "microsoft", "azure", "monitor", "application", "insights", "log", "analytics", "guide"] |
||||||
|
weight = 2 |
||||||
|
+++ |
||||||
|
|
||||||
|
# Template variables |
||||||
|
|
||||||
|
Instead of hard-coding values for fields like resource group or resource name in your queries, you can use variables in their place to create more interactive, dynamic, and reusable dashboards. |
||||||
|
|
||||||
|
Check out the [Templating]({{< relref "../variables/_index.md" >}}) documentation for an introduction to the templating feature and the different |
||||||
|
types of template variables. |
||||||
|
|
||||||
|
The Azure Monitor data source provides the following queries you can specify in the Query field in the Variable edit view |
||||||
|
|
||||||
|
| Name | Description | |
||||||
|
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | |
||||||
|
| `Subscriptions()` | Returns subscriptions. | |
||||||
|
| `ResourceGroups()` | Returns resource groups. | |
||||||
|
| `ResourceGroups(subscriptionID)` | Returns resource groups for a specified subscription. | |
||||||
|
| `Namespaces(aResourceGroup)` | Returns namespaces for the default subscription and specified resource group. | |
||||||
|
| `Namespaces(subscriptionID, aResourceGroup)` | Returns namespaces for the specified subscription and resource group. | |
||||||
|
| `ResourceNames(aResourceGroup, aNamespace)` | Returns a list of resource names. | |
||||||
|
| `ResourceNames(subscriptionID, aResourceGroup, aNamespace)` | Returns a list of resource names for a specified subscription. | |
||||||
|
| `MetricNamespace(aResourceGroup, aNamespace, aResourceName)` | Returns a list of metric namespaces. | |
||||||
|
| `MetricNamespace(subscriptionID, aResourceGroup, aNamespace, aResourceName)` | Returns a list of metric namespaces for a specified subscription. | |
||||||
|
| `MetricNames(aResourceGroup, aMetricDefinition, aResourceName, aMetricNamespace)` | Returns a list of metric names. | |
||||||
|
| `MetricNames(aSubscriptionID, aMetricDefinition, aResourceName, aMetricNamespace)` | Returns a list of metric names for a specified subscription. | |
||||||
|
| `workspaces()` | Returns a list of workspaces for the default subscription. | |
||||||
|
| `workspaces(subscriptionID)` | Returns a list of workspaces for the specified subscription (the parameter can be quoted or unquoted). | |
||||||
|
|
||||||
|
Where a subscription ID is not specified, a default subscription must be specified in the data source configuration, which will be used. |
||||||
|
|
||||||
|
Any Log Analytics KQL query that returns a single list of values can also be used in the Query field. For example: |
||||||
|
|
||||||
|
| Query | Description | |
||||||
|
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------- | |
||||||
|
| `workspace("myWorkspace").Heartbeat \| distinct Computer` | Returns a list of Virtual Machines | |
||||||
|
| `workspace("$workspace").Heartbeat \| distinct Computer` | Returns a list of Virtual Machines with template variable | |
||||||
|
| `workspace("$workspace").Perf \| distinct ObjectName` | Returns a list of objects from the Perf table | |
||||||
|
| `workspace("$workspace").Perf \| where ObjectName == "$object"` `\| distinct CounterName` | Returns a list of metric names from the Perf table | |
||||||
|
|
||||||
|
Example of a time series query using variables: |
||||||
|
|
||||||
|
```kusto |
||||||
|
Perf |
||||||
|
| where ObjectName == "$object" and CounterName == "$metric" |
||||||
|
| where TimeGenerated >= $__timeFrom() and TimeGenerated <= $__timeTo() |
||||||
|
| where $__contains(Computer, $computer) |
||||||
|
| summarize avg(CounterValue) by bin(TimeGenerated, $__interval), Computer |
||||||
|
| order by TimeGenerated asc |
||||||
|
``` |
Loading…
Reference in new issue