-
Notifications
You must be signed in to change notification settings - Fork 3k
receiver/azuremonitor - Added maximumResourcesPerBatch config #40752
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
receiver/azuremonitor - Added maximumResourcesPerBatch config #40752
Conversation
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.
I'm curious, would you be a user of that config field?
Because I mentioned in the issue the possibility to configure that by resource type. If this is something that could be interesting for you maybe you could implement it instead of a global field WDYT?
Also @andrewegel @ahurtaud I would like your opinion on that, since you are in the origins of that idea. #40078 (comment)
@@ -28,6 +28,7 @@ var ( | |||
errMissingClientSecret = errors.New(`"ClientSecret" is not specified in config`) | |||
errMissingFedTokenFile = errors.New(`"FederatedTokenFile" is not specified in config`) | |||
errInvalidCloud = errors.New(`"Cloud" is invalid`) | |||
errInvalidMaxResPerBatch = errors.New(`"MaximumResourcesPerBatch" is invalid`) |
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.
errInvalidMaxResPerBatch = errors.New(`"MaximumResourcesPerBatch" is invalid`) | |
errInvalidMaxResPerBatch = errors.New(`"MaximumResourcesPerBatch" is invalid. It should be between 1 and 50`) |
I think it is fine, even more that we dont have much configuration per "resource type". something like: receivers:
azuremonitor/default:
use_batch_api: true
maximum_resources_per_batch: 50
services:
- Microsoft.Compute/virtualMachines
- blahblah
azuremonitor/throttled:
use_batch_api: true
maximum_resources_per_batch: 10
services:
- Microsoft.Network/loadBalancers |
Having config by resource type is actually something that we do now, with split dimensions receivers:
azuremonitor:
dimensions:
enabled: true
overrides:
"Microsoft.Network/azureFirewalls":
# Real example of an Azure limitation here:
# Dimensions exposed are Reason, Status, Protocol,
# but when selecting Protocol in the filters, it returns nothing.
# Note here that the metric display name is ``Network rules hit count`` but it's programmatic value is ``NetworkRuleHit``
# Ref: https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-network-azurefirewalls-metrics
"NetworkRuleHit": [Reason, Status] With metrics aggregations specifications receivers:
azuremonitor:
resource_groups:
- ${resource_groups}
services:
- Microsoft.EventHub/namespaces
- Microsoft.AAD/DomainServices # scraper will fetch all metrics from this namespace since there are no limits under the "metrics" option
metrics:
"microsoft.eventhub/namespaces": # scraper will fetch only the metrics listed below:
IncomingMessages: [total] # metric IncomingMessages with aggregation "Total"
NamespaceCpuUsage: [*] # metric NamespaceCpuUsage with all known aggregations So to align in that direction, for consistency for users, it might be better to have it here as well. I don't know if it's shocking or not and in which measure this feature will be used. We are not so that's why I was asking to people that would use it ^^. But yeah, knowing that there is an easy solution and that the feature will probably used in limited conditions, let's not overthink and do it like you said @ahurtaud |
I've updated #40078 (comment) ; TL;DR: I don't think a
|
…ion-MaximumResourcesPerBatch' into receiver/azuremonitor-configuration-MaximumResourcesPerBatch
Thanks @andrewegel ! I answered directly in the issue. This is not incompatible IMHO. |
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.
Pretty neat! Looks completely good to me. I can't trigger the approval for workflow but I approve the code.
Correct not incompatible with this change, but I did go with a different route |
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.
LGTM ready to merge. Thank you !
Hey @evan-bradley could you please review this! |
@@ -39,4 +39,4 @@ azuremonitor/valid_authenticator_2: | |||
discover_subscriptions: true | |||
auth: | |||
authenticator: azureauth | |||
credentials: does-not-matter | |||
credentials: does-not-matter |
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.
credentials: does-not-matter | |
credentials: does-not-matter | |
Description
Added a new config
maximum_resources_per_batch
with a default and max value of 50Link to tracking issue
Fixes #40112
Testing
Added UTs for config validation tests
Documentation
Added details about the config in
receiver/azuremonitorreceiver/README.md