Skip to content

Importing

Five dashboards, all in English, all in Grafana’s shareable export format: the datasource is a ${DS_...} placeholder and the __inputs block asks the importer to choose their own.

FilePanelsStore
ghchronicle-influxdb.json152InfluxDB 3, queried with SQL
ghchronicle-prometheus.json152Prometheus
ghchronicle-postgres.json152PostgreSQL or TimescaleDB, from the SQL sink
ghchronicle-graphite.json152Graphite, from the Graphite sink
ghchronicle-elasticsearch.json152Elasticsearch or OpenSearch, from the Elasticsearch sink

The five hold the same panels in the same order. What differs is how many of them the store behind each one can answer.

What each store can answer, section by section A matrix of the dashboard's 17 sections against the five stores, most capable first. Each cell gives the panels that store answers with a query out of the panels in that section, and fills in proportion. In total: InfluxDB 150, PostgreSQL 150, Elasticsearch 145, Graphite 144, Prometheus 126, out of 150. 7 sections are answered in full by all five. Prometheus answers fewest, and loses most in Contributions (6 of 11), Pull requests and issues (10 of 14), Continuous integration (10 of 14), Planning and community (8 of 10). InfluxDB PostgreSQL Elasticsearch Graphite Prometheus Overview 4/4 4/4 4/4 4/4 4/4 Lifetime 5/5 5/5 5/5 5/5 5/5 Audience 6/6 6/6 6/6 6/6 5/6 Stars and forks 5/5 5/5 5/5 5/5 5/5 Contributions 11/11 11/11 10/11 10/11 6/11 Pull requests and issues 14/14 14/14 14/14 14/14 10/14 Continuous integration 14/14 14/14 13/14 13/14 10/14 Code 9/9 9/9 8/9 8/9 8/9 Planning and community 10/10 10/10 10/10 10/10 8/10 Delivery and access 13/13 13/13 13/13 13/13 13/13 Releases 4/4 4/4 3/4 4/4 2/4 Security 14/14 14/14 14/14 13/14 13/14 Cost 6/6 6/6 6/6 6/6 6/6 Activity 9/9 9/9 9/9 8/9 7/9 Inventory 16/16 16/16 15/16 15/16 14/16 Profile and sponsorship 8/8 8/8 8/8 8/8 8/8 The collector itself 2/2 2/2 2/2 2/2 2/2 Total 150/150 150/150 145/150 144/150 126/150 A panel a store cannot answer ships as a text panel with the same title, so all five dashboards have the same shape and the same 152 panels. 2 of those are prose in every store and are left out of this count. answered by a query answered as a text panel instead
What each store can answer, section by section A matrix of the dashboard's 17 sections against the five stores, most capable first. Each cell gives the panels that store answers with a query out of the panels in that section, and fills in proportion. In total: InfluxDB 150, PostgreSQL 150, Elasticsearch 145, Graphite 144, Prometheus 126, out of 150. 7 sections are answered in full by all five. Prometheus answers fewest, and loses most in Contributions (6 of 11), Pull requests and issues (10 of 14), Continuous integration (10 of 14), Planning and community (8 of 10). InfluxDB PostgreSQL Elasticsearch Graphite Prometheus Overview 4/4 4/4 4/4 4/4 4/4 Lifetime 5/5 5/5 5/5 5/5 5/5 Audience 6/6 6/6 6/6 6/6 5/6 Stars and forks 5/5 5/5 5/5 5/5 5/5 Contributions 11/11 11/11 10/11 10/11 6/11 Pull requests and issues 14/14 14/14 14/14 14/14 10/14 Continuous integration 14/14 14/14 13/14 13/14 10/14 Code 9/9 9/9 8/9 8/9 8/9 Planning and community 10/10 10/10 10/10 10/10 8/10 Delivery and access 13/13 13/13 13/13 13/13 13/13 Releases 4/4 4/4 3/4 4/4 2/4 Security 14/14 14/14 14/14 13/14 13/14 Cost 6/6 6/6 6/6 6/6 6/6 Activity 9/9 9/9 9/9 8/9 7/9 Inventory 16/16 16/16 15/16 15/16 14/16 Profile and sponsorship 8/8 8/8 8/8 8/8 8/8 The collector itself 2/2 2/2 2/2 2/2 2/2 Total 150/150 150/150 145/150 144/150 126/150 A panel a store cannot answer ships as a text panel with the same title, so all five dashboards have the same shape and the same 152 panels. 2 of those are prose in every store and are left out of this count. answered by a query answered as a text panel instead

The InfluxDB dashboard over ninety days of the demonstration database: the repository picker and the range across the top, the Overview with the ghchronicle badge and four tile groups reading 5 repositories with 350 stars and 51 forks, 37.5 thousand views with 21.1 thousand unique visitors and 19.6 thousand clones, 117 followers and 58 following with 4 sponsors and 2 sponsored, and 3.22 thousand contributions over 7.78 years, then the collapsed Lifetime header and the Audience section with views, unique visitors and clones per day, the top referrers, the top paths and clone amplification

The account in that capture is the invented one every capture in this documentation uses, acme and five repositories, described beside what the panels show. Every section but the Overview ships collapsed, which is why Lifetime is a header there.

  1. In Grafana, go to Dashboards, then New, then Import.

  2. Upload the ghchronicle-<store>.json for the store you are using.

  3. Choose the datasource Grafana asks for.

    The InfluxDB 3 datasource for the database the sink writes to, in SQL mode.

Name the input the file declares:

Terminal window
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"dashboard\": $(cat ghchronicle-influxdb.json), \"inputs\": [
{\"name\":\"DS_INFLUXDB\",\"type\":\"datasource\",\"pluginId\":\"influxdb\",\"value\":\"<uid>\"}],
\"overwrite\": true}" \
"$GRAFANA/api/dashboards/import"

The inputs are DS_INFLUXDB (influxdb), DS_PROMETHEUS (prometheus), DS_POSTGRES (grafana-postgresql-datasource), DS_GRAPHITE (graphite) and DS_ELASTICSEARCH (elasticsearch).

Each file carries a fixed uid (ghchronicle-<store>). That is deliberate for a repository import, where a stable uid means a stable URL and a re-import updates in place rather than duplicating. Importing two of these into one Grafana is fine, because the uids differ per store and cannot collide.

cmd/internal/dashboards holds one ordered list of sections and panels, and every panel carries one query set per store. The generator picks one set and emits the JSON, so every file has the same panels in the same places with the same titles, and it refuses to write files whose layouts have drifted apart.

Terminal window
go run ./cmd/gen_dashboards # writes all five files
go run ./cmd/gen_dashboards -check # writes nothing, fails if they are stale

Edit cmd/internal/dashboards/sections_*.go, not the JSON. panels.go holds the panel constructors it uses, query.go the query helpers for each store, and stores.go only chooses a query set and a datasource.

The files are already in the shape the directory requires: __inputs declares the datasource the importer must choose, __requires names the Grafana version and the plugin, and there is no id key, which the directory assigns on publication.

Keep the listing names distinct, because five dashboards with the same title are indistinguishable in search results: “ghchronicle for InfluxDB”, “ghchronicle for Prometheus”, “ghchronicle for PostgreSQL and TimescaleDB”, “ghchronicle for Graphite”, “ghchronicle for Elasticsearch and OpenSearch”.

Publishing again against the same listing adds a revision rather than replacing it, so a regeneration that changes panels is a new revision of the same five listings, not five new listings.

That is what a reader needs to know. The step by step, with the listing names, what each screenshot should show and what to do when a revision is rejected, is a maintainer’s task and lives in dashboards/PUBLISHING.md in the repository.