-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small improvements on the azure module #13859
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4697da6
Refactoring and improvements
narph b6dae7f
Work on documentation
narph 192ee23
Add validation on config
narph fde4955
Update changelog file
narph 8eb6829
fix double records
narph 58b7142
Merge branch 'master' into metricbeat-azure
narph 55a206f
Work on documentation
narph c9dc70b
Work on review feedback
narph 8ce8d66
fix comment
narph 2f11e9e
remove "deprecated" condition
narph 6b2dac4
Small changes
narph cb4b698
Removing Fetch
narph bbf8b5e
Fix dimension name
narph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, are there a set of permissions user need to give this account in order for azure module to collect the metrics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More information on the authentication and the steps to require a service principal are found higher in the docs.asciidoc in the
=== Module-specific configuration notes
.I have just added the link to the RBAC as well, users will need to assign a role that allows them to read monitoring data, minimum effort would be "Monitoring Reader"