Skip to content

Latest commit

 

History

History
71 lines (42 loc) · 2.34 KB

INSTALL.md

File metadata and controls

71 lines (42 loc) · 2.34 KB

installation

  1. clone the repo

  2. download grafana from here and install it locally

  3. grafana settings, conf/defaults.ini, enable unsigned plugins (yes, the plugin is unsigned)

unsigned

  1. copy the frontend folder to the installed grafana

frontend

build the frontend

cd [grafana installed path]/data/plugins/frontend
npm install
npm run dev
  1. launch grafana
cd [grafana installed path]
./bin/grafana server

plugin

  1. add and configure the datasource

choose Mongodb-Grafana-Plugin

plugin

configure the mongodb connection parameters and the plugin's backend url. DON'T click the Save & test button yet. let's do it at step 7.

plugin

  1. debug the frontend

since it is a debug build in step 3 npm run dev, you code change in the frontend will take effect immediately. open a chrome's inspector, just do an Empty Cache and Hard Reload to load the new change(s).

you will then be able to view the source, set breakpoints, step through the code; just like debugging any react.js apps

plugin

  1. debug the backend
cd [repo path]/backend
npm install

open the repo from visual studio code. the backend is in the backend folder. it is default hardcoded to use port number 4000 and a launch.json has been provided. just Run | Start Debugging from menu bar. you can set a breakpoiint at code

plugin

  1. save the database connection

click on the Save & test button. your breakpoint in step 6 shall be triggered

plugin

hurray! you have everything set up.

product build

frontend - run the npm run build for just once. the built product in the dist folder is good for grafana's future use

backend - it's just an express.js app. run it localhost or in a cloud, aws apigateway + lambda can be an easy setup.