Skip to content

Add hotcell_start_time_seconds and deprecate hotcell_uptime_seconds - #114

Merged
flavorjones merged 3 commits into
masterfrom
card-665-start-time-metric
Oct 10, 2026
Merged

flavorjones merged 3 commits into
masterfrom
card-665-start-time-metric

Conversation

@flavorjones

@flavorjones flavorjones commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Motivation

yabeda-hotcell exports hotcell_uptime_seconds, the seconds since a cell's supervisor booted. The supervisor reports this as uptime_s in its metrics answer, and the value changes at every scrape.

The Prometheus guidance is to export the time a process started instead. That value stays constant until the cell restarts, so a restart shows as a step, and time() - hotcell_start_time_seconds gives the uptime.

The gem can't derive a constant start time from uptime_s. The supervisor measures uptime on a monotonic clock and rounds it to whole seconds, so "now minus uptime" would move by up to a second between scrapes. The cell has to report its start time.

Part of #112.

Details

  • The supervisor's metrics answer now includes start_time_s, the wall-clock time when the supervisor booted, in seconds since the Unix epoch.
  • yabeda-hotcell exports it as the start_time_seconds gauge. A cell from an earlier release sends no start_time_s, and the gem leaves the gauge unset for that cell.
  • uptime_seconds is now deprecated and will be removed in a future version. The CHANGELOG's Upgrading section tells users to switch their dashboards and alerts to time() - hotcell_start_time_seconds.

`yabeda-hotcell` exported each cell's uptime, a value that changes at
every scrape. The Prometheus guidance is to export a start time
instead, and to compute the uptime as `time() - start_time`. Report the
supervisor's boot time from `metrics` as `start_time_s`, export it as
`start_time_seconds`, and deprecate `uptime_seconds`.

A cell from an earlier release reports no start time, so the gem sets
no `start_time_seconds` for it.

ref: #112
Copilot AI balanced review requested due to automatic review settings October 10, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@flavorjones
flavorjones merged commit ce6899b into master Oct 10, 2026
33 checks passed
@flavorjones
flavorjones deleted the card-665-start-time-metric branch October 10, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants