AWS
action CloudWatch

# put_metric_data

Publish metric data points to CloudWatch

Run it now
View details

Type | action
Module | chaosaws.cloudwatch.actions
Name | put_metric_data
Return | None

Usage

JSON

    {
      "name": "put-metric-data",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosaws.cloudwatch.actions",
        "func": "put_metric_data",
        "arguments": {
          "namespace": "",
          "metric_data": []
        }
      }
    }

YAML

    name: put-metric-data
    provider:
      arguments:
        metric_data: []
        namespace: ""
      func: put_metric_data
      module: chaosaws.cloudwatch.actions
      type: python
    type: action

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
namespace | string |  | Yes | Namespace | AWS Cloud Watch namespace
metric_data | list |  | Yes | Metric Data | A list of metric payloads

Example:

    {
      "namespace": "MyCustomTestMetric",
      "metric_data": [
        {
          "MetricName": "MemoryUsagePercent",
          "Dimensions": [
            {"Name": "InstanceId", "Value": "i-000000000000"},
            {"Name": "Instance Name", "Value": "Test Instance"}
          ],
          "Timestamp": datetime(yyyy, mm, dd, HH, MM, SS),
          "Value": 55.55,
          "Unit": "Percent",
          "StorageResolution": 60
        }
      ]
    }

For additional information, consult: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch.html#CloudWatch.Client.put_metric_data

Signature

    def put_metric_data(namespace: str,
                        metric_data: List[Dict[str, Any]],
                        configuration: Dict[str, Dict[str, str]] = None,
                        secrets: Dict[str, Dict[str, str]] = None):
        pass

## Related starters

- AWS
  action CloudWatch

  ## `enable_rule`

  Enables a CloudWatch rule
- AWS
  probe CloudWatch

  ## `get_metric_statistics`

  Get the value of a statistical calculation for a given metric
- AWS
  action CloudWatch

  ## `enable_rule`

  Enables a CloudWatch rule