Skip to content

feat(prometheus-ghc-stats): add GHC RTS stats exporter package#63

Merged
wraithm merged 1 commit into
masterfrom
init-prom-ghc-stats
Jun 30, 2026
Merged

feat(prometheus-ghc-stats): add GHC RTS stats exporter package#63
wraithm merged 1 commit into
masterfrom
init-prom-ghc-stats

Conversation

@wraithm

@wraithm wraithm commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • 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.
  • Adds a cabal.project (the repo had none) so cabal sees both packages, and adds dist-newstyle/ to .gitignore.

Test Plan

  • No manual steps beyond CI. (CI builds prometheus-ghc-stats via cabal on GHC 9.10/9.12 and via the 9.10 stack resolver; prometheus's existing matrix is unchanged.)

🤖 Generated with Claude Code

@wraithm wraithm force-pushed the init-prom-ghc-stats branch 2 times, most recently from 96d2de3 to 6602332 Compare June 29, 2026 21:49

@cdepillabout cdepillabout left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
@wraithm wraithm force-pushed the init-prom-ghc-stats branch from 6602332 to 24b1028 Compare June 30, 2026 15:52
@wraithm wraithm merged commit 5e475b5 into master Jun 30, 2026
17 checks passed
@wraithm wraithm deleted the init-prom-ghc-stats branch June 30, 2026 16:50
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