marmotdata/grafana
Discover dashboards, panels and data sources from Grafana
The Grafana plugin discovers dashboards, their panels and the configured data sources from a Grafana instance. Panels backed by a SQL data source are linked to the tables their queries read.
Assets
| Asset | Name | Notes |
|---|---|---|
| Dashboard | <folder>/<title>, or <title> in the General folder |
Description, tags, version, time range and refresh interval from Grafana |
| Chart | <dashboard name>/<panel title> |
One per panel; untitled panels are panel-<id>. Rows are flattened, text panels skipped. SQL, PromQL and LogQL queries are recorded on the chart |
| DataSource | The data source name | Type, address and database. Credentials are never read |
Lineage
- Dashboard CONTAINS Chart
- DataSource FEEDS Chart, for every data source a panel or one of its queries uses
- Table FEEDS Chart and Table FEEDS Dashboard, for panels querying a PostgreSQL, MySQL, SQL Server or ClickHouse data source. Tables are named the way the native Marmot plugin for that database names them, so the edges land on assets discovered by those plugins. Template variables and Grafana macros in a query never produce an edge.
Authentication
Create a service account in Grafana (Administration, Service accounts) and add a token to it. Tokens start with glsa_.
The Viewer role is enough: it reads dashboards, library panels and the data source list (names and addresses, never credentials). Should a token not be allowed to list data sources, the run still completes; charts then record the data source type and uid from the dashboard and no DataSource assets are created.
Configuration
host: "https://grafana.company.com"
api_key: "glsa_..."
include_panels: true
include_datasources: true
discover_lineage: true
page_size: 100
verify_ssl: true
Naming
Table MRNs follow the owning plugin's naming, for example mrn://asset/table/postgresql/shop.public.orders for PostgreSQL, and carry the data source's host and port as a hint so Marmot picks the zone that owns that server. Set zone when you catalogue more than one Grafana; it becomes part of the MRN of every Grafana asset.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick Grafana from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
hostText RequiredGrafana URL, for example https://grafana.company.com
api_keySecret RequiredToken of a Grafana service account
verify_sslYes or noVerify the TLS certificate of the Grafana host
include_panelsYes or noDiscover dashboard panels as Chart assets
include_datasourcesYes or noDiscover data sources as DataSource assets
discover_lineageYes or noLink charts and dashboards to the tables their SQL queries read
page_sizeNumberDashboards per search request
Assets emitted
Metadata this plugin attaches to each discovered asset.
Dashboard
The metadata fields the Grafana plugin emits for Dashboard assets.
Chart
The metadata fields emitted for Chart assets, one per dashboard panel.
Datasource
The metadata fields emitted for DataSource assets. Credentials are never read.