assay.grafana
Grafana monitoring and dashboards. Health, datasources, annotations, alerts, folders. Client:
grafana.client(url, {api_key="..."}) or {username="...", password="..."}.
c:health()→{database, version, commit}— Check Grafana server healthc:datasources()→[{id, name, type, url}]— List all datasourcesc:datasource(id_or_uid)→{id, name, type, ...}— Get datasource by numeric ID or string UIDc:search(opts?)→[{id, title, type}]— Search dashboards/folders.opts:{query, type, tag, limit}c:dashboard(uid)→{dashboard, meta}— Get dashboard by UIDc:annotations(opts?)→[{id, text, time}]— List annotations.opts:{from, to, dashboard_id, limit, tags}c:create_annotation(annotation)→{id}— Create annotation.annotation:{text, dashboardId?, tags?}c:org()→{id, name}— Get current organizationc:alert_rules()→[{uid, title}]— List provisioned alert rulesc:folders()→[{id, uid, title}]— List all folders
Example:
local grafana = require("assay.grafana")
local c = grafana.client("http://grafana:3000", {api_key = "glsa_..."})
local h = c:health()
assert.eq(h.database, "ok")