grafana-sync Keep your grafana dashboards in sync.

Overview

grafana-sync

Keep your grafana dashboards in sync.

Table of Contents

Installing

Download the latest binary from releases

Getting Started

Pull

Save all dashboards to directory

grafana-sync pull-dashboards
Example: grafana-sync pull-dashboards --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="dashboards" --url http://127.0.0.1:3000

Save dashboards with specific tags to directory

grafana-sync pull-dashboards
Example: grafana-sync pull-dashboards --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="dashboards" --url http://127.0.0.1:3000 --tag=export

Save folders configuration to directory

grafana-sync pull-folders
Example: grafana-sync pull-folders --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="folders" --url http://127.0.0.1:3000

Save notifications configuration to directory

grafana-sync pull-notifications
Example: grafana-sync pull-notifications --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="notifications" --url http://127.0.0.1:3000

Push

Push dashboards to grafana

grafana-sync push-dashboards
Example: grafana-sync push-dashboards --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="dashboards" --url http://127.0.0.1:3000

Push folders to grafana

grafana-sync push-folders
Example: grafana-sync push-folders --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="folders" --url http://127.0.0.1:3000

Push notifications to grafana

grafana-sync push-notifications
Example: grafana-sync push-notifications --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="notifications" --url http://127.0.0.1:3000

Global parameters

directory - Directory where to save dashboards. Default .
tag - Dashboard tag to read. Supported only with pull option. Default ""
apikey - Grafana api key, need to be editor or admin. Default "".
Api key can be stored in $HOME/.grafana-sync.yaml as apikey:
url - Grafana Url with port. Default http://localhost:3000

