AWS Data Stream Parameters
The AWS plugin provides configurable data streams to fetch cost data and service metrics.
Each configurable data stream exposes a set of parameters that lets you filter the data you retrieve. The following information describes the available configurable data streams and their parameters in detail.
Account Cost (Configurable)
Example
CloudWatch Metrics
Select a Query method to use. The parameters that display depend on your choice:
By resource
By namespace
Insights query
CloudWatch Logs
Service Quotas
Additional usage metrics
Some quotas have accesses to additional metric data. Where there are metrics available, you can use this data stream with SQL analytics to provide additional usage context.
In the following example, the CurrentQuotas and DefaultQuotas datasets are joined with the Metric dataset. This allows the metric values to be viewed alongside both the current applied quota and the default quota, providing additional context when analyzing service utilization and determining how close a service is to its configured limits.
WITH
"current_default_quota" AS (
SELECT
"c"."QuotaName",
"c"."QuotaCode",
"c"."UsageMetric.MetricName" as "MetricName",
"c"."Value" AS "CurrentQuota",
"d"."Value" AS "DefaultQuota"
FROM
"CurrentQuotas" "c"
JOIN "DefaultQuotas" "d" ON "c"."QuotaCode" = "d"."QuotaCode"
)
SELECT
"m"."MetricDataResults.Timestamps",
"m"."MetricDataResults.Values" AS "MetricValue",
"m"."MetricDataResults.Label" AS "QuotaName",
"cd"."CurrentQuota",
"cd"."DefaultQuota"
FROM
"Metric" "m"
LEFT JOIN "current_default_quota" "cd" ON "m"."MetricDataResults.Label" = "cd"."MetricName"Required permissions
This data stream should function with the ServiceQuotasReadOnlyAccess managed policy attached. However, depending on your IAM configuration, you may also need to grant the following permissions:
servicequotas:ListServicesservicequotas:ListServiceQuotasservicequotas:ListAWSDefaultServiceQuotas
Timestream Query
Examples
Retrieve CPU utilization over the past hour
SELECT time, measure_value::double AS cpu_utilization
FROM "MetricsDB"."SystemMetrics"
WHERE measure_name = 'cpu_utilization'
AND time > ago(1h)
ORDER BY time DESCAggregate average temperature by device for the last 24 hours
SELECT device_id,
AVG(measure_value::double) AS avg_temperature
FROM "IoTDB"."SensorReadings"
WHERE measure_name = 'temperature'
AND time BETWEEN ago(24h) AND now()
GROUP BY device_id