-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Feature scope
Dashboards
Describe your suggested feature
The CustomMetricGroup construct should expose the start and end properties from the underlying GraphWidgetProps as graphWidgetStart and graphWidgetEnd.
A good use-case for this is anything that uses CloudWatch metrics insights, which has a 3-hour limit on lookback that is considerably less than that of standard AWS service metrics. A dashboard with some metrics insights panels and some standard panels will either:
- be forced to set the dashboard time range to
3hand lose insight - see an error:
You can only query the most recent 3 hours of datawhen loading a dashboard with a larger time range.
If we can customize the start + end ranges, we can just "fix" the range of metrics insights widgets specifically to 3h.
NOTE: As an implementation detail, though the value accepted by the AWS CDK is a string it might be worth codifying the construction of the relative time window with a class to avoid having to muck with the format strings manually:
You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -P, and you can use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT8H shows the last 8 hours and -P3M shows the last three months. You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.