Skip to content

Commit 8b50140

Browse files
authored
fix: Global Default Region and Account not set in certain metrics (#615)
Adds them to the metric in adaptMetric if they are present in globalDefault --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 54d6a06 commit 8b50140

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

lib/common/metric/MetricFactory.ts

+8
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ export class MetricFactory {
229229
* @param metric metric to be adapted
230230
*/
231231
adaptMetric(metric: MetricWithAlarmSupport): MetricWithAlarmSupport {
232+
if (this.globalDefaults.region) {
233+
metric = metric.with({ region: this.globalDefaults.region });
234+
}
235+
236+
if (this.globalDefaults.account) {
237+
metric = metric.with({ account: this.globalDefaults.account });
238+
}
239+
232240
return metric.with({
233241
period: this.globalDefaults.period ?? DefaultMetricPeriod,
234242
});

0 commit comments

Comments
 (0)