Grafana
Official · maintained by Marmotmarmotdata/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
In the UI
Point-and-click, no config file needed.
- 1 Open Runs Create pipeline
- 2 Pick Grafana from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-grafana-pipeline
runs:
- grafana:
host: "<host>"
api_key: "***"$ marmot ingest -c ingest.yamlNot using plugins? Other ways to populate Marmot
Configuration
10 top-level fields. * marks required fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
host string Grafana URL, for example https://grafana.company.com
api_key password Token of a Grafana service account
verify_ssl bool Verify the TLS certificate of the Grafana host
- default
- true
include_panels bool Discover dashboard panels as Chart assets
- default
- true
include_datasources bool Discover data sources as DataSource assets
- default
- true
discover_lineage bool Link charts and dashboards to the tables their SQL queries read
- default
- true
page_size int Dashboards per search request
- default
- 100
Assets emitted
Metadata this plugin attaches to each discovered asset.
Dashboard
GrafanaDashboardFieldsThe metadata fields the Grafana plugin emits for Dashboard assets.
uid stringDashboard uid
id intDashboard numeric id
url stringDashboard URL in Grafana
folder stringTitle of the folder holding the dashboard
folder_uid stringUid of the folder holding the dashboard
tags string[]Tags set on the dashboard in Grafana
version intDashboard version number
schema_version intDashboard JSON schema version
created stringWhen the dashboard was created
updated stringWhen the dashboard was last saved
created_by stringUser who created the dashboard
updated_by stringUser who last saved the dashboard
provisioned boolWhether the dashboard is managed by provisioning
refresh stringAuto refresh interval
time_from stringStart of the default time range
time_to stringEnd of the default time range
panel_count intNumber of panels, not counting rows and text panels
Chart
GrafanaChartFieldsThe metadata fields emitted for Chart assets, one per dashboard panel.
panel_id intPanel id within the dashboard
panel_type stringGrafana panel type, for example timeseries
chart_type stringNormalised chart type (Line, Table, Bar, ...)
dashboard stringTitle of the dashboard holding the panel
dashboard_uid stringUid of the dashboard holding the panel
datasource stringName of the data source the panel queries
datasource_type stringType of the data source the panel queries
datasource_uid stringUid of the data source the panel queries
url stringURL of the panel in Grafana
target_count intNumber of queries the panel runs
Datasource
GrafanaDatasourceFieldsThe metadata fields emitted for DataSource assets. Credentials are never read.
uid stringData source uid
id intData source numeric id
type stringData source plugin type, for example grafana-postgresql-datasource
type_name stringData source plugin display name
url stringAddress the data source connects to
database stringDatabase the data source connects to
is_default boolWhether this is the default data source
read_only boolWhether the data source is read-only in Grafana
access stringAccess mode (proxy or direct)