Contributing

  1. Fork it
  2. Download your fork to your PC ( git clone https://github.com/your_username/grafana-sync && cd grafana-sync )
  3. Create your feature branch ( git checkout -b my-new-feature )
  4. Make changes and add them ( git add . )
  5. Commit your changes ( git commit -m 'Add some feature' )
  6. Push to the branch ( git push origin my-new-feature )
  7. Create new pull request

License

grafana-sync is released under the Apache 2.0 license. See LICENSE.txt

Issues
  • Dashboard extraction failures do not result in a failure (non-zero) exit code

    Dashboard extraction failures do not result in a failure (non-zero) exit code

    When I run:

    grafana-sync pull-dashboards --apikey=GRAFANA_API_KEY --directory=dashboards --url=GRAFANA_URL
    

    Some dashboards cannot be retrieved (for which I may raise another issue). See:

    2022/01/05 09:49:16 unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for db/dashboard1
    

    The exit code is still 0, however. I had build an automated job to backup the dashboards and it has been 'green' despite these failures because the exit code from grafana-sync was 0. Can this be changed?

    opened by bjhartin 7
  • Error when syncing: cannot unmarshal object into Go struct field Board.panels

    Error when syncing: cannot unmarshal object into Go struct field Board.panels

    Using grafana-sync I receive this error on a specific dashboard:

    / # grafana-sync pull-dashboards --apikey="..." --directory=dashboards --url https://emonitor1.place6.ungleich.ch
    2022/02/05 12:08:18 unmarshal board: json: cannot unmarshal object into Go struct field Board.panels of type string for db/uplink-monitoring-2022
    

    Does it help if I paste the dashboard json in here?

    opened by telmich 6
  • Docker image for grafana-sync

    Docker image for grafana-sync

    Hello @mpostument ! This tool looks quite exactly what I was looking for. I would like to use it in the k8s context and was wondering if you are interested in publishing a container?

    If not, I'll build one myself (probably based on alpine), but maybe you want to contribute "an official" one.

    opened by telmich 4
  • Sync specific dashboards

    Sync specific dashboards

    @mpostument
    Can you help to implement the function to pull dashboards with specific folders? We'd like to pull some specific folders for the sync action. Thank you

    opened by tuan-phan 3
  • Support grafana-sync push-dashboards with the same folder

    Support grafana-sync push-dashboards with the same folder

    Hi @mpostument , I'm trying to use your tool. The problem that all my dashboard want to sync have a tag ="sync" and put into the folder called "sync_folder" I can pull all dashboards with tag==sync ./grafana-sync pull-dashboards --apikey="*******" --directory="dashboards" --url http://grafana-dev.dev.jpe2.net --tag=sync All of them will save in folder dashboards/sync I used this command to push them into stg env: ./grafana-sync push-dashboards --apikey="*****" --directory="dashboards/sync" --url http://grafana-stg.stg.jpe2.net But they are in General folder not in "sync_folder" I tried to create "sync_folder" in stg env but no luck. Can we support this case? Thank you,

    opened by tuan-phan 3
  • Document official docker image

    Document official docker image

    Hey!

    I was wondering if there is an "official" docker image? Is it by any chance https://hub.docker.com/layers/eyalfirst/grafana-sync/1.4.4/images/sha256-105026f7c1564458824aabede70329784a0cf77d3ef50ca6a2aa1e393f145b9b?context=explore ?

    If yes, can we document it in the repo?

    opened by telmich 2
  • Missing `--folderId` option?

    Missing `--folderId` option?

    Hi, I've been trying the following command:

    grafana-sync pull-folders --apikey="eyJrIjoiOWJYTktGNFlCbFVMOG1LY3d6ekN4Mmw4MFgyYU44a1UiLCJuIjoiY29icmEiLCJpZCI6MX0=" --directory="folders" --url http://127.0.0.1:3000 --folderId=1
    

    which returns this error:

    Error: unknown flag: --folderId
    Usage:
      grafana-sync pull-folders [flags]
    
    Flags:
      -h, --help   help for pull-folders
    
    Global Flags:
      -a, --apikey string      Grafana api key
          --config string      config file (default is $HOME/.grafana-sync.yaml)
      -d, --directory string   Directory where to save dashboards (default ".")
      -u, --url string         Grafana Url with port (default "http://localhost:3000")
    
    unknown flag: --folderId
    

    Could the --folderId option not be supported yet?

    Thanks!

    opened by lucas-bremond 2
  • Bump docker/metadata-action from 3.7.0 to 3.8.0

    Bump docker/metadata-action from 3.7.0 to 3.8.0

    Bumps docker/metadata-action from 3.7.0 to 3.8.0.

    Release notes

    Sourced from docker/metadata-action's releases.

    v3.8.0

    Full Changelog: https://github.com/docker/metadata-action/compare/v3.7.0...v3.8.0

    Commits
    • b2391d3 Merge pull request #193 from crazy-max/images-opts
    • 2f4dd14 backward compatibility with old images format
    • a5680a6 attribute to enable/disable images
    • be6d2cc Merge pull request #198 from crazy-max/refactor-default-banch
    • 0a72be4 don't handle default branch global exp for pr events
    • 72fe50e Merge pull request #197 from crazy-max/rm-baseref-def-branch
    • aca951f remove support of default branch global exp for push tag events
    • 0978a06 Merge pull request #192 from crazy-max/default-branch
    • c2905fb ci: add global expressions job
    • 7d7a22a fix undefined base_ref for some events
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump goreleaser/goreleaser-action from 2.8.1 to 2.9.0

    Bump goreleaser/goreleaser-action from 2.8.1 to 2.9.0

    Bumps goreleaser/goreleaser-action from 2.8.1 to 2.9.0.

    Release notes

    Sourced from goreleaser/goreleaser-action's releases.

    v2.9.0

    What's Changed

    Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v2.8.1...v2.9.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump docker/login-action from 1.12.0 to 1.13.0

    Bump docker/login-action from 1.12.0 to 1.13.0

    Bumps docker/login-action from 1.12.0 to 1.13.0.

    Release notes

    Sourced from docker/login-action's releases.

    v1.13.0

    • Handle proxy settings for aws-sdk (#152)
    • Workload identity based authentication docs for GCR and GAR (#112)
    • Test login against ACR (#49)
    • Bump @​aws-sdk/client-ecr from 3.44.0 to 3.45.0 (#132)
    • Bump @​aws-sdk/client-ecr-public from 3.43.0 to 3.45.0 (#131)
    Commits
    • 6af3c11 Merge pull request #152 from crazy-max/aws-sdk-proxy
    • caca336 handle proxy settings for aws-sdk
    • 17f28ab Merge pull request #112 from dineshba/workload-identity-gcr-gar
    • a875dd0 Update readme with workload identity based authentication for GCR and GAR
    • 7948fff Merge pull request #49 from crazy-max/e2e-acr
    • 5fcefb9 Merge pull request #131 from docker/dependabot/npm_and_yarn/aws-sdk/client-ec...
    • 3bb2d08 Update generated content
    • 242fb9a Bump @​aws-sdk/client-ecr-public from 3.43.0 to 3.45.0
    • fa72313 Merge pull request #132 from docker/dependabot/npm_and_yarn/aws-sdk/client-ec...
    • 088f62a Update generated content
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump docker/build-push-action from 2.8.0 to 2.9.0

    Bump docker/build-push-action from 2.8.0 to 2.9.0

    Bumps docker/build-push-action from 2.8.0 to 2.9.0.

    Release notes

    Sourced from docker/build-push-action's releases.

    v2.9.0

    • add-hosts input (#553 #555)
    • Fix git context subdir example and improve README (#552)
    • Add e2e tests for ACR (#548)
    • Add description on github-token option to README (#544)
    • Bump node-fetch from 2.6.1 to 2.6.7 (#549)
    Commits
    • 7f9d37f Merge pull request #555 from crazy-max/fix-add-host
    • d745845 Fix add-hosts context
    • 1ca185b Merge pull request #553 from crazy-max/add-host
    • eebf87a add-host input
    • d8b0ca6 Merge pull request #552 from crazy-max/readme
    • da76737 Fix git context subdir example and improve README
    • 8c76bb7 Merge pull request #549 from docker/dependabot/npm_and_yarn/node-fetch-2.6.7
    • b598b2a Update generated content
    • eb2857f Bump node-fetch from 2.6.1 to 2.6.7
    • f4cf574 Merge pull request #548 from crazy-max/e2e-acr
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Transformations are lost during import/export

    Transformations are lost during import/export

    Transformations are lost during import/export. We have some dashboards with tables and they have transformations. Look at screenshots image image

    After import transforms are empty capacity_broken

    opened by anvpetrov 3
  • Connect to HTTPS encrypted source not working

    Connect to HTTPS encrypted source not working

    Hello!

    I want to pull Dashboards/Folders from an https encrypted source. Unfortunatly this is not working.

    I'm getting this error when i pull-folders

    Pull folders command failed invalid character '<' looking for beginning of value

    Trying to pull from Home Assistant Grafana plugin.

    The port is defined and forwarding is turned on.

    When I open the URL https://example.tld:port in my browser I get forwarded to https://example.tld:port/api/hassio_ingress/<something>/login.

    Cheers, Matthias

    opened by mschabhuettl 6
  • cannot unmarshal number into Go struct field

    cannot unmarshal number into Go struct field

    Hello,

    Thank you for Grafana-sync, but I faced this issue during sync my dashboards:

    2021/03/05 11:46:32 unmarshal board: json: cannot unmarshal number into Go struct field Board.panels of type string for db/kubernetes-networking-namespace-pods
    2021/03/05 11:46:32 unmarshal board: json: cannot unmarshal number into Go struct field Board.panels of type string for db/kubernetes-networking-pod
    2021/03/05 11:46:34 unmarshal board: json: cannot unmarshal object into Go struct field TemplateVar.templating.list.query of type string for db/loki-quick-search
    2021/03/05 11:46:36 unmarshal board: json: cannot unmarshal object into Go struct field TemplateVar.templating.list.query of type string for db/services-overview
    

    Here is a gist with dashboards https://gist.github.com/ingvarch/51ef3022738d3b9011b2ce802a605aaf

    I use :

    Grafana v7.4.2 (29e75ad97b) Grafana-sync - 1.1.0

    help wanted 
    opened by ingvarch 14
Releases(1.4.8)
Owner
Maksym Postument
Maksym Postument
Cole - Cole can use his sixth sense to give you metrics about your Grafana dashboards

Cole Cole can use his sixth sense to give you metrics about your Grafana dashboa

Nicolas Takashi 39 Mar 12, 2022
A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instances.

Grafana Dashboard Synchronization Backend Plugin A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instance

Novatec Consulting GmbH 6 Apr 8, 2022
Terraform-grafana-dashboard - Grafana dashboard Terraform module

terraform-grafana-dashboard terraform-grafana-dashboard for project Requirements

hadenlabs 1 May 2, 2022
Grafana-threema-forwarder - Alert forwarder from Grafana webhooks to Threema wire messages

Grafana to Threema alert forwarder Although Grafana has built in support for pus

Péter Szilágyi 2 Feb 13, 2022
Flux prometheus grafana-example - A tool for keeping Kubernetes clusters in sync with sources ofconfiguration

Flux is a tool for keeping Kubernetes clusters in sync with sources of configuration (like Git repositories), and automating updates to configuration when there is new code to deploy.

null 0 Feb 1, 2022
Duwant2keepyourperks - Du want 2 keep your perks

duwant2keepyourperks DU want to keep your perks? Installation Download the lates

null 2 Jan 10, 2022
Sapfun - Utility that takes control over your video card coolers to keep it cool and steady

What? sapfun - Utility that takes control over your video card coolers to keep i

Vadim Kuznetsov 1 Feb 18, 2022
Watchtower for Git: automatically keep local Git repositories up to date with their remotes

CrowsNest Watchtower for Git: automatically keep local Git repositories up to date with their remotes. Configuration Flags --run-once or -r: Normally

Simon 59 May 26, 2022
Keep updated about all deploys on Tsuru

Snitch Keep updated about each deploy via Tsuru. This program will notify your team and many tools when someone has deployed any application via Tsuru

Lucas Gomide 15 May 18, 2021
Download your Fitbit weight history and connect to InfluxDB and Grafana

WemonFit Weight monitoring for Fitbit, using InfluxDB and Grafana Generating a new certificate openssl req -new -newkey rsa:2048 -nodes -keyout lo

Eduardo Argollo 0 Dec 5, 2021
A simple tool to sync your etcd cluster to PostgreSQL in realtime.

etcd-postgresql-syncer A simple tool to sync your etcd cluster to PostgreSQL in realtime. It sets up a watcher on etcd and commits all changes to Post

Jille Timmermans 1 Jan 20, 2022
Grafana Tempo is a high volume, minimal dependency distributed tracing backend.

Grafana Tempo is an open source, easy-to-use and high-scale distributed tracing backend. Tempo is cost-efficient, requiring only object storage to ope

Grafana Labs 2.1k Jun 23, 2022
Grafana Dashboard Manager

Grafana dash-n-grab Grafana Dash-n-Grab (GDG) -- Dashboard/DataSource Manager. The purpose of this project is to provide an easy to use CLI to interac

NetSage 110 Jun 14, 2022
Graph and alert on '.rrd' data using grafana, RRDTool and RRDSrv.

Grafana RRD Datasource A grafana datasource for reading '.rrd' files via RRDTool and RRDsrv. With this datasource you will be able to create grafana d

null 9 Jun 7, 2022
PoC for Grafana 8.x Local File Inclusion (Pre-Auth)

Grafana 8.x Local File Inclusion (Pre-Auth) CVE: Pending All credits go to j0v and his tweet https://twitter.com/j0v0x0/status/1466845212626542607 Dis

Tay 9 Apr 13, 2022
Grafana Unauthorized arbitrary file reading vulnerability

CVE-2021-43798 Grafana Unauthorized arbitrary file reading vulnerability 8.3.1 (2021-12-07) Security: Fixes CVE-2021-43798 . For more information, see

Jas502n 273 Jun 17, 2022
Grafana DB2 Data Source Backend Plugin

Grafana DB2 Data Source Backend Plugin This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data Source

null 2 Dec 13, 2021
Otus prometheus grafana for golang

HW Prometheus. Grafana Clone the repo: git clone https://github.com/alikhanmurzayev/otus_kuber_part_3.git && cd otus_kuber_part_3 Prepare workspace: m

null 0 Dec 17, 2021
Grafana Data Source Backend Plugin Template

Grafana Data Source Backend Plugin Template This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data So

null 0 Jan 16, 2022