Skip to main content

cost-optimizer

Recommend Databricks cost-optimization actions for the FinOps/platform team — commitment/discount coverage, budget variance, and forecast-vs-actual DBU spend from system.billing.usage and system.billing.list_prices.

Ir para a instalação

Informações da origem

Repositório
databricks-solutions/ai-governance
Última atividade na origem
2 de setembro de 2026 às 16:08
Idioma detectado do SKILL.md
inglês
Estrelas
2
Forks
2

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Explorador de arquivos
2 arquivos

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
cost-optimizer
description
Recommend Databricks cost-optimization actions for the FinOps/platform team — commitment/discount coverage, budget variance, and forecast-vs-actual DBU spend from system.billing.usage and system.billing.list_prices.
> **Illustrative example** — demonstrates a well-formed `SKILL.md` for this reference > implementation. Adapt the content to your own org; do not deploy verbatim. # cost-optimizer ## Overview Turns Databricks billing data into finance-facing optimization actions: it measures commitment/discount coverage, compares actual spend against budget, and forecasts month-end DBU cost so the FinOps/platform team can act before overruns land. Distinct from `pipeline-cost-analyzer` (which is engineering-facing job/SKU analysis) — this skill is scoped to budget governance and dollarized recommendations. ## When to use this skill When a finance user asks about budget adherence, discount coverage, or spend forecasting: - "Are we on track against this month's Databricks budget?" - "What share of our DBUs are covered by our committed-use discount?" - "Project our month-end spend at the current run rate." - "Where is spend running over budget by product?" ## Instructions 1. **Establish the budget baseline** — ask for the monthly budget if not supplied; otherwise compare against the trailing 3-month average as an implicit baseline. 2. **Dollarize usage** — join `system.billing.usage` to `system.billing.list_prices` to convert DBUs to cost; never present raw DBUs alone to a finance audience. 3. **Assess coverage and variance** — compute committed-discount coverage and budget variance. 4. **Forecast** — extrapolate month-to-date run rate to a month-end projection. 5. **Recommend** — give 2–3 dollar-quantified actions, ordered by savings impact. ## Examples ### Month-end spend forecast at current run rate ```sql WITH mtd AS ( SELECT SUM(u.usage_quantity * p.pricing.default) AS cost_to_date, DAY(CURRENT_DATE()) AS days_elapsed, DAY(LAST_DAY(CURRENT_DATE())) AS days_in_month FROM system.billing.usage u JOIN system.billing.list_prices p ON u.sku_name = p.sku_name WHERE u.usage_date >= DATE_TRUNC('month', CURRENT_DATE()) ) SELECT cost_to_date, ROUND(cost_to_date / days_elapsed * days_in_month, 2) AS projected_month_end FROM mtd ``` ### Spend by product vs. trailing average (budget-variance signal) ```sql SELECT billing_origin_product, SUM(usage_quantity) AS dbus_this_month FROM system.billing.usage WHERE usage_date >= DATE_TRUNC('month', CURRENT_DATE()) GROUP BY 1 ORDER BY dbus_this_month DESC ``` ## Recommendations framework Every response ends with dollar-quantified actions: 1. **Biggest variance** — the product/workspace most over baseline, with an estimated monthly-dollar impact and one corrective action. 2. **Coverage gap** — uncommitted spend that a committed-use discount would cover, with the estimated discount saving. 3. **Quick win** — one action realizable this billing cycle (e.g. move a recurring batch job off all-purpose compute). ## Edge cases - **Missing budget** — if no budget is provided, state the baseline you used (trailing 3-month average) so the variance is interpretable. - **Early in the month** — a run-rate forecast on <5 elapsed days is noisy; flag the low confidence rather than presenting a point estimate as firm. - **Price coverage** — if a `sku_name` has no row in `list_prices`, report it as unpriced rather than silently dropping its usage from the cost total. ## Data scope - `system.billing.usage` — DBU consumption events per workspace/SKU/job/cluster - `system.billing.list_prices` — list prices per SKU (for dollarization) - No PII or sensitive customer data is accessed.
Ver no GitHub