mon-list-metrics
Description
Lists the names, namespaces, and dimensions of the metrics associated with your AWS account. You can filter metrics using any combination of metric name, namespace, or dimensions. If you do not specify a filter, all possible matches for the attribute are returned.
Note
The mon-list-metrics command can take up to fifteen minutes to report new metric
names, namespaces, and dimensions added by calls to mon-put-data
. The data points put by
mon-put-data
, or other methods will be available by
mon-get-statistics
in less than five minutes.
Syntax
mon-list-metrics [--dimensions
"key1=
value1
,key2=value2
..."] [--metric-name value
] [--namespace value
] [Common Options]
Options
Name | Description |
---|---|
-d, --dimensions |
The dimensions of the metric to retrieve. You can specify dimensions two ways and the formats can be combined or used interchangeably:
If no dimensions are specified, no filtering of dimensions will be done. Any other requested filters will still be applied. To be included in the result a metric must contain all specified dimensions, although the metric may contain additional dimensions beyond the requested metrics. Type: Map Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No |
|
The name of the metric. To be included in the results, the metric name must match the requested metric name exactly. If no metric name is specified no filtering is done. Any other requested filters are applied. Type: Simple Valid values: Any valid metric name between 1 and 250 characters in length. Default: n/a Required: No |
|
The namespace to use to filter metrics. For more information about namespaces, see AWS Namespaces. Type: String Valid values: A valid namespace between 1 and 250 characters in length. Default: n/a Required: No |
Common options
Name | Description |
---|---|
|
The location of the file with your AWS credentials. You can set this
value using the environment variable Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable |
|
The location of your EC2 certificate file for signing requests. You
can use the environment variable Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable |
|
The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 |
|
The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) |
|
If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The |
|
The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None |
|
The private key that will be used to sign the
request. Using public/private keys causes the CLI to use SOAP. The request is
signed with a public certificate and private key. This parameter must be used in
conjunction with Type: String Valid values: The path to a valid ASN.1 private key. Default: None |
|
The region requests are directed to. You can use the environment
variable Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the |
|
The secret access key that will be used to sign the request, in conjunction with an access
key ID. This parameter must be used in conjunction with
Type: String Valid values: Your access key ID. Default: None |
|
Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. |
|
Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false |
|
Specifies how the results are displayed: in a table, delimited (long), XML, or
no output (quiet). The Type: Flag Valid values: None Default: |
|
The URL used to contact CloudWatch. You can set this value using the
environment variable Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in |
Output
This command returns a table that contains the following:
-
Metric Name - The name of the metric attached to this metric.
-
Namespace - The namespace associated with this metric.
-
Dimensions - The dimension names and values associated with this metric.
The Amazon CloudWatch CLI displays errors on stderr.
Examples
Example request
This example returns a list of all your metrics.
mon-list-metrics
This is an example of an output of a call to 'mon-list-metrics'.
Metric Name Namespace Dimensions CPUUtilization AWS/EC2 {InstanceId=i-e7e48a8e} CPUUtilization AWS/EC2 {InstanceId=i-231d744a} CPUUtilization AWS/EC2 {InstanceId=i-22016e4b} CPUUtilization AWS/EC2 {InstanceId=i-b0345cd9} CPUUtilization AWS/EC2 {InstanceId=i-539dff3a} CPUUtilization AWS/EC2 {InstanceId=i-af3544c6} CPUUtilization AWS/EC2 {InstanceId=i-d4f29ebd} CPUUtilization AWS/EC2 {ImageId=ami-de4daab7} ...
Example request
This example lists your metrics with the specified name.
mon-list-metrics --metric-name RequestCount
Example request
This example lists your metrics that belong to the specified namespace.
mon-list-metrics --namespace MyService
Example request
This example lists your metrics with the specified dimension names and values.
mon-list-metrics --dimensions "User=SomeUser,Stack=Test"