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

[custom] Expose a `position?: AxisPosition` property at the metric level

Open jedkass opened this issue 2 years ago • 1 comments

Feature scope

CloudWatch

Describe your suggested feature

Right now, the monitorCustom() method requires a metricGroups: CustomMetricGroup[] property. Each of these CustomMetricGroup objects has metric-group level graph configuration. However, each possible CustomMetric type in here does not seem to offer the ability to configure which axis position (i.e. right/left) a given metric should be displayed on. It looks like a property like this is exposed in CustomMetricWithAlarm, but it would be great to be able to configure axis positions for metrics in a dashboard that may not have associated alarms. I think it also makes more sense that axis position is associated with the metric, not alarm (but I could be missing something here)

jedkass avatar Dec 06 '22 22:12 jedkass

As a workaround, I've created a CustomMetricWithAlarm object with an empty addAlarm prop. For example:

{
      metric: metric,
      alarmFriendlyName: alarmFriendlyName,
      addAlarm: {},
      position: AxisPosition.RIGHT,
}

jedkass avatar Jul 03 '23 17:07 jedkass