Amazon CloudWatch
Developer Guide (API Version 2010-08-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

mon-list-metrics Command

List the metrics associated with your AWS account. You can filter metrics by using any combination of MetricName, Namespace, or Dimensions. If a you do not specify a filter, all possible matches for the attribute are returned.

[Note]Note

Any metric not seen for two weeks will expire and be removed from from this list.

[Note]Note

The mon-list-metrics command can take up to two minutes to report data points added by calls to mon-put-data. The Query API equivalent ListMetrics, however, can take up to fifteen minutes.

SYNOPSIS
mon-list-metrics
[--dimensions  "key1=value1,key2=value2..." ] [--metric-name  value ]
[--namespace  value ]  [General Options]

DESCRIPTION
This call will get a list of all the metrics that the system is storing for
your AWS account. Note: Any metric not seen for two weeks will be aged out
from this list as that is the retention period for data. Metrics can be
filtered by any combination of MetricName, Namespace or Dimensions.  If any
of these filters is not specified, then all possible matches for the
respective attribute are returned.

SPECIFIC OPTIONS
-d, --dimensions "key1=value1,key2=value2..." 
Dimensions (one or more) along which the metric names are to be filtered.
If no dimensions are specified then metric names with all possible
dimensions will be included in the results.

-m, --metric-name VALUE
The name of a particular metric that you are interested in.  If not
specified, all possible metric names will be returned.

-n, --namespace VALUE
The namespace along which metrics will be filtered.  If not specified,
metric names from  all possible namespaces will be returned.


GENERAL OPTIONS
--aws-credential-file VALUE
Location of the file with your AWS credentials. This value can be set by
using the environment variable 'AWS_CREDENTIAL_FILE'.

-C, --ec2-cert-file-path VALUE
Location of your EC2 certificate file. This value can be set by using the
environment variable 'EC2_CERT'.

--connection-timeout VALUE
Specify a connection timeout VALUE (in seconds). The default value is
'30'.

--delimiter VALUE
What delimiter to use when displaying delimited (long) results.

--headers
If you are displaying tabular or delimited results, it includes the
column headers. If you are showing xml results, it returns the HTTP
headers from the service request, if applicable. This is off by default.

-I, --access-key-id VALUE
Specify VALUE as the AWS Access Id to use.

-K, --ec2-private-key-file-path VALUE
Location of your EC2 private key file. This value can be set by using the
environment variable 'EC2_PRIVATE_KEY'.

--region VALUE
Specify region VALUE as the web service region to use. This value can be
set by using the environment variable 'EC2_REGION'.

-S, --secret-key VALUE
Specify VALUE as the AWS Secret Key to use.

--show-empty-fields
Show empty fields using "(nil)" as a placeholder to indicate that this data was
not requested. Empty fields are not shown by default.

--show-request
Displays the URL the tools used to call the AWS Service. The default
value is 'false'.

--show-table, --show-long, --show-xml, --quiet
Specify how the results are displayed: tabular, delimited (long), xml, or
no output (quiet). Tabular shows a subset of the data in fixed
column-width form, while long shows all of the returned values delimited
by a character. The xml is the raw return from the service, while quiet
suppresses all standard output. The default is tabular, or 'show-table'.

-U, --url VALUE
This option will override the URL for the service call with VALUE. This
value can be set by using the environment variable 'AWS_CLOUDWATCH_URL'.


INPUT EXAMPLES

This returns a list of all your metrics.

$PROMPT>mon-list-metrics


This returns a list of all your metrics that have a particular metric name.

$PROMPT>mon-list-metrics --metric-name RequestCount


This returns a list of all your metrics that belong to a particular
namespace

$PROMPT>mon-list-metrics --namespace MyService


This returns a list of all your metrics having the specified dimension names
and values.

$PROMPT>mon-list-metrics --dimensions "User=SomeUser,Stack=Test"


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 - A list of the dimension names and values associated with this
  metric.

OUTPUT EXAMPLES

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}
...