cdklabs / cdk-monitoring-constructs

Easy-to-use CDK constructs for monitoring your AWS infrastructure
https://constructs.dev/packages/cdk-monitoring-constructs
Apache License 2.0
443 stars 55 forks source link

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

Closed echeung-amzn closed 1 month ago

echeung-amzn commented 5 months ago

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`) it's easier for the library to calculate width dynamically. However for `CustomMetricGroup` may we have a `width` property? ```Javascript 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({...}), ], } ], }); ```