Urgent.News

What's breaking now, across thousands of outlets.

Tech

My Cost Monitor Said $234 When the Real Bill Was $48. Then set -e Made It Go Silent for a Week.

A monitoring script that dies quietly is worse than no monitoring at all. Mine proved it twice: first it reported a 7-day spend of $234 when ccusage daily said the real number was $48 (a 4–6x overcount from double-summing cumulative log lines, now down to a 2.3% source-to-source gap), and then, after I "hardened" it with set -euo pipefail , a single ccusage timeout made the whole thing exit 1 and…

A monitoring script that fails quietly is worse than having no monitoring at all. The user experienced this firsthand twice: first, the script reported a spend of $234 when the actual cost was $48, an overcount of 4-6 times due to double-summing cumulative log lines. Then, after hardening the script with set -euo pipefail, a timeout in ccusage caused the entire system to exit with an error message, leaving the status bar blank for a week during two 5-hour periods when critical thresholds were crossed without the user noticing.

The fix in both cases was to adopt a fail-open design, printing "⚫ n/a" and exiting with a status of 0. This post walks through the 212-line script that manages the user's cost monitoring and the underlying design principle: preventing the dashboard from becoming silent. The script runs every 30 minutes, rendering its output into the user's status bar and terminal dashboard.

If the monitoring script fails, the entire dashboard will also fail, rendering it useless. The user's solution is to design the script to fail-open, displaying "⚫ n/a" in case of errors, rather than going silent. This ensures that the user can quickly identify issues and prevent damage to their environment.

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

[Python/JS/C#] Block Language 2.2.0: Run Polyglot Workflows in One Document

I got tired of writing small glue programs around otherwise simple workflows. Python was the right tool for data preparation. JavaScript was the right tool for formatting and application logic.

  • Block Language 2.2.0 enables polyglot workflows in one document
  • Orchestrator written in C# runs each stage through local runtime
  • Supports Python, JavaScript, HTML, and other native language blocks

Why Israel's outsized influence on global tech is worrying

Why Israel's outsized influence on global tech is worrying newspress_en Sat, 08/22/2026 - 05:38 Science & Technology When Israeli Prime Minister Benjamin Netanyahu declared that anyone carrying a…

  • Israel wields outsized influence over global tech industry.
  • Apple's iPhone 17e features Israeli-developed technologies.
  • Concerns arise over Israel's growing tech dominance and national security implications.

Kenya’s next unicorn: Which startup could be worth $1bn?

According to Africa: The Big Deal, Kenyan startups raised about Sh126 billion, outperforming Egypt, South Africa and Nigeria.

  • Kenya is a leading African hub for startups in fintech, agritech, and renewable energy.
  • No Kenyan startup has reached $1 billion valuation, the unicorn benchmark.
  • Fintech and climate tech sectors show potential for future unicorns.

More from Saturday 22 August →