Skip to main content
Version: Preview

Grafana

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Grafana plugin discovers dashboards, their panels and the configured data sources from a Grafana instance. Every dashboard becomes a Dashboard asset named by its folder and title (Sales/Orders overview), every panel a Chart named by its dashboard and panel title, and every data source a DataSource asset. Rows are flattened, text panels are skipped and library panels are resolved to the shared panel they stand for.

A chart records the query it runs when all of its targets speak one language: SQL for SQL data sources, PromQL for Prometheus and LogQL for Loki.

Lineage

Dashboards contain their charts, and each data source feeds the charts that query it. Panels backed by a PostgreSQL, MySQL, SQL Server or ClickHouse data source are also linked to the tables their SQL reads, named the way the native Marmot plugin for that database names them, so the edges land on the assets those plugins discover. Template variables and Grafana macros in a query never produce an edge.

Authentication

Create a service account in Grafana (Administration, Service accounts) with the Viewer role and add a token to it. Tokens start with glsa_. Data source credentials are never read.

Example Configuration


host: "https://grafana.company.com"
api_key: "glsa_..."
include_panels: true
include_datasources: true
discover_lineage: true
page_size: 100
verify_ssl: true
tags:
- "grafana"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
api_keystringtrueToken of a Grafana service account
discover_lineageboolfalseLink charts and dashboards to the tables their SQL queries read
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
hoststringtrueGrafana URL, for example https://grafana.company.com
include_datasourcesboolfalseDiscover data sources as DataSource assets
include_panelsboolfalseDiscover dashboard panels as Chart assets
page_sizeintfalseDashboards per search request
tagsTagsConfigfalseTags to apply to discovered assets
verify_sslboolfalseVerify the TLS certificate of the Grafana host

Available Metadata

The following metadata fields are available:

FieldTypeDescription
accessstringAccess mode (proxy or direct)
chart_typestringNormalised chart type (Line, Table, Bar, ...)
createdstringWhen the dashboard was created
created_bystringUser who created the dashboard
dashboardstringTitle of the dashboard holding the panel
dashboard_uidstringUid of the dashboard holding the panel
databasestringDatabase the data source connects to
datasourcestringName of the data source the panel queries
datasource_typestringType of the data source the panel queries
datasource_uidstringUid of the data source the panel queries
folderstringTitle of the folder holding the dashboard
folder_uidstringUid of the folder holding the dashboard
idint64Dashboard or data source numeric id
is_defaultboolWhether this is the default data source
panel_countintNumber of panels, not counting rows and text panels
panel_idint64Panel id within the dashboard
panel_typestringGrafana panel type, for example timeseries
provisionedboolWhether the dashboard is managed by provisioning
read_onlyboolWhether the data source is read-only in Grafana
refreshstringAuto refresh interval
schema_versionintDashboard JSON schema version
tags[]stringTags set on the dashboard in Grafana
target_countintNumber of queries the panel runs
time_fromstringStart of the default time range
time_tostringEnd of the default time range
typestringData source plugin type, for example grafana-postgresql-datasource
type_namestringData source plugin display name
uidstringDashboard or data source uid
updatedstringWhen the dashboard was last saved
updated_bystringUser who last saved the dashboard
urlstringURL of the dashboard, panel or data source address
versionintDashboard version number