Skip to content

cloudwatch list-metrics

List the specified metrics

Description

list the specified metrics

Synopsis

cloudwatch list-metrics
    [--site <site>]
    [--region <region>]
    [--namespace <namespace>]
    [<name>]
    [--dimensions <dimensions>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

region - (string)

     AWS region for the service
     Example: --region "region-1"
     Default: _None_      Attributes: optional

namespace - (string)

     The metric namespace to filter against
     Example: --namespace "namespace-1"
     Default: _None_      Attributes: optional

name - (string)

     The name of the metric to filter against
     Example: "name-1"
     Default: _None_      Attributes: optional

dimensions - (string)

     The dimensions to filter against
     Example: --dimensions "{"Class":"None"}"
     Default: _None_      Attributes: optional

Examples

Input:

x=! cloudwatch list-metrics
Output:
[
  {
    "metric_name": "CallCount",
    "namespace": "AWS/Usage",
    "dimensions": {
      "Class": "None",
      "Resource": "ListBuckets",
      "Service": "S3",
      "Type": "API"
    }
  },
  {
    "metric_name": "DatabaseConnections",
    "namespace": "AWS/RDS",
    "dimensions": {
      "DatabaseClass": "db.t3.micro"
    }
  }
]
Input:
! cloudwatch list-metrics
Output:
METRIC NAME                     NAMESPACE 
CallCount                       AWS/Usage
DatabaseConnections             AWS/RDS 

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "cloudwatch"
Service Instance
Namespace
Object Type "alarm"
Object ID

Please see Access Control for details.