Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template variable for LinkedAccount in AWS/Billing #72

Open
christoph-buente opened this issue Mar 6, 2020 · 5 comments
Open

Add template variable for LinkedAccount in AWS/Billing #72

christoph-buente opened this issue Mar 6, 2020 · 5 comments

Comments

@christoph-buente
Copy link

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.

@jangaraj
Copy link
Member

jangaraj commented Mar 6, 2020

Could you provide dashboard example, please? I'm curious about that * filter.

@christoph-buente
Copy link
Author

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"
		]
	}]
}

@christoph-buente
Copy link
Author

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.

@jangaraj
Copy link
Member

jangaraj commented Mar 9, 2020

This should list all linked accounts.

dimension_values($region,AWS/Billing,EstimatedCharges,LinkedAccount)

Yeah, that wildchar cloudwatch queries are tricky.

@kachhela57
Copy link

kachhela57 commented May 3, 2021

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

@jangaraj jangaraj mentioned this issue May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants