fbpx
POSThttps://api.spotinst.io/spectrum/metrics/metricStatisticsQuery?accountId={ACCOUNT_ID}

Query for specific metric statistics

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Account ID from Spotinst console

Example: act-12345
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
  "namespace": "myNamespace",
  "metricName": "metricName",
  "timeInterval": "1m",
  "statistic": "average",
  "dateRange": {
    "from": 1490860688,
    "to": 1490860688
  },
  "dimensions": [
    {
      "name": "dimensionName",
      "value": "dimensionValue"
    }
  ]
}

Body Attributes


  • namespace * String
    The name of the namespace
  • metricName * String
    The name of the metric
  • timeInterval String
    The time interval granularity of the returned data points. Allowed values:
    1m
    5m
    15m
    30m
    1h
    2h
    6h
    12h
    24h
  • statistic * String
    The metric statistic. Allowed values:
    average
    count
    minimum
    maximum
    sum
  • dateRange * Object
    Dates containing the range to determine the data points to return.
  • dateRange.from * Integer
    The Unix time stamp that determines the first data point to return.
  • dateRange.to * Integer
    The Unix time stamp that determines the last data point to return.
  • dimensions * Array
    (at least one required) The dimensions to report.
  • dimensions.name * String
    The name of the dimension.
  • dimensions.value * String
    The value representing the dimension.
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
	"request": {
		"id": "cb6509c2-84a9-4e1e-a6b4-5b91fa5f2450",
		"url": "/spectrum/metrics/metricStatisticsQuery",
		"method": "POST",
		"timestamp": "1970-01-01T01:00:00.000+0000"
	},
	"response": {
		"status": {
			"code": 200,
			"message": "OK"
		},
		"kind": "spotinst:spectrum:queryMetricStatistics",
		"items": [{
			"aggregations": [{
				"dimensions": [{
					"name": "dimensionName",
					"value": "dimensionValue"
				}],
				"datapoints": [{
						"timestamp": "2017-08-22T00:00:00.000Z",
						"statistics": {
							"average": 21.2000007629
						}
					},
					{
						"timestamp": "2017-08-22T00:01:00.000Z",
						"statistics": {
							"average": 18.3999996185
						}
					}
				]
			}]
		}]
	}
}