probeCloudWatch

get_metric_data

Gets metric data for a given metric in a given time period. This method allows for more data to be retrieved than get_metric_statistics

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosaws.cloudwatch.probes
Nameget_metric_data
Returnnumber

Usage

JSON

{
  "name": "get-metric-data",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosaws.cloudwatch.probes",
    "func": "get_metric_data",
    "arguments": {
      "namespace": "",
      "metric_name": ""
    }
  }
}

YAML

name: get-metric-data
provider:
  arguments:
    metric_name: ""
    namespace: ""
  func: get_metric_data
  module: chaosaws.cloudwatch.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
namespacestringYesNamespaceAWS Cloud Watch namespace
metric_namestringYesMetric NameName of the metric to fetch data for
dimension_namestringnullNoDimension NameName of a dimension of the metric, or use dimensions below
dimension_valuestringnullNoDimension ValueValue for the dimension name above when set
dimensionslistnullNoDimensionsList of dimension objects to fetch data for, when not using a single dimension above
statisticstringnullNoStatisticsType of data to return: Average, Sum, Minimum, Maximum, SampleCount
unitstringnullNoUnit TypeThe unit type of the data to collect
durationinteger300NoDurationHow far back should we start from the offset in seconds
offsetinteger0NoOffsetWhen do we start looking back in seconds from now
periodinteger60NoPeriodThe window for which pull data points

Signature

def get_metric_data(namespace: str,
                    metric_name: str,
                    dimension_name: str = None,
                    dimension_value: str = None,
                    dimensions: List[Dict[str, str]] = None,
                    statistic: str = None,
                    duration: int = 300,
                    period: int = 60,
                    offset: int = 0,
                    unit: str = None,
                    configuration: Dict[str, Dict[str, str]] = None,
                    secrets: Dict[str, Dict[str, str]] = None) -> float:
    pass