Skip to content

Commit b6b28a4

Browse files
authored
feat(dashboard): use INHERIT period by default (#108)
We should set INHERIT by default to ensure that every graph has the preferred time resolution instead of the AUTO one (which can be 5m or 1h based on the range). It is better to have it set like this, since it will better correspond to alarms. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 97eb7a4 commit b6b28a4

File tree

4 files changed

+91
-88
lines changed

4 files changed

+91
-88
lines changed

API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24037,7 +24037,7 @@ public readonly detailDashboardPeriodOverride: PeriodOverride;
2403724037
```
2403824038

2403924039
- *Type:* aws-cdk-lib.aws_cloudwatch.PeriodOverride
24040-
- *Default:* automatic (period dependent)
24040+
- *Default:* respect individual graphs (PeriodOverride.INHERIT)
2404124041

2404224042
Period override for the detail dashboard (and other auxiliary dashboards).
2404324043

@@ -24065,7 +24065,7 @@ public readonly summaryDashboardPeriodOverride: PeriodOverride;
2406524065
```
2406624066

2406724067
- *Type:* aws-cdk-lib.aws_cloudwatch.PeriodOverride
24068-
- *Default:* automatic (period dependent)
24068+
- *Default:* respect individual graphs (PeriodOverride.INHERIT)
2406924069

2407024070
Period override for the summary dashboard.
2407124071

lib/dashboard/DefaultDashboardFactory.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface MonitoringDashboardsProps {
4242
readonly detailDashboardRange?: Duration;
4343
/**
4444
* Period override for the detail dashboard (and other auxiliary dashboards).
45-
* @default automatic (period dependent)
45+
* @default respect individual graphs (PeriodOverride.INHERIT)
4646
*/
4747
readonly detailDashboardPeriodOverride?: PeriodOverride;
4848
/**
@@ -52,7 +52,7 @@ export interface MonitoringDashboardsProps {
5252
readonly summaryDashboardRange?: Duration;
5353
/**
5454
* Period override for the summary dashboard.
55-
* @default automatic (period dependent)
55+
* @default respect individual graphs (PeriodOverride.INHERIT)
5656
*/
5757
readonly summaryDashboardPeriodOverride?: PeriodOverride;
5858
/**
@@ -102,7 +102,8 @@ export class DefaultDashboardFactory
102102
{
103103
dashboardName: props.dashboardNamePrefix,
104104
start: detailStart,
105-
periodOverride: props.detailDashboardPeriodOverride,
105+
periodOverride:
106+
props.detailDashboardPeriodOverride ?? PeriodOverride.INHERIT,
106107
}
107108
);
108109
}
@@ -114,7 +115,8 @@ export class DefaultDashboardFactory
114115
{
115116
dashboardName: `${props.dashboardNamePrefix}-Summary`,
116117
start: summaryStart,
117-
periodOverride: props.summaryDashboardPeriodOverride,
118+
periodOverride:
119+
props.summaryDashboardPeriodOverride ?? PeriodOverride.INHERIT,
118120
}
119121
);
120122
}
@@ -126,7 +128,8 @@ export class DefaultDashboardFactory
126128
{
127129
dashboardName: `${props.dashboardNamePrefix}-Alarms`,
128130
start: detailStart,
129-
periodOverride: props.detailDashboardPeriodOverride,
131+
periodOverride:
132+
props.detailDashboardPeriodOverride ?? PeriodOverride.INHERIT,
130133
}
131134
);
132135
}

test/dashboard/__snapshots__/DefaultDashboardFactory.test.ts.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)