Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What would be the best way to import json dashboards / boards from grafana.com #51

Open
olefa opened this issue Nov 30, 2018 · 6 comments

Comments

@olefa
Copy link

olefa commented Nov 30, 2018

No description provided.

@brancz
Copy link
Owner

brancz commented Nov 30, 2018

This setup is very opinionated about this, and expects you to provide dashboards in form of configuration up front. If you want a dashboard from grafana.com you need to download it and add it to the dashboards config object.

@olefa
Copy link
Author

olefa commented Dec 3, 2018

Do you have an example of this? Wouldn't it make your file bloated?

A suggestion could be to be able to define voulumen mounts. The config maps with dashboard json is easy to create.

@brancz
Copy link
Owner

brancz commented Dec 3, 2018

with jsonnet you can merge anything you want onto the existing structure, if that's what you want to do you can, but we prefer to do everything declaratively 🙂

@brancz
Copy link
Owner

brancz commented Dec 3, 2018

An example would be

{
  grafanaDashboards+:: {
    'my-dashboard.json':
      dashboard.new('My Dashboard')
      .addTemplate(
        {
          current: {
            text: 'Prometheus',
            value: 'Prometheus',
          },
          hide: 0,
          label: null,
          name: 'datasource',
          options: [],
          query: 'prometheus',
          refresh: 1,
          regex: '',
          type: 'datasource',
        },
      )
      .addRow(
        row.new()
        .addPanel(graphPanel.new('My Panel', span=6, datasource='$datasource')
                  .addTarget(prometheus.target('vector(1)')))
      ),
  },
}

@brancz
Copy link
Owner

brancz commented Dec 3, 2018

I added #52 as an example of how to add a dashboard.

@olefa
Copy link
Author

olefa commented Dec 10, 2018

Thanks.. It's not exactly what we need... but we could make it work.. Tried adding the entire json into the template tag.. that didn't work.. So we'll just use the code to create the configmap mappings in grafana and then we'll add the json to the created configmap in another deployment step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants