Project

General

Profile

Actions

Cleanup #45184

closed

mgr/dashboard: monitoring: replace Grafana JSON with code-based generators

Added by Ernesto Puerta about 4 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Monitoring
Target version:
-
% Done:

0%

Tags:
grafana
Backport:
pacific
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently Grafana JSON files comprise around 8,500 lines. Despite 90% is boilerplate code (Grafana defaults), they are still difficult to interpret and debug, prone to backporting messes, impossible to test or customize.

The idea would be to replace those JSON files with Python (or any other language) generators. Hopefully there seems to be a couple of libraries to carry this out, the most notable is Grafanalib (see lecture at GrafanaCon for more details):

$ pip install grafanalib
$ generate-dashboard -o pool-overview.json pool-overview.py

Sample dashboard generator (or this other one):


dashboard = common.Dashboard(
 title="Pool Overview",
 rows=[
  Row(panels=[
    Graph(title="Top 15 clients"....
   ...
 ],
...
)


Related issues 3 (0 open3 closed)

Precedes Dashboard - Cleanup #52238: mgr/dashboard: fix grafonnet build errorResolved

Actions
Copied to Dashboard - Backport #52135: pacific: mgr/dashboard: monitoring: replace Grafana JSON with code-based generatorsResolvedAashish SharmaActions
Copied to Dashboard - Cleanup #52777: mgr/dashboard: monitoring: complete grafonnet refactoringResolvedAashish Sharma

Actions
Actions #1

Updated by Ernesto Puerta over 3 years ago

Alternative: jsonnet

Actions #2

Updated by Ernesto Puerta about 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 148 to Monitoring
Actions #3

Updated by Aashish Sharma almost 3 years ago

  • Assignee set to Aashish Sharma
  • Pull request ID set to 42194
Actions #4

Updated by Aashish Sharma almost 3 years ago

  • Status changed from New to Fix Under Review
Actions #5

Updated by Ernesto Puerta almost 3 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport changed from octopus, nautilus to pacific

Removed the nautilus/octopus backports, as older releases distros don't support the latest jsonnet packages.

Actions #6

Updated by Backport Bot almost 3 years ago

  • Copied to Backport #52135: pacific: mgr/dashboard: monitoring: replace Grafana JSON with code-based generators added
Actions #7

Updated by Ernesto Puerta almost 3 years ago

  • Precedes Cleanup #52238: mgr/dashboard: fix grafonnet build error added
Actions #8

Updated by Loïc Dachary over 2 years ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Actions #9

Updated by Ernesto Puerta over 2 years ago

  • Copied to Cleanup #52777: mgr/dashboard: monitoring: complete grafonnet refactoring added
Actions

Also available in: Atom PDF