File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
receiver/azuremonitorreceiver Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 28
28
errMissingClientSecret = errors .New (`"ClientSecret" is not specified in config` )
29
29
errMissingFedTokenFile = errors .New (`"FederatedTokenFile" is not specified in config` )
30
30
errInvalidCloud = errors .New (`"Cloud" is invalid` )
31
+ errInvalidMaxResPerBatch = errors .New (`"MaximumResourcesPerBatch" should be greater than 0` )
31
32
32
33
monitorServices = []string {
33
34
"Microsoft.EventGrid/eventSubscriptions" ,
@@ -332,5 +333,9 @@ func (c Config) Validate() (err error) {
332
333
err = multierr .Append (err , errInvalidCloud )
333
334
}
334
335
336
+ if c .UseBatchAPI && c .MaximumResourcesPerBatch < 0 {
337
+ err = multierr .Append (err , errInvalidMaxResPerBatch )
338
+ }
339
+
335
340
return
336
341
}
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ func TestLoadConfig(t *testing.T) {
109
109
return cfg
110
110
}(),
111
111
},
112
+ {
113
+ id : component .NewIDWithName (metadata .Type , "max_resources_per_batch_negative_value" ),
114
+ expectedErr : errInvalidMaxResPerBatch .Error (),
115
+ },
112
116
}
113
117
114
118
for _ , tt := range tests {
Original file line number Diff line number Diff line change @@ -39,4 +39,12 @@ azuremonitor/valid_authenticator_2:
39
39
discover_subscriptions : true
40
40
auth :
41
41
authenticator : azureauth
42
- credentials : does-not-matter
42
+ credentials : does-not-matter
43
+
44
+ azuremonitor/max_resources_per_batch_negative_value :
45
+ discover_subscriptions : true
46
+ auth :
47
+ authenticator : azureauth
48
+ credentials : does-not-matter
49
+ use_batch_api : true
50
+ maximum_resources_per_batch : -1
You can’t perform that action at this time.
0 commit comments