Urgent.News

What's breaking now, across thousands of outlets.

Tech

Cloud Bill Out of Control: Building a Reliable Budget Alert with OpenCost and Prometheus

You get the email on the 3rd of the month: last month's cloud invoice is 40% above forecast. You open the billing console, and it tells you exactly one useful thing — the account spent too much. Which team? Which workload? Which namespace started a nightly job that requests 64 GiB of RAM and never finishes? The billing console has no idea, because it has never heard of your namespaces. This…

Cloud expenses can easily exceed initial estimates if caught only after billing arrives. This article explains how to create a budget alert system using OpenCost and Prometheus that warns of overspending in near real-time. Native cloud budget alerts often arrive too late, operating on account or project level budgets that are evaluated on delayed billing data.

Kubernetes clusters appear as a few EC2 instances and EBS volumes to the provider, so each namespace shares the same bill line. Billing data arrives in batches with 6-24 hour delays, making it impossible to detect runaway deployments that consume budget over several days before triggering.

OpenCost solves this by watching cluster allocation, multiplying it by node and volume costs, and exporting the result as Prometheus metrics. This provides a local, resolution-dependent estimate of allocation costs in seconds. While not as precise as actual invoices, a 5-minute estimate pinpointing a specific namespace beats delayed account-level numbers.

OpenCost exposes important metrics like container CPU and memory allocation, persistent volume consumption, and hourly costs per node and volume. Default pricing uses public on-demand rates, but custom pricing files can improve accuracy.

To deploy OpenCost on OpenShift, first enable user workload monitoring by modifying ConfigMaps, then install OpenCost using Helm. Disable the bundled Prometheus and UI for security. Verify the exporter produces prices, and if needed, supply a custom pricing file. Finally, query the hourly node and volume costs through Thanos to get the cluster's hourly compute burn rate, which can be multiplied by 730 for a monthly run rate.

This budget alert system provides early warning for excessive cloud spending at a per-namespace level.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The Case of the Blank SharePoint Page (and the Guest Who Couldn't See It)

SPFx web part and application customizer not loading for guest or external users, and the Public CDN fix TL;DR: Guests can't read your SPFx bundles from the app catalog, so the page renders blank.

  • Guests using Gmail see blank SharePoint page due to SPFx bundles not loading
  • Error "CannotCreatePersonalSite" is red herring, not root cause
  • Enabling Public CDN with /CLIENTSIDEASSETS origin resolves issue

🚀 Building Spring by Example V2: Completing Module 07 - Spring Batch

When I started learning Spring, I noticed something about many of the tutorials I found. They often showed how to use a feature, but not always why it worked or how the different pieces fitted…

  • Module 07 - Spring Batch completed, covering jobs, steps, readers, processors, writers
  • Introduced concepts like job parameters, chunk-oriented processing, and tasklet processing
  • Emphasized restartability, skip/retry policies, and batch testing techniques

How to find 1688 suppliers and compare wholesale prices (without reading Chinese)

1688.com is the wholesale marketplace that Chinese shops and resellers buy from. Many of the factories you find on Alibaba.com or AliExpress also sell there, often for less, because 1688 is built for…

  • 1688.com is a Chinese wholesale marketplace for factories and resellers.
  • The article offers a guide to find suppliers and compare prices without Chinese skills.
  • Steps include using translation tools and price comparison websites.

More from Sunday 8 November →