-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small improvements on the azure module (#13859)
* Refactoring and improvements * Work on documentation * Add validation on config * Update changelog file * fix double records * Work on documentation * Work on review feedback * fix comment * remove "deprecated" condition * Small changes * Removing Fetch * Fix dimension name
- Loading branch information
Showing
19 changed files
with
375 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,60 @@ | ||
This is the azure module. | ||
|
||
The Azure Monitor feature collects and aggregates logs and metrics from a variety of sources into a common data platform where it can be used for analysis, visualization, and alerting. | ||
|
||
|
||
The azure monitor metrics are numerical values that describe some aspect of a system at a particular point in time. They are collected at regular intervals and are identified with a timestamp, a name, a value, and one or more defining labels. | ||
|
||
The azure module will periodically retrieve the azure monitor metrics using the Azure REST APIs as MetricList. | ||
Additional azure API calls will be executed in order to retrieve information regarding the resources targeted by the user. | ||
|
||
The azure module mericsets are `monitor`, `compute_vm` and `compute_vm_scaleset` | ||
|
||
[float] | ||
=== Module-specific configuration notes | ||
|
||
All the tasks executed against the Azure Monitor REST API will use the Azure Resource Manager authentication model. | ||
Therefore, all requests must be authenticated with Azure Active Directory (Azure AD). | ||
One approach to authenticate the client application is to create an Azure AD service principal and retrieve the authentication (JWT) token. | ||
For a more detailed walk-through, have a look at using Azure PowerShell to create a service principal to access resources https://docs.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azps-2.7.0. | ||
It is also possible to create a service principal via the Azure portal https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal. | ||
Users will have to make sure the roles assigned to the application contain at least reading permissions to the monitor data, more on the roles here https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles. | ||
|
||
Required credentials for the `azure` module: | ||
|
||
`client_id`:: The unique identifier for the application (also known as Application Id) | ||
|
||
`client_secret`:: The client/application secret/key | ||
|
||
`subscription_id`:: The unique identifier for the azure subscription | ||
|
||
`tenant_id`:: The unique identifier of the Azure Active Directory instance | ||
|
||
|
||
Users can use the azure credentials keys if configured `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID`, `AZURE_SUBSCRIPTION_ID` | ||
|
||
[float] | ||
== Metricsets | ||
|
||
[float] | ||
=== `monitor` | ||
This metricset allows users to retrieve metrics from specified resources. Added filters can apply here as the interval of retrieving these metrics, metric names, | ||
aggregation list, namespaces and metric dimensions. | ||
|
||
[float] | ||
=== `compute_vm` | ||
This metricset will collect metrics from the virtual machines, these metrics will have a timegrain every 5 minutes, | ||
so the `period` for `compute_vm` metricset should be `300s` or multiples of `300s`. | ||
|
||
[float] | ||
=== `compute_vm_scaleset` | ||
This metricset will collect metrics from the virtual machine scalesets, these metrics will have a timegrain every 5 minutes, | ||
so the `period` for `compute_vm_scaleset` metricset should be `300s` or multiples of `300s`. | ||
|
||
|
||
[float] | ||
== Additional notes about metrics and costs | ||
|
||
Costs: Metric queries are charged based on the number of standard API calls. More information on pricing here https://azure.microsoft.com/id-id/pricing/details/monitor/. | ||
|
||
Authentication: we are handling authentication on our side (creating/renewing the authentication token), so we advise users to use dedicated credentials for metricbeat only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[float] | ||
=== Metricset-specific configuration notes | ||
|
||
`refresh_list_interval`:: Resources will be retrieved at each fetch call (`period` interval), this means a number of Azure REST calls will be executed each time. | ||
This will be helpful if the azure users will be adding/removing resources that could match the configuration options so they will not added/removed to the list. | ||
To reduce on the number of API calls we are executing to retrieve the resources each time, users can configure this setting and make sure the list or resources will not be refreshed as often. | ||
This is also beneficial for performance and rate/ cost reasons (https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits). | ||
|
||
`resources` :: This will contain all options for identifying resources and configuring the desired metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
x-pack/metricbeat/module/azure/compute_vm/_meta/docs.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
This is the compute_vm metricset of the module azure. | ||
|
||
This metricset allows users to retrieve all metrics from specified virtual machines. | ||
|
||
include::../../_meta/shared-azure.asciidoc[] | ||
|
||
[float] | ||
==== Config options to identify resources | ||
|
||
`resource_id`:: (_[]string_) The fully qualified ID's of the resource, including the resource name and resource type. Has the format /subscriptions/{guid}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}. | ||
Should return a list of resources. | ||
|
||
`resource_group`:: (_[]string_) This option should return a list virtual machines we want to apply our metric configuration options on. | ||
|
||
If none of the options are entered then we will select all virtual machine from the entire subscription | ||
For each metric the primary aggregation assigned will be retrieved. | ||
A default non configurable timegrain of 5 min is set so users are advised to configure an interval of 300s or a multiply of it. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.