diff --git a/lib/common/metric/MetricFactory.ts b/lib/common/metric/MetricFactory.ts index 2beea24d..a4062162 100644 --- a/lib/common/metric/MetricFactory.ts +++ b/lib/common/metric/MetricFactory.ts @@ -229,6 +229,14 @@ export class MetricFactory { * @param metric metric to be adapted */ adaptMetric(metric: MetricWithAlarmSupport): MetricWithAlarmSupport { + if (this.globalDefaults.region) { + metric = metric.with({ region: this.globalDefaults.region }) + } + + if (this.globalDefaults.account) { + metric = metric.with({ account: this.globalDefaults.account }) + } + return metric.with({ period: this.globalDefaults.period ?? DefaultMetricPeriod, });