Skip to content

feat(observability): provision Grafana datasources for AMS local SQLite ledgers - #5397

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-ams-grafana-datasource
Jul 12, 2026
Merged

feat(observability): provision Grafana datasources for AMS local SQLite ledgers#5397
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-ams-grafana-datasource

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Adds grafana/provisioning/datasources/ams-ledgers.yml wiring two scrape-free frser-sqlite-datasource entries at the miner's append-only attempt-log and prediction-ledger SQLite files (#5184), so a follow-on AMS usage dashboard can query them — mirroring the maintainer GittensoryDB entry in sqlite.yml.

Scope (matches the issue exactly)

  • Purely additive — a new file; no existing datasource (loki/prometheus/sqlite/tempo) is modified.
  • Read-onlyeditable: false, access: proxy; documented :ro mount so Grafana can never write the live ledgers.
  • No dashboards/queries authored (explicitly out of scope — that's the follow-on dashboard issue).
  • Fresh UIDs (ams-attempt-log, ams-prediction-ledger) — no collision with existing datasources.
  • Per-install path documented — the absolute ledger path varies, so path: is a placeholder with inline instructions to mount GITTENSORY_MINER_CONFIG_DIR at /ams-ledgers:ro.

Validation

  • test/unit/ams-ledgers-datasource.test.ts (3 tests): the two datasources point at the attempt-log + prediction-ledger files and are frser-sqlite-datasource; the read-only invariant holds (editable: false, access: proxy, no write-enabling knob); and the UIDs are fresh with every existing datasource left untouched (additive).
  • YAML parses; tsc typecheck clean; prettier-clean; no secrets. Config only — no src/** logic, no runtime touched.

Closes #5184

…te ledgers

Add grafana/provisioning/datasources/ams-ledgers.yml wiring two scrape-free
frser-sqlite-datasource entries at the miner's append-only attempt-log and prediction-ledger
SQLite files (JSONbored#5184), so a follow-on AMS usage dashboard can query them read-only — mirroring
the maintainer GittensoryDB entry in sqlite.yml. Purely additive: no existing datasource file
is touched, fresh UIDs (ams-attempt-log / ams-prediction-ledger), no dashboards/queries
authored (out of scope). The per-install path is a documented placeholder — operators mount
their GITTENSORY_MINER_CONFIG_DIR into Grafana at /ams-ledgers:ro, so the read-only query
plugin can never write the live ledgers.

Closes JSONbored#5184
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 12, 2026 16:21
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.40%. Comparing base (91b235d) to head (dfa9361).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5397      +/-   ##
==========================================
- Coverage   94.44%   94.40%   -0.04%     
==========================================
  Files         552      552              
  Lines       44291    44291              
  Branches    14657    14657              
==========================================
- Hits        41832    41815      -17     
- Misses       1784     1801      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.89% <ø> (-0.27%) ⬇️
shard-2 34.16% <ø> (-0.47%) ⬇️
shard-3 32.16% <ø> (+0.17%) ⬆️
shard-4 31.30% <ø> (+0.09%) ⬆️
shard-5 32.87% <ø> (-0.41%) ⬇️
shard-6 43.92% <ø> (+0.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 16:27:13 UTC

2 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a purely additive Grafana provisioning YAML for two read-only frser-sqlite-datasource entries pointing at the miner's attempt-log and prediction-ledger SQLite files, plus a small unit test suite verifying the read-only invariant, fresh UIDs, and that existing datasources are untouched. The scope matches the linked issue #5184 closely (datasource provisioning only, no dashboards/queries), the file mirrors the existing sqlite.yml convention, and the referenced runbook confirms the attempt-log.sqlite3 and prediction-ledger.sqlite3 filenames are real. The change is config-only with no src/** logic touched, and all CI checks passed.

Nits — 5 non-blocking
  • The path: values are hardcoded placeholders (/ams-ledgers/attempt-log.sqlite3) requiring a documented but easy-to-miss manual volume mount — a misconfigured mount will silently produce a Grafana datasource health-check failure rather than a build-time error, worth calling out more prominently in the PR description for reviewers/operators.
  • The test's regex check for write-enabling knobs (JSON.stringify(ds)).not.toMatch(/write|allowUpdate|readonly"?:\s*false/i) is a coarse heuristic that only proves the current YAML's literal text doesn't contain those substrings, not that the plugin config is actually incapable of writes — fine as a lightweight guard but shouldn't be read as strong security coverage.
  • Consider adding a brief comment or README pointer noting this new file follows the same mirrored pattern as sqlite.yml's GittensoryDB entry, for future maintainers who add a third ledger datasource.
  • grafana/provisioning/datasources/ams-ledgers.yml: consider referencing the operations-runbook.md table (which lists all ledger files) directly in the header comment so future ledger additions know to update both places.
  • test/unit/ams-ledgers-datasource.test.ts: the write-knob regex nit above could be tightened by asserting equality against a known-good jsonData key set rather than substring matching.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5184
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 119 registered-repo PR(s), 87 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 119 PR(s), 1 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: minor — The change is a small, well-scoped, purely additive observability config file that directly closes issue #5184 with no dashboard logic, so it moves the codebase forward incrementally but modestly.
Linked issue satisfaction

Addressed
The PR adds grafana/provisioning/datasources/ams-ledgers.yml with two frser-sqlite-datasource entries for the attempt-log and prediction-ledger SQLite files, mirroring the existing scrape-free pattern, is purely additive with fresh UIDs, includes no dashboards/queries, and documents per-install path configuration via comments plus a mount example.

Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 119 PR(s), 1 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot 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.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 91b12a6 into JSONbored:main Jul 12, 2026
15 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 12, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provision a Grafana datasource for AMS's local SQLite ledgers (attempt log + prediction ledger)

2 participants