obsidianlog query, run on demand. To visualize results in Grafana, the
example in this repo bridges the two with the free
Infinity datasource plugin,
which reads JSON from a URL.
This is an example, not a shipped product. A dedicated Grafana datasource
plugin is a possible future direction, not something ObsidianLog ships
today.
How it works
Infinity reads from a URL, not a local file or a command, so a small script exports a query to JSON and serves it over HTTP:examples/integrations/grafana/export-and-serve.sh
in the repo.
Setting it up
- Install the Infinity plugin:
grafana-cli plugins install yesoreyeram-infinity-datasource, or via Grafana’s in-app plugin catalog. - Register the datasource: apply
datasource.yamlvia Grafana’s provisioning mechanism, or add it manually through the UI. - Run the export script (leave it running):
- Import
dashboard.jsonthrough Dashboards → Import, selecting your Infinity datasource when prompted.
msg/message field, nested
under raw in the query output). See obsidianlog query for
the full field shape.
Keeping it fresh
The export script is one-shot: it snapshots the current query results once. For continuous refresh, wrap it inwatch -n 60 ./export-and-serve.sh, a
cron job, or a systemd timer. These are deliberately not included, to keep
this an example rather than infrastructure to maintain.