Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Cheap Python Uptime Dashboard: Custom Metrics for Internal Admin Status

Short answer: a cheap Python uptime dashboard should use custom metrics to detect missing marketplace results, not treat a green process as proof that scheduled work happened. Record one durable row for each run and render the same facts on the internal admin status page. During a rollback, keep the writer schema backward-compatible so old and new workers can report liveness at the same time.…

To create a cheap Python uptime dashboard that accurately monitors internal admin status, focus on using custom metrics to detect missing marketplace results rather than relying on a green process as proof of successful scheduled work. Maintain a durable record for each run, displaying the same information on the internal admin status page. Ensure backward compatibility during rollbacks by allowing both old and new workers to report liveness simultaneously. This approach carries more weight than dashboard aesthetics.

A simple green /health response confirms that a process can respond, but it doesn't verify that the expected tasks like fetching, parsing, accepting, and publishing data were completed. Instead, prioritize the age of the last successful run producing the expected result, considering whether the current run is active. Custom metrics should include key elements such as scheduled timestamp, start and finish timestamps, outcome, input count, accepted count, rejected count, and reason code.

Define a clear contract before implementing the dashboard to prevent ambiguity in interpreting zero values.

Counters like successful runs should reflect the differences between a quiet supplier, a broken upstream file, accidental filters, or parsers that accepted nothing. Zero can be misleading in this context. Instead, use well-defined reason codes such as completed, empty_expected, empty_unexpected, fetch_failed, parse_failed, and publish_failed to capture critical aspects of each run. Limit the scope of reason codes to prevent confusion with raw exception messages.

Leverage Prometheus's guidance on high-cardinality labels by storing supplier IDs, filenames, trace IDs, and exception text in logs or run records instead of metric labels. Alert when no qualifying run finishes within the scheduled interval plus a grace period. Treat empty_expected runs as qualifying only when an explicit business rule predicts an empty feed.

Suppress alerts for missing results while a run is still active and within its maximum duration, but raise a separate alert for stuck runs afterward. This distinction helps differentiate between lateness and failure.

Implement the underlying data flow before creating visualizations. The scheduler generates run records, workers update these records at various phase boundaries, a metrics collector transforms completed records into low-cardinality time series, and an internal page reads from a summarized endpoint. Alerts query the metrics backend, and the ledger serves as an audit trail when data is aggregated or the process restarts.

Start with a simple in-memory version of the core components, modeling the contract and alert decision logic without directly coupling the worker to a dashboard library. For production use, replace the RunStore with a transactional database and emit measurements through the existing metrics client used by the service.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

A failed SQLite integrity check on Windows that reported itself as a POSIX lock conflict

For several hours on 2026-09-30, every memory write from a Hermes Agent install on a Windows 11 machine failed with this: YantrikDB unavailable: remember failed: refusing to write: another SQLite…

  • YantrikDB version 0.23.1 experienced SQLite integrity check failure on Windows.
  • Failed integrity check reported as POSIX lock conflict, misleading error message.
  • Fixed in version 0.23.2 with new IntegrityCheckFailed error and repair process.

Bengal Download Manager: The Free IDM Alternative for Ubuntu

Bengal Download Manager is a free and open-source download manager for Linux. It is an alternative to IDM (Internet Download Manager) on Windows, and as the name suggests, it is made for fast…

  • Bengal Download Manager is free, open-source download manager for Linux.
  • Compatible with Ubuntu and other Linux distributions.
  • Supports resume, multi-threaded downloads, and proxy servers.

More from Thursday 8 October →