feat(prometheus-ghc-stats): add GHC RTS stats exporter package#63
Merged
Conversation
96d2de3 to
6602332
Compare
cdepillabout
approved these changes
Jun 30, 2026
cdepillabout
left a comment
Contributor
There was a problem hiding this comment.
This LGTM, except that CI is failing
Add a new prometheus-ghc-stats package alongside the prometheus library. It exposes registerGHCStats, which registers a metric handle per GHC.Stats RTSStats field and returns an IO updater to refresh them on each scrape. The package is GHC2024 and uses RTSStats fields that only exist on newer compilers, so it requires GHC >= 9.10. The prometheus library keeps its full 8.10 - 9.12 matrix; a separate cabal CI job builds prometheus-ghc-stats on 9.10 and 9.12, and the 9.10 stack resolver lists both packages. prometheus-ghc-stats carries its own cabal.project so it builds against the in-tree prometheus without being pulled into the repo-root build, which would otherwise force the wider prometheus GHC matrix to solve a package it cannot build. dist-newstyle/ is added to .gitignore. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6602332 to
24b1028
Compare
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.
Summary
prometheus-ghc-statspackage alongside theprometheuslibrary. It exposesregisterGHCStats, which registers a metric handle perGHC.StatsRTSStatsfield and returns anIOupdater to refresh them on each scrape.GHC2024and usesRTSStatsfields that only exist on newer compilers, so it requires GHC >= 9.10. Theprometheuslibrary keeps its full 8.10–9.12 matrix; a separate cabal CI job buildsprometheus-ghc-statson 9.10 and 9.12, and the 9.10 stack resolver lists both packages.cabal.project(the repo had none) so cabal sees both packages, and addsdist-newstyle/to.gitignore.Test Plan
prometheus-ghc-statsvia cabal on GHC 9.10/9.12 and via the 9.10 stack resolver;prometheus's existing matrix is unchanged.)🤖 Generated with Claude Code