**To publish a custom metric to Amazon CloudWatch** The following example uses the ``put-metric-data`` command to publish a custom metric to Amazon CloudWatch:: aws cloudwatch put-metric-data --namespace "Usage Metrics" --metric-data file://metric.json The values for the metric itself are stored in the JSON file, ``metric.json``. Here are the contents of that file:: [ { "MetricName": "New Posts", "Timestamp": "Wednesday, June 12, 2013 8:28:20 PM", "Value": 0.50, "Unit": "Count" } ] For more information, see `Publishing Custom Metrics`_ in the *Amazon CloudWatch Developer Guide*. .. _`Publishing Custom Metrics`: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/publishingMetrics.html **To specify multiple dimensions** The following example illustrates how to specify multiple dimensions. Each dimension is specified as a Name=Value pair. Multiple dimensions are separated by a comma.:: aws cloudwatch put-metric-data --metric-name Buffers --namespace MyNameSpace --unit Bytes --value 231434333 --dimensions InstanceID=1-23456789,InstanceType=m1.small
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
delete-alarms.rst | File | 254 B | 0644 |
|
describe-alarm-history.rst | File | 1.85 KB | 0644 |
|
describe-alarms-for-metric.rst | File | 3.48 KB | 0644 |
|
describe-alarms.rst | File | 1.71 KB | 0644 |
|
disable-alarm-actions.rst | File | 270 B | 0644 |
|
enable-alarm-actions.rst | File | 270 B | 0644 |
|
get-metric-statistics.rst | File | 4.8 KB | 0644 |
|
list-metrics.rst | File | 2.63 KB | 0644 |
|
put-metric-alarm.rst | File | 1.38 KB | 0644 |
|
put-metric-data.rst | File | 1.1 KB | 0644 |
|
set-alarm-state.rst | File | 401 B | 0644 |
|