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.
Athena Query
Returns the result of a query against an Athena table, for reporting over data held in S3.
Examples
Count pass/fail rate by day
SELECT date_trunc('day', run_time) AS day,
status,
count(*) AS total
FROM "e2e_metrics"
GROUP BY 1, 2
ORDER BY 1Top failing test groups in the last 24 hours
SELECT test_group, count(*) AS failures
FROM "e2e_metrics"
WHERE status = 'FAILED'
AND run_time > date_add('hour', -24, now())
GROUP BY test_group
ORDER BY failures DESCRequired permissions
Depending on your IAM configuration, grant the plugin's AWS role the following permissions:
athena:StartQueryExecutionathena:GetQueryExecutionathena:GetQueryResultsathena:StopQueryExecutionathena:ListWorkGroupsglue:GetDatabasesglue:GetTable- S3 read access to the Athena query results and query bucket
Cost
Returns AWS account cost and usage, broken down by service.
Example
The parameter configuration below produces the tile shown with it.
CloudWatch Metrics
Select a Query method to use. The parameters that display depend on your choice:
By resource
Choose metrics for named AWS resources, when you already know which resources the tile is about.
By namespace
Choose metrics across a whole CloudWatch namespace rather than named resources, so resources added later appear without editing the tile.
Insights query
Return CloudWatch metrics using a Metrics Insights query, for aggregation the other two modes cannot express.
CloudWatch Logs
Returns CloudWatch log data for the resources in scope.
Service Quotas
Returns the quotas applied to an AWS service, so a dashboard can show what is approaching a limit.
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
Returns the result of a query against a Timestream table, for time series data held in Timestream.
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_idDynamoDB Query
Query items from a DynamoDB table by partition key, or scan the whole table.
The sort key, sort direction and projection settings appear only when Query type is set to Query. Sort key value (end) appears only when Sort key operator is set to Between.
Deprecated streams
The following data streams are flagged as deprecated but can still be accessed via the Data streams tab by selecting Filter > Visibility > Deprecated.
Cost (Global - Configurable)
Retrieves AWS account cost and usage by service across all regions. Superseded by Cost.
S3 Metric
Retrieves CloudWatch metrics for one or more S3 buckets. Superseded by CloudWatch Metrics.
DynamoDB Metric
Retrieves CloudWatch metrics for one or more DynamoDB tables. Superseded by CloudWatch Metrics.
CloudWatch Metrics by Query
Queries CloudWatch metrics by namespace and name, by a Metric Insights SQL query, or by raw metric source JSON. Superseded by CloudWatch Metrics.
CloudWatch Metrics by Resource
Retrieves CloudWatch metrics for the objects selected in the tile. Superseded by CloudWatch Metrics.