cdk-monitoring-constructs icon indicating copy to clipboard operation
cdk-monitoring-constructs copied to clipboard

[custom] Add `width` property for `CustomMetricGroup`

Open echeung-amzn opened this issue 1 year ago • 0 comments

Discussed in https://github.com/cdklabs/cdk-monitoring-constructs/discussions/450

Originally posted by ericxinzhang November 2, 2023 My code looks as following. I can specify height in CustomMonitoringProps. I am wondering why CustomMetricGroup does not have a width property?

I understand that for high level APIs (e.g. monitor<ResourceType>) it's easier for the library to calculate width dynamically. However for CustomMetricGroup may we have a width property?

const monitoring = new MonitoringFacade(this, 'MyDashboard');

monitoring.monitorCustom({
  height: 5,
  humanReadableName: 'API',
  metricGroups: [
    {
        title: 'API Errors',
        // I wish I could specify `width` here
        graphWidgetLegend: cw.LegendPosition.RIGHT,
        metrics:[
          new cloudwatch.Metric({...}),
          new cloudwatch.Metric({...}),
       ],
    },
    {
        title: 'API Latency',
        graphWidgetLegend: cw.LegendPosition.RIGHT,
        metrics:[
          new cloudwatch.Metric({...}),
          new cloudwatch.Metric({...}),
       ],
    }
  ],
});
```</div>

echeung-amzn avatar Jan 16 '24 21:01 echeung-amzn