grafana-aws-cloudwatch-dashboards
grafana-aws-cloudwatch-dashboards copied to clipboard
Add template variable for LinkedAccount in AWS/Billing
AWS cloudwatch metrics for AWS/Billing have an additonal dimension called LinkedAccount
for a setup with federated billing. Please add support of a template variable that can be changed to be either '*' for all or a dedicated account id, do filter the costs for that sub account only.
Could you provide dashboard example, please? I'm curious about that *
filter.
The template variable is a custom one with the hardwired IDs in it for now. No idea if there is a query in cloudwatch to fetch the subaccount ids progammatically.
{
"allValue": "*",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"hide": 0,
"includeAll": true,
"label": "Linked Account",
"multi": true,
"name": "subaccount",
"options": [{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "111111111111",
"value": "111111111111"
},
{
"selected": false,
"text": "222222222222",
"value": "222222222222"
},
{
"selected": false,
"text": "333333333333",
"value": "333333333333"
}
],
"query": "111111111111,222222222222,333333333333",
"skipUrlSync": false,
"type": "custom"
}
And the query just gets added yet another dimension on top of Currency and Service name like this:
{
"targets": [{
"alias": "Total",
"application": {
"filter": ""
},
"dimensions": {
"Currency": "USD",
"LinkedAccount": "$subaccount"
},
"expression": "",
"functions": [],
"group": {
"filter": ""
},
"highResolution": false,
"host": {
"filter": ""
},
"id": "",
"item": {
"filter": ""
},
"matchExact": true,
"metricName": "EstimatedCharges",
"mode": 0,
"namespace": "AWS/Billing",
"options": {
"showDisabledItems": false
},
"period": "",
"refId": "A",
"region": "us-east-1",
"returnData": false,
"statistics": [
"Average"
]
}]
}
I just realized, that even when using the *
as the placeholder for all linked accounts, the result does not include the data for the parent account. Which make scews the data, especially when you really want to show the total over all including the payer account.
This should list all linked accounts.
dimension_values($region,AWS/Billing,EstimatedCharges,LinkedAccount)
Yeah, that wildchar cloudwatch queries are tricky.
Could you provide dashboard example, please? I'm curious about that
*
filter.
Hi jan I'm trying to get data in grafana for route53 and for aws billing but in both of them I'm getting no data and for route53 I'm getting this error too (InvalidParameter: 2 validation error(s) found. - minimum field size of 1, GetMetricDataInput.MetricDataQueries[0].MetricStat.Metric.Dimensions[0].Value. - minimum field size of 1, GetMetricDataInput.MetricDataQueries[1].MetricStat.Metric.Dimensions[0].Value.) Can you please help me to solve it will be much appreciated Thankyou guys.. @jangaraj