Context
grafana/provisioning/datasources/ already wires up scrape-free datasources for ORB's local usage data (e.g. the codex-usage.json-style entry using the frser-sqlite-datasource plugin), but nothing there points at AMS's own local SQLite files. AMS maintains an append-only attempt-log SQLite file and a prediction-ledger SQLite file under packages/gittensory-miner, and neither is exposed to Grafana today. This issue is pure config wiring — it is explicitly distinct from #4838 (wiring the Prometheus renderer into a command) and #4839 (giving AMS its own metrics/tracing surface), neither of which is scoped to author Grafana provisioning YAML.
Dependencies
None — independently shippable. Per the candidate spec, this unblocks a follow-on AMS usage dashboard without needing #4838's or #4839's live metrics/tracing surface to land first. Note: the sibling dashboard issue in this same batch ("Add a Grafana dashboard for coding-agent-driver usage, cost, and attempt outcomes") depends on this issue landing first, since its panels query this datasource.
Requirements
- Add new datasource provisioning entry/entries under
grafana/provisioning/datasources/ using the frser-sqlite-datasource plugin, mirroring the existing scrape-free pattern already used for ORB's usage datasources (e.g. codex-usage.json).
- Point the new datasource(s) at AMS's local append-only attempt-log SQLite file and its prediction-ledger SQLite file (both under
packages/gittensory-miner's local ledger storage).
- This issue is read-only datasource wiring only — do not author any dashboard panels or queries in this PR; that is explicitly out of scope and belongs to the follow-on dashboard issue.
- Do not modify any existing ORB datasource provisioning files (e.g.
codex-usage.json) — this change must be purely additive.
- Follow the naming/UID conventions already used by sibling datasource files so Grafana provisioning does not collide with existing entries.
- Document how an operator points the datasource's file path at their actual local ledger file location, since the absolute path varies per install (add this to existing self-host/observability docs if such a doc exists, otherwise as inline comments in the provisioning file).
Deliverables / Acceptance Criteria
Test Coverage Requirements
This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. The datasource provisioning files themselves are YAML/JSON config under grafana/provisioning/, not src/**, so Codecov's gate does not directly instrument them — but any config-loading or path-resolution helper this issue adds under src/** must still hit the 99%+ bar, covering both the path-exists and path-missing branches. Add: (1) unit tests for any new path-resolution/config-generation logic covering both the success path (ledger file found) and failure path (ledger file missing or unreadable), (2) an invariant test asserting the new datasource config is read-only and never grants write access to the underlying SQLite files, and (3) no regression test applies since this is new functionality, not a bug fix.
Expected Outcome
An operator running Grafana alongside AMS can see the miner's attempt-log and prediction-ledger data as first-class Grafana datasources, which the follow-on usage dashboard can then query directly — without needing AMS's full metrics/tracing surface to exist first.
Links & Resources
Context
grafana/provisioning/datasources/already wires up scrape-free datasources for ORB's local usage data (e.g. thecodex-usage.json-style entry using thefrser-sqlite-datasourceplugin), but nothing there points at AMS's own local SQLite files. AMS maintains an append-only attempt-log SQLite file and a prediction-ledger SQLite file underpackages/gittensory-miner, and neither is exposed to Grafana today. This issue is pure config wiring — it is explicitly distinct from #4838 (wiring the Prometheus renderer into a command) and #4839 (giving AMS its own metrics/tracing surface), neither of which is scoped to author Grafana provisioning YAML.Dependencies
None — independently shippable. Per the candidate spec, this unblocks a follow-on AMS usage dashboard without needing #4838's or #4839's live metrics/tracing surface to land first. Note: the sibling dashboard issue in this same batch ("Add a Grafana dashboard for coding-agent-driver usage, cost, and attempt outcomes") depends on this issue landing first, since its panels query this datasource.
Requirements
grafana/provisioning/datasources/using thefrser-sqlite-datasourceplugin, mirroring the existing scrape-free pattern already used for ORB's usage datasources (e.g.codex-usage.json).packages/gittensory-miner's local ledger storage).codex-usage.json) — this change must be purely additive.Deliverables / Acceptance Criteria
grafana/provisioning/datasources/for the attempt-log SQLite filegrafana/provisioning/datasources/for the prediction-ledger SQLite filefrser-sqlite-datasourceplugin and mirror the existing scrape-free patternTest Coverage Requirements
This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. The datasource provisioning files themselves are YAML/JSON config under
grafana/provisioning/, notsrc/**, so Codecov's gate does not directly instrument them — but any config-loading or path-resolution helper this issue adds undersrc/**must still hit the 99%+ bar, covering both the path-exists and path-missing branches. Add: (1) unit tests for any new path-resolution/config-generation logic covering both the success path (ledger file found) and failure path (ledger file missing or unreadable), (2) an invariant test asserting the new datasource config is read-only and never grants write access to the underlying SQLite files, and (3) no regression test applies since this is new functionality, not a bug fix.Expected Outcome
An operator running Grafana alongside AMS can see the miner's attempt-log and prediction-ledger data as first-class Grafana datasources, which the follow-on usage dashboard can then query directly — without needing AMS's full metrics/tracing surface to exist first.
Links & Resources
grafana/provisioning/datasources/(e.g.codex-usage.json)packages/gittensory-miner