Commit e089365a by Josh Hunt Committed by GitHub

AzureMonitor: rename labels for query type dropdown (#30143)

* AzureMonitor: rename labels for queryType dropdown

* Reorder to match original order

* Docs: rename query types

* Docs: update KQL url

* Docs: update Azure Monitor / Log Analytics names

* Update documentation to include new name

* Docs formatting

* Rename Azure Monitor config editor names

* update test snapshots
parent 3b0356a1
......@@ -14,9 +14,9 @@ As of Grafana 6.0, the Azure Monitor plugin has been moved into Grafana so it no
The Azure Monitor data source supports multiple services in the Azure cloud:
- **[Azure Monitor]({{< relref "#querying-the-azure-monitor-service" >}})** is the platform service that provides a single source for monitoring Azure resources.
- **[Azure Monitor Metrics]({{< relref "#querying-the-azure-monitor-service" >}})** (or Metrics) is the platform service that provides a single source for monitoring Azure resources.
- **[Azure Monitor Logs]({{< relref "#querying-the-azure-log-analytics-service" >}})** (or Logs) gives you access to log data collected by Azure Monitor.
- **[Application Insights]({{< relref "#querying-the-application-insights-service" >}})** is an extensible Application Performance Management (APM) service for web developers on multiple platforms and can be used to monitor your live web application - it will automatically detect performance anomalies.
- **[Azure Log Analytics]({{< relref "#querying-the-azure-log-analytics-service" >}})** (or Azure Logs) gives you access to log data collected by Azure Monitor.
- **[Application Insights Analytics]({{< relref "#query-the-application-insights-analytics-service" >}})** allows you to query [Application Insights data](https://docs.microsoft.com/en-us/azure/azure-monitor/app/analytics) using the same query language used for Azure Log Analytics.
## Add the data source
......@@ -24,7 +24,7 @@ The Azure Monitor data source supports multiple services in the Azure cloud:
The data source can access metrics from four different services. You can configure access to the services that you use. It is also possible to use the same credentials for multiple services if that is how you have set it up in Azure AD.
- [Guide to setting up an Azure Active Directory Application for Azure Monitor.](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal)
- [Guide to setting up an Azure Active Directory Application for Azure Log Analytics.](https://dev.loganalytics.io/documentation/Authorization/AAD-Setup)
- [Guide to setting up an Azure Active Directory Application for Azure Monitor Logs.](https://dev.loganalytics.io/documentation/Authorization/AAD-Setup)
- [Quickstart Guide for Application Insights.](https://dev.applicationinsights.io/quickstart/)
1. Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section. Next, click the "Add data source" button in the upper right. The Azure Monitor data source will be available for selection in the Cloud section in the list of data sources.
......@@ -43,7 +43,7 @@ The data source can access metrics from four different services. You can configu
- The Subscription Id can be changed per query. Save the data source and refresh the page to see the list of subscriptions available for the specified Client Id.
1. If you are also using the Azure Log Analytics service, then you need to specify these two configuration values (or you can reuse the Client Id and Secret from the previous step).
1. If you are also using the Azure Monitor Logs service, then you need to specify these two configuration values (or you can reuse the Client Id and Secret from the previous step).
- Client Id (Azure Active Directory -> App Registrations -> Choose your app -> Application ID)
- Client Secret (Azure Active Directory -> App Registrations -> Choose your app -> Keys -> Create a key -> Use client secret)
......@@ -67,20 +67,22 @@ az ad sp create-for-rbac -n "http://localhost:3000"
## Choose a Service
In the query editor for a panel, after choosing your Azure Monitor data source, the first option is to choose a service. There are three options here:
In the query editor for a panel, after choosing your Azure Monitor data source, the first option is to choose a service. There are four options here:
- `Azure Monitor`
- `Metrics`
- `Application Insights`
- `Azure Log Analytics`
- `Logs`
- `Insights Analytics`
The query editor changes depending on which one you pick. Azure Monitor is the default.
The query editor changes depending on which one you pick. Metrics is the default.
Starting in Grafana 7.1, Insights Analytics replaced the former edit mode from within Application Insights.
## Query the Azure Monitor service
Starting in Grafana 7.4, the Azure Monitor query type was renamed to Metrics and Azure Logs Analytics was renamed to Logs.
The Azure Monitor service provides metrics for all the Azure services that you have running. It helps you understand how your applications on Azure are performing and to proactively find issues affecting your applications.
## Query the Metrics service
The Metrics service provides metrics for all the Azure services that you have running. It helps you understand how your applications on Azure are performing and to proactively find issues affecting your applications.
If your Azure Monitor credentials give you access to multiple subscriptions, then choose the appropriate subscription first.
......@@ -90,13 +92,13 @@ Examples of metrics that you can get from the service are:
- `Microsoft.Network/networkInterfaces - Bytes sent`
- `Microsoft.Storage/storageAccounts - Used Capacity`
{{< docs-imagebox img="/img/docs/v60/azuremonitor-service-query-editor.png" class="docs-image--no-shadow" caption="Azure Monitor Query Editor" >}}
{{< docs-imagebox img="/img/docs/v60/azuremonitor-service-query-editor.png" class="docs-image--no-shadow" caption="Metrics Query Editor" >}}
As of Grafana 7.1, the query editor allows you to query multiple dimensions for metrics that support them. Metrics that support multiple dimensions are those listed in the [Azure Monitor supported Metrics List](https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported) that have one or more values listed in the "Dimension" column for the metric.
### Format legend keys with aliases for Azure Monitor
### Format legend keys with aliases for Metrics
The default legend formatting for the Azure Monitor API is:
The default legend formatting for the Metrics API is:
`metricName{dimensionName=dimensionValue,dimensionTwoName=DimensionTwoValue}`
......@@ -104,12 +106,12 @@ The default legend formatting for the Azure Monitor API is:
These can be quite long, but this formatting can be changed by using aliases. In the **Legend Format** field, you can combine the aliases defined below any way you want.
Azure Monitor examples:
Metrics examples:
- `Blob Type: {{ blobtype }}`
- `{{ resourcegroup }} - {{ resourcename }}`
### Alias patterns for Azure Monitor
### Alias patterns for Metrics
- `{{ resourcegroup }}` = replaced with the value of the Resource Group
- `{{ namespace }}` = replaced with the value of the Namespace (e.g. Microsoft.Compute/virtualMachines)
......@@ -119,13 +121,13 @@ Azure Monitor examples:
- `{{ dimensionvalue }}` = _Legacy as of 7.1+ (for backwards compatibility)_ replaced with first dimension's value (as sorted by the key/label) (e.g. BlockBlob)
- `{{ arbitraryDim }}` = _Available in 7.1+_ replaced with the value of the corresponding dimension. (e.g. `{{ blobtype }}` becomes BlockBlob)
### Create template variables for Azure Monitor
### Create template variables for Metrics
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
Note that the Azure Monitor service does not support multiple values yet. If you want to visualize multiple time series (for example, metrics for server1 and server2) then you have to add multiple queries to able to view them on the same graph or in the same table.
Note that the Metrics service does not support multiple values yet. If you want to visualize multiple time series (for example, metrics for server1 and server2) then you have to add multiple queries to able to view them on the same graph or in the same table.
The Azure Monitor data source Plugin provides the following queries you can specify in the `Query` field in the Variable edit view. They allow you to fill a variable's options list.
The Metrics data source Plugin provides the following queries you can specify in the `Query` field in the Variable edit view. They allow you to fill a variable's options list.
| Name | Description |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
......@@ -155,9 +157,9 @@ types of template variables.
### List of supported Azure Monitor metrics
Not all metrics returned by the Azure Monitor API have values. To make it easier for you when building a query, the Grafana data source has a list of supported Azure Monitor metrics and ignores metrics which will never have values. This list is updated regularly as new services and metrics are added to the Azure cloud. For more information about the list of Azure Monitor metrics, refer to [current supported namespaces](https://github.com/grafana/grafana/blob/master/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/supported_namespaces.ts).
Not all metrics returned by the Azure Monitor Metrics API have values. To make it easier for you when building a query, the Grafana data source has a list of supported metrics and ignores metrics which will never have values. This list is updated regularly as new services and metrics are added to the Azure cloud. For more information about the list of metrics, refer to [current supported namespaces](https://github.com/grafana/grafana/blob/master/public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_monitor/supported_namespaces.ts).
### Azure Monitor alerting
### Alerting
Grafana alerting is supported for the Azure Monitor service. This is not Azure Alerts support. For more information about Grafana alerting, refer to [how alerting in Grafana works]({{< relref "../alerting/_index.md" >}}).
......@@ -225,9 +227,9 @@ Grafana alerting is supported for Application Insights. This is not Azure Alerts
{{< docs-imagebox img="/img/docs/v60/azuremonitor-alerting.png" class="docs-image--no-shadow" caption="Azure Monitor Alerting" >}}
## Querying the Azure Log Analytics service
## Querying the Logs service
Queries are written in the new [Azure Log Analytics (or KustoDB) Query Language](https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/query-language). A Log Analytics query can be formatted as time series data or as table data.
Queries are written in the [Kusto Query Language](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/). A Logs query can be formatted as time series data or as table data.
If your credentials give you access to multiple subscriptions, then choose the appropriate subscription before entering queries.
......@@ -286,7 +288,7 @@ The default display name format is:
This can be customized by using the [display name field option]({{< relref "../panels/field-options/_index.md#display-name" >}}).
### Azure Log Analytics macros
### Logs macros
To make writing queries easier there are several Grafana macros that can be used in the where clause of a query:
......@@ -308,13 +310,13 @@ To make writing queries easier there are several Grafana macros that can be used
If using the `All` option, then check the `Include All Option` checkbox and in the `Custom all value` field type in the following value: `all`. If `$myVar` has value `all` then the macro will instead expand to `1 == 1`. For template variables with a lot of options, this will increase the query performance by not building a large "where..in" clause.
### Azure Log Analytics builtin variables
### Logs builtin variables
There are also some Grafana variables that can be used in Azure Log Analytics queries:
There are also some Grafana variables that can be used in Logs queries:
- `$__interval` - Grafana calculates the minimum time grain that can be used to group by time in queries. For more information about `$__interval`, refer to [interval variables]({{< relref "../variables/variable-types/_index.md#interval-variables" >}}). It returns a time grain like `5m` or `1h` that can be used in the bin function. E.g. `summarize count() by bin(TimeGenerated, $__interval)`
### Templating with variables for Azure Log Analytics
### Templating with variables for Logs
Any Log Analytics query that returns a list of values can be used in the `Query` field in the Variable edit view. There is also one Grafana function for Log Analytics that returns a list of workspaces.
......@@ -353,19 +355,19 @@ Perf
| order by TimeGenerated asc
```
### Deep linking from Grafana panels to the Log Analytics query editor in Azure Portal
### Deep linking from Grafana panels to the Azure Metric Logs query editor in Azure Portal
> Only available in Grafana v7.0+.
{{< docs-imagebox img="/img/docs/v70/azure-log-analytics-deep-linking.png" max-width="500px" class="docs-image--right" caption="Azure Log Analytics deep linking" >}}
{{< docs-imagebox img="/img/docs/v70/azure-log-analytics-deep-linking.png" max-width="500px" class="docs-image--right" caption="Logs deep linking" >}}
Click on a time series in the panel to see a context menu with a link to `View in Azure Portal`. Clicking that link opens the Azure Log Analytics query editor in the Azure Portal and runs the query from the Grafana panel there.
Click on a time series in the panel to see a context menu with a link to `View in Azure Portal`. Clicking that link opens the Azure Metric Logs query editor in the Azure Portal and runs the query from the Grafana panel there.
If you're not currently logged in to the Azure Portal, then the link opens the login page. The provided link is valid for any account, but it only displays the query if your account has access to the Azure Log Analytics workspace specified in the query.
If you're not currently logged in to the Azure Portal, then the link opens the login page. The provided link is valid for any account, but it only displays the query if your account has access to the Azure Metric Logs workspace specified in the query.
<div class="clearfix"></div>
### Azure Log Analytics alerting
### Logs alerting
> Only available in Grafana v7.0+.
......
......@@ -8,7 +8,7 @@ weight = 600
# Time series dimensions
At the end of the ["Time series databases" section of "Introduction to time series"]({{< relref "timeseries.md#time-series-databases" >}}), the concept of _labels_, also called _tags_, is introduced:
At the end of the ["Time series databases" section of "Introduction to time series"]({{< relref "timeseries.md#time-series-databases" >}}), the concept of _labels_, also called _tags_, is introduced:
> Another feature of a TSDB is the ability to filter measurements using _tags_. Each data point is labeled with a tag that adds context information, such as where the measurement was taken. ...
......@@ -74,12 +74,12 @@ If the query is updated to select and group by more than just one string column,
In this case the labels that represent the dimensions will have two keys based on the two string typed columns `Location` and `Sensor`. This data results four series: `Temp {Location=LGA,Sensor=A}`, `Temp {Location=LGA,Sensor=B}`, `Temp {Location=BOS,Sensor=A}`, and `Temp {Location=BOS,Sensor=B}`.
> **Note:** More than one dimension for SQL data sources is currently only supported in the Analytics services with the Azure monitor service as of version 7.1. Support for SQL data sources such as MySQL, Postgres, and MSSQL is planned to be added for 7.2.
> **Note:** More than one dimension is currently only supported in the Logs queries within the Azure Monitor service as of version 7.1.
> **Note:** Multiple dimensions are not supported in a way that maps to multiple alerts in Grafana, but rather they are treated as multiple conditions to a single alert. See the documentation on [creating alerts with multiple series]({{< relref "../alerting/create-alerts.md#multiple-series" >}}).
### Multiple values
In the case SQL-like data sources, more than one numeric column can be selected, with or without additional string columns to be used as dimensions. For example, ` AVG(Temperature) AS AvgTemp, MAX(Temperature) AS MaxTemp`. This, if combined with multiple dimensions can result in a lot of series. Selecting multiple values is currently only designed to be used with visualization.
In the case SQL-like data sources, more than one numeric column can be selected, with or without additional string columns to be used as dimensions. For example, `AVG(Temperature) AS AvgTemp, MAX(Temperature) AS MaxTemp`. This, if combined with multiple dimensions can result in a lot of series. Selecting multiple values is currently only designed to be used with visualization.
Additional technical information on tabular time series formats and how dimensions are extracted can be found in [the developer documentation on data frames as time series]({{< relref "../developers/plugins/data-frames.md#data-frames-as-time-series" >}}).
......@@ -136,7 +136,7 @@ export class AnalyticsConfig extends PureComponent<Props, State> {
return (
<>
<h3 className="page-heading">Azure Log Analytics API Details</h3>
<h3 className="page-heading">Azure Monitor Logs Details</h3>
<Switch
label="Same details as Azure Monitor API"
checked={jsonData.azureLogAnalyticsSameAs ?? false}
......
......@@ -22,7 +22,7 @@ export class InsightsConfig extends PureComponent<Props> {
const { options, onUpdateJsonDataOption, onUpdateSecureJsonDataOption } = this.props;
return (
<>
<h3 className="page-heading">Application Insights Details</h3>
<h3 className="page-heading">Azure Application Insights Details</h3>
<div className="gf-form-group">
{options.secureJsonFields.appInsightsApiKey ? (
<div className="gf-form-inline">
......
......@@ -55,7 +55,7 @@ export class MonitorConfig extends PureComponent<Props> {
const { options, subscriptions } = this.props;
return (
<>
<h3 className="page-heading">Azure Monitor Details</h3>
<h3 className="page-heading">Azure Monitor Metrics Details</h3>
<AzureCredentialsForm
selectedAzureCloud={options.jsonData.cloudName || 'azuremonitor'}
azureCloudOptions={azureClouds}
......
......@@ -5,7 +5,7 @@ exports[`Render should disable log analytics credentials form 1`] = `
<h3
className="page-heading"
>
Azure Log Analytics API Details
Azure Monitor Logs Details
</h3>
<Switch
checked={false}
......@@ -101,7 +101,7 @@ exports[`Render should enable azure log analytics load workspaces button 1`] = `
<h3
className="page-heading"
>
Azure Log Analytics API Details
Azure Monitor Logs Details
</h3>
<Switch
checked={false}
......@@ -197,7 +197,7 @@ exports[`Render should render component 1`] = `
<h3
className="page-heading"
>
Azure Log Analytics API Details
Azure Monitor Logs Details
</h3>
<Switch
checked={false}
......
......@@ -5,7 +5,7 @@ exports[`Render should disable insights api key input 1`] = `
<h3
className="page-heading"
>
Application Insights Details
Azure Application Insights Details
</h3>
<div
className="gf-form-group"
......@@ -73,7 +73,7 @@ exports[`Render should enable insights api key input 1`] = `
<h3
className="page-heading"
>
Application Insights Details
Azure Application Insights Details
</h3>
<div
className="gf-form-group"
......@@ -130,7 +130,7 @@ exports[`Render should render component 1`] = `
<h3
className="page-heading"
>
Application Insights Details
Azure Application Insights Details
</h3>
<div
className="gf-form-group"
......
......@@ -6,7 +6,7 @@
<select
class="gf-form-input service-dropdown min-width-12"
ng-model="ctrl.target.queryType"
ng-options="f as f for f in ['Application Insights', 'Azure Monitor', 'Azure Log Analytics', 'Insights Analytics']"
ng-options="f.id as f.label for f in ctrl.queryQueryTypeOptions"
ng-change="ctrl.onQueryTypeChange()"
></select>
</div>
......
......@@ -21,6 +21,13 @@ export class AzureMonitorQueryCtrl extends QueryCtrl {
dummyDiminsionString = '+';
queryQueryTypeOptions = [
{ id: AzureQueryType.ApplicationInsights, label: 'Application Insights' },
{ id: AzureQueryType.AzureMonitor, label: 'Metrics' },
{ id: AzureQueryType.LogAnalytics, label: 'Logs' },
{ id: AzureQueryType.InsightsAnalytics, label: 'Insights Analytics' },
];
target: {
// should be: AzureMonitorQuery
refId: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment