Skip to content

this tiny project demonstrates how to build reports with grafana based on data from postgresql database

Notifications You must be signed in to change notification settings

sajonaro/grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

this small POC explores how to

  • build visualizations in grafana based on data stored in postgresdb
  • store that visualization in a json file so that every time we rebuild grafana container - the dashboard gets reloaded from the file

steps involved

  • run grafana with a database via docker compose
    docker compose up
    
  • create (manually for the first time) the dashboard, and then
    • click SHARE:EXPORT:View JSON
    • save the contents of .json file in ./provisioning/dashboards/home.json file (or any other path)
  • create as well ./provisioning/datasources/datasources.yaml file (with connection parameters corresponding to connection details defined for database, check docker-compose.yaml service name db)
  • in docker compose give grafana container following parameters:
     environment:
        GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /etc/grafana/provisioning/dashboards/home.json
     volumes:
        - ./provisioning:/etc/grafana/provisioning 
    
  • now every time you re-run specified docker compose stack: the dashboard will be reloaded from the .json file

About

this tiny project demonstrates how to build reports with grafana based on data from postgresql database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages