0

In dashboards we often use the graph search functionality to catch all functions that have part-of-function-name in their function name.

{
    "metrics": [
        [ { "expression": "SEARCH('{AWS/Lambda,FunctionName} part-of-function-name Duration', 'p90', 86400)", "id": "e1", "region": "eu-west-1" } ]
    ],
    "view": "bar",
    "region": "eu-west-1",
    "stat": "Average",
    "period": 300
}

Can you use something similar in the aws cli? How? I was looking at the below command but don't know where to put it.

aws cloudwatch get-metric-statistics --metric-name Duration \
--start-time 2014-04-08T23:18:00Z \
--end-time 2014-04-09T23:18:00Z \
--period 3600 --namespace AWS/Lambda --statistics p90
samtoddler
  • 8,463
  • 2
  • 26
  • 21
Roelant
  • 4,508
  • 1
  • 32
  • 62

1 Answers1

0

As far as the API call GetMetricStatistics you can not use SEARCH in combination to get the metric statistics

Alternatively you can use GetMetricWidgetImage

You can use the GetMetricWidgetImage API to retrieve a snapshot graph of one or more Amazon CloudWatch metrics as a bitmap image

GetMetricWidgetImage: Metric Widget Structure and Syntax

Here is a working example of the call using aws cli.

samtoddler
  • 8,463
  • 2
  • 26
  • 21