Using Grafana JSON Model — HowTo

  • cluster1
    - p50 panel
    - p90 panel
    - p99 panel
    - …
  • cluster2
    - p50 panel
    - …
  • cluster3
    - p50 panel
    - …
Fig 1
  • Find the JSON configuration for Cluster1. It should look something like this:
{
"collapsed": true,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 16
},
"id": 18,
"panels": [...]
"title": "Cluster1",
"type": "row"
},
        {
...
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 17
},
"id": 59,
...
}
  • Find the maximum id of all the panels that are currently present in the original JSON config. We will give ids starting from maxid+1 to all the panels for Cluster2. Replace ids for the panels in the copied config 1-by-1.
  • Then we need to update the gridPos values. If this is not done correctly, the panels in the resulting dashboard will be all over the place. To do this, find the max y value in Cluster1. Adding the h (height) in the gridPos of the panel with max y value plus 1 will be the starting y coordinates for Cluster2(let’s call this y2). Also find the y value for the row Cluster1(let’s call it y1). Replace the y values in the copied Cluster1 config with y+y2-y1.
  • Do a Find and Replace of cluster1 with cluster2 to fix the queries.
  • Append this config after the config for Cluster1 in the original config.
  • Increase the version value near the end of the config.
  • Copy the config back to JSON model on the dashboard and press Save.
Fig 2

--

--

--

I code, among other things.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Hiccups Writing GTK3 GUI Code in Julia on macOS

Hot code pushes to Openshift from a Node app

RxJS and the Observable Flic Button

MessagePack for C# v2, new era of .NET Core(Unity) I/O Pipelines

Flatiron Project #3 Limo-Service Rails Application

Ways to Generate Code for Dart & Flutter #1

Generics in Kotlin (Part 2)

Time Pilot — Movement Experiments

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yasoob Haider

Yasoob Haider

I code, among other things.

More from Medium

Using Cincinnati Operator (AKA Update-Service-Operator) in disconnected environments

Create KIND cluster/multi-node cluster on WSL2(Ubuntu 20.04)

Fixed a python App deployed on a Kubernetes Cluster

Getting Started with HashiCorp Packer