You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.
Create a DataStudio report following instructions.
With some projects, you get a blank widget that is based on cost_with_unallocated_untracked. See attachment missing data.jpg. This is ultimately because for some values of sku, the SUM(usage.amount) is 0 in the billing-export table. Presumably this is an ordinary occurrence when an SKU is unused, and so this case should be handled.
Minimal reproduction of divide-by-zero error follows. (To run it, replace table and project identifiers). This is a subquery directly from the connector sourcecode and only uses one table, so the problem is not in complex joins, just in the usage of data that can have zero values.
SELECT
sku.id AS sku_id,
project.id AS project_id,
MIN(usage_start_time) AS min_usage_start_time,
MAX(usage_end_time) AS max_usage_end_time,
SUM(usage.amount) AS amount,
usage.unit AS usage_unit,
SUM(cost) AS cost,
(SUM(cost) / SUM(usage.amount)) AS rate
FROM
`MY_BILLING_EXPORT_PROJECT.BILLING_EXPORT_DATASET.BILLING_EXPORT_TABLE`
WHERE
usage_start_time >= TIMESTAMP("2010-00-00")
AND usage_end_time <= TIMESTAMP("2030-01-01")
AND project.id = "MYPROJECT"
GROUP BY
project.id,
sku.id,
usage.unit
Solution: Handle cases with value 0.
A related issue is at the Google Issue tracker, but apparently here at GitHub is the right place for the elements of this bug that involve the connector.
The text was updated successfully, but these errors were encountered:
Here is what the blank widget looks like; and the error dialog. These don't give much info, but the query above helps diagnose this.
JoshuaFox
changed the title
153799905 GKE Usage Metering Data Studio connector fails on divide-by-zero error
GKE Usage Metering Data Studio connector fails on divide-by-zero error
Apr 12, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Create a DataStudio report following instructions.
With some projects, you get a blank widget that is based on cost_with_unallocated_untracked. See attachment missing data.jpg. This is ultimately because for some values of sku, the SUM(usage.amount) is 0 in the billing-export table. Presumably this is an ordinary occurrence when an SKU is unused, and so this case should be handled.
Minimal reproduction of divide-by-zero error follows. (To run it, replace table and project identifiers). This is a subquery directly from the connector sourcecode and only uses one table, so the problem is not in complex joins, just in the usage of data that can have zero values.
Solution: Handle cases with value 0.
A related issue is at the Google Issue tracker, but apparently here at GitHub is the right place for the elements of this bug that involve the connector.
The text was updated successfully, but these errors were encountered: