Repository navigation
Add hotcell_start_time_seconds and deprecate hotcell_uptime_seconds - #114
Merged
Merged
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
yabeda-hotcellexportshotcell_uptime_seconds, the seconds since a cell's supervisor booted. The supervisor reports this asuptime_sin itsmetricsanswer, 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_secondsgives 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
metricsanswer now includesstart_time_s, the wall-clock time when the supervisor booted, in seconds since the Unix epoch.yabeda-hotcellexports it as thestart_time_secondsgauge. A cell from an earlier release sends nostart_time_s, and the gem leaves the gauge unset for that cell.uptime_secondsis now deprecated and will be removed in a future version. The CHANGELOG's Upgrading section tells users to switch their dashboards and alerts totime() - hotcell_start_time_seconds.