I’m looking for a way to create an Insights dashboard that shows me COST of running machines with a given tag, and then next to it, another chart that shows the actual USAGE of those machines.
We have a process by which we allow some analysts to spin up EC2 instances to work with ‘point in time’ data sets, however I’m not convinced we’re getting the bang for the buck from these.
I’d like to go back to the DATA and say: “Look, last month you started 15 instances, costing an estimate of $4500 in cost, but the average CPU of these machines was almost negligible. Do you really need to spin these up?”
What I have tried thus far:
SELECT * from ComputeSample WHERE provider = ‘Ec2Instance’ limit 5
then inspect this to find anything that looks like a key that can be used to join against the machine information.
SELECT * from FinanceSample where provider=‘BillingServiceCost’ AND providerAccountId = ‘4515’ since 1 day ago limit 5
What I find in both of these results is an ‘entityGuid’, which definitely looks promising…
Then to pull CPU information:
“SELECT average(cpuPercent) FROM SystemSample TIMESERIES FACET
entityId WHERE (
entityId in (‘8864794503722940700’, ‘6415259491618633100’, ‘2973353937161916645’, ‘9211868280489576279’, ‘1085041849122858892’)) LIMIT 100 SINCE 60 minutes ago”
and in here, I also note that there is a Gguid that I can filter with.
I’ve gone through the items listed at Useful Insights NRQL queries library to no avail.
Is what I’m trying to do (a join across FinanceSample, ComputeSample, and SystemSample) possible?