1

so I have created custom dashboard in AWS cloudwatch using json

{
            "height": 6,
            "width": 6,
            "y": 54,
            "x": 0,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": [
                    [ "service-es-dashboard","fact-bulk-loader","service", "es-dashboard" ]
                ],
                "region": "us-east-1",
                "title": "ES-documents-count"
            }
        }

and my metric array has different metric names like fact-bulk-loader-1, fact-bulk-loader-2 enter image description here

now i want to add all the metric name present in the metric array in my widget in dashboard how do i do that ? i can add a metric name and see but i want the process to be dynamic as every week new metrics gets added into the mertic array

1 Answers1

1

You can use a search expression.

The metrics part would look something like this:

"metrics": [
    [ { "expression": "SEARCH('{service-es-dashboard,service} service=\"es-dashboard\" MetricName=\"fact-bulk-loader', 'Average', 300)", "id": "e2", "period": 300 } ]
]
Dejan Peretin
  • 10,891
  • 1
  • 45
  • 54