docs(miner): document opt-in Prometheus textfile-collector export - #5608
Conversation
Adds scripts/export-miner-prometheus-textfile.sh, wiring the miner's four existing `X metrics` CLI commands into node_exporter's textfile collector pattern (fail-open per family), and documents it in packages/gittensory-miner/docs/observability.md.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5608 +/- ##
=======================================
Coverage 95.00% 95.00%
=======================================
Files 573 573
Lines 45629 45629
Branches 14661 14661
=======================================
Hits 43350 43350
Misses 1528 1528
Partials 751 751
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-13 09:14:03 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 8 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
scripts/export-miner-prometheus-textfile.sh: runs the miner's four existing Prometheus-text-emitting commands (gittensory-miner metrics,queue metrics,ledger metrics,governor metrics) and atomically writes their concatenated output to a.promfile, following the standard node_exporter textfile collector pattern — mirrorsscripts/export-ams-reporting-db.sh's fail-open-per-source philosophy: a broken/corrupt local store for one family never blocks the other three.packages/gittensory-miner/docs/observability.md, alongside a table of all four commands/metric families and a sample crontab line.Why
#4839 asks for "an optional metrics/tracing integration point, documented, off by default" so a self-hoster can opt in and see miner activity in their own Grafana/observability stack. The four
gittensory-miner ... metricscommands already exist (the last two —queue metricsandgovernor metrics— shipped this session in #5603/#5604) but were never documented as a cohesive story, and nothing bridges a one-shot CLI command to something Prometheus can actually scrape. This closes that gap with the smallest correct mechanism: no new HTTP server, no new dependency, entirely opt-in (nothing in the miner package invokes this script itself — AMS's zero-infra "laptop mode" is unaffected if it's never run).Closes #4839
Test plan
sh -n scripts/export-miner-prometheus-textfile.sh(syntax check)npm run docs:drift-checkgit diff --check.tmpthenmv), and confirmed the fail-open path directly — with one of the four subcommands unavailable, the script still wrote a valid file containing the other three families' metrics and exited 0, logging only the one failure to stderrThis PR touches
scripts/**andpackages/gittensory-miner/docs/**only — nosrc/**/packages/*/src/**/packages/gittensory-miner/lib/**changes, so Codecov's patch-coverage gate has nothing to measure here.