Depends on: "Expose Prometheus /metrics on a separate port".
Beyond HTTP and runtime stats, a fewdomain metricswould make the dashboard useful for the game itself. Below are suggestions; pick and adjust. Prefix everything withmusicserver_.
Suggested metrics
Metric | Type | Where to update
-- | -- | --
musicserver_songs_played_total{mode} | Counter | backend.SetPlayed / AddLatestPlayed; mode = random, low, classic, next... (keep it to a small fixed set)
musicserver_songs_requested_total{mode} | Counter | GetRandomSong, GetRandomSongLowChance, GetRandomSongClassic, GetNextSong
musicserver_library_soundtracks | Gauge | Set at the end of syncSoundtracks(full)
musicserver_library_songs | Gauge | Same as above
musicserver_sync_duration_seconds{type} | Histogram | Wrap syncSoundtracks; type = full / changes
musicserver_sync_last_success_timestamp_seconds | Gauge | SetToCurrentTime() after a successful sync
musicserver_broken_songs | Gauge | Count in checkBrokenSongs
musicserver_db_pool_* | Collector | Register a collector over pgxpool.Pool.Stat() (acquired/idle/total conns, acquire wait time); github.com/IBM/pgxpoolprometheus does this out of the box
Never use song titles, IDs, tokens or IPs as label values, because each unique value creates a new time series. Put that detail inlogsinstead; Loki already collects them.
Counters only go up (use_total). Gauges hold a current value.
Acceptance criteria
not doneThe chosen metrics appear on/metricswith HELP text
not donePanels added to the GrafanaMusicServerdashboard (songs played/hour, library size, last sync age)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
Depends on: "Expose Prometheus /metrics on a separate port".
Beyond HTTP and runtime stats, a few domain metrics would make the dashboard useful for the game itself. Below are suggestions; pick and adjust. Prefix everything with
musicserver_.Suggested metrics
Example:
Name: "musicserver_library_songs",
Help: "Number of songs in the library after the last sync.",
})" class="epitaxy-diff epitaxy-fence rounded-lg overflow-clip" style="box-sizing: border-box; border: 0px solid color(srgb 1 1 1 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(85, 152, 231); scrollbar-width: thin; app-region: initial; border-radius: 8px; overflow: clip; --diffs-font-size: calc(.75rem * 1); --diffs-line-height: calc(1.0625rem * 1); --diffs-font-family: "anthropic-mono", ui-monospace, monospace, "SF Mono", ui-monospace, Menlo, Consolas, monospace; --diffs-header-font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif; --diffs-addition-color-override: #32d74b; --diffs-deletion-color-override: #ff2c56; --diffs-modified-color-override: #6da7ec; --diffs-gap-inline: calc(.5rem * 1); --diffs-gap-block: calc(.25rem * 1); position: relative;">
Rules of thumb
_total). Gauges hold a current value.Acceptance criteria
/metricswith HELP text