Skip to content

Metric SEARCH Expression support for GraphWidget CDK Construct #7237

Open
@bappa601

Description

@bappa601

Hi Team,

Currently GraphWidget only takes IMetric object in its 'Left' property array. and IMetric can only take MathExpression or Metric object. There is no support for SEARCH Expression in it.
Reference : https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudwatch.GraphWidget.html
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudwatch.IMetric.html

While working on dashboard I realized we do need to have SEARCH option enabled for GraphWidget in order to create dashboard properly.

Sample Use Case: Lets say you have a Fargate service where under your Cluster there are X number of Task running.
Now to have a graph on lets say Heap Used, we need one SEARCH Expression on 'Cluster Name' so that it will show Heap Usage for all the available Tasks under that Cluster.

Currently with CDK , you can't really get each TaskIds (as it will be generated at runtime) and that in turns will restrict you to create a METRIC expression with ClusterName and List.

So we really need to enable GraphWidget to take 'SEARCH Expression'.

Metric Expression is yet to be supported in CDK, #4942 #5261

do let me know if we already have some workaround

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatcheffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions