CMK version: Checkmk Cloud Edition 2.3.0p17 OS version: AlmaLinux8.10
All there is on documentation is GCP Cost
And I don’t get it, how this works.
I have created the cost-rule and defined it to run on the host, that holds the special-agent who is also gathering information about the gcp infrastructure.
In GCP I see that the query is handled and I get a result.
Also the Exceptions-Service is OK, no errors.
But the service which is created by the cost rule is unknown: Item not found in monitoring data.
“One service is created for each project id in cost data” - shall I not use the host holding the special agent, but a new host that handles all “cost data” - how would that host be created?
there is a bug! you have to change your query. This one works:
query = f'SELECT PROJECT.name, PROJECT.id, (SUM(cost)- SUM(-1 * IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) c WHERE c.type NOT IN ( "SPENDING_BASED_DISCOUNT" )), 0))) AS cost, currency, invoice.month FROM `{tableid}` WHERE invoice.month >= "{prev_month.strftime("%Y%m")}" and PROJECT.name is not null GROUP BY PROJECT.name, PROJECT.id, currency, invoice.month'
For background: I want to get the cost, that I also will have to pay for. So I get the same number in billing-dashboard and checkMK <3
Also: There a costs, that are not billed on a project, so you have to take care of that in the query.
Also: you have to use the same timeframe on select and view. Google is quite special on providing costs. If you want to get accurate data you have to use the same method, eg invoice.month
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.