Repository navigation
costerra v0.4.0
·
3 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
--billing-history(breakdownanddiff): a chart of the actual billing
of the resources of the code (the stack only, not the rest of the GCP
projects), week by week over the last 3 months (13
weeks, the current one in progress), net of credits. In the terminal, a
colored bar chart stacked by the 5 most expensive services (the others
grouped), with value labels, the weekly equivalent of the estimate as a
dashed line, a legend with each service's total and share, and a summary:
total, weekly average, last full week vs the week before, last 4 weeks vs
the 4 before, and how far the estimate is from the last full week. In
Markdown, a Mermaid bar chart (rendered by GitHub and GitLab) and the weeks
per service; in JSON, abilling_historykey. Off unless asked for
(COSTERRA_BILLING_HISTORY=1also turns it on).- The data comes from the detailed usage cost export of Cloud Billing to
BigQuery, which names the resource of each cost: costs are kept when their
resource is one of the code (by name, by the instance name prefix of
managed instance groups, by the GKE cluster label of the nodes). The chart
says how many resources of the code were found in the billing and lists
the ones without cost. The
gcp_billing_export_resource_v1_<billing account>table is discovered, even in a
separate billing project: Cloud Asset Inventory search over the
organization of the projects, then the datasets of the projects visible in
BigQuery (billing-like names first). It can also be set with
--billing-export-table(COSTERRA_BILLING_EXPORT_TABLE,
billing_export_table:incosterra.yml). The table found is remembered
for 7 days, a fruitless search for 6 hours. Needs BigQuery Data Viewer on the export dataset and
BigQuery Job User on the project the query runs in. The result is cached
for an hour; when the billing cannot be read, a warning says why and the
report is unchanged.