Skip to content

Commit

Permalink
feat(dashboard): use INHERIT period by default (#108)
Browse files Browse the repository at this point in the history
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_
  • Loading branch information
voho authored Apr 4, 2022
1 parent 97eb7a4 commit b6b28a4
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 88 deletions.
4 changes: 2 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -24037,7 +24037,7 @@ public readonly detailDashboardPeriodOverride: PeriodOverride;
```

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

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

Expand Down Expand Up @@ -24065,7 +24065,7 @@ public readonly summaryDashboardPeriodOverride: PeriodOverride;
```

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

Period override for the summary dashboard.

Expand Down
13 changes: 8 additions & 5 deletions lib/dashboard/DefaultDashboardFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface MonitoringDashboardsProps {
readonly detailDashboardRange?: Duration;
/**
* Period override for the detail dashboard (and other auxiliary dashboards).
* @default automatic (period dependent)
* @default respect individual graphs (PeriodOverride.INHERIT)
*/
readonly detailDashboardPeriodOverride?: PeriodOverride;
/**
Expand All @@ -52,7 +52,7 @@ export interface MonitoringDashboardsProps {
readonly summaryDashboardRange?: Duration;
/**
* Period override for the summary dashboard.
* @default automatic (period dependent)
* @default respect individual graphs (PeriodOverride.INHERIT)
*/
readonly summaryDashboardPeriodOverride?: PeriodOverride;
/**
Expand Down Expand Up @@ -102,7 +102,8 @@ export class DefaultDashboardFactory
{
dashboardName: props.dashboardNamePrefix,
start: detailStart,
periodOverride: props.detailDashboardPeriodOverride,
periodOverride:
props.detailDashboardPeriodOverride ?? PeriodOverride.INHERIT,
}
);
}
Expand All @@ -114,7 +115,8 @@ export class DefaultDashboardFactory
{
dashboardName: `${props.dashboardNamePrefix}-Summary`,
start: summaryStart,
periodOverride: props.summaryDashboardPeriodOverride,
periodOverride:
props.summaryDashboardPeriodOverride ?? PeriodOverride.INHERIT,
}
);
}
Expand All @@ -126,7 +128,8 @@ export class DefaultDashboardFactory
{
dashboardName: `${props.dashboardNamePrefix}-Alarms`,
start: detailStart,
periodOverride: props.detailDashboardPeriodOverride,
periodOverride:
props.detailDashboardPeriodOverride ?? PeriodOverride.INHERIT,
}
);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6b28a4

Please sign in to comment.