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

How to use your module to setup graphiteUrl: in config.js? #35

Closed
BeerOpsHQ opened this issue Jun 11, 2015 · 1 comment
Closed

How to use your module to setup graphiteUrl: in config.js? #35

BeerOpsHQ opened this issue Jun 11, 2015 · 1 comment

Comments

@BeerOpsHQ
Copy link

Hi,

Thanks for producing a great module!

I have one question. I'm trying to update the graphiteUrl in the /opt/grafana/config.js and struggling to see how to do it.

Is there perhaps a new "cfg => {" option that I've not come across perhaps? Or, should I be looking to use something like the file_line function at this stage to "grep" and update my graphite host details?

I'm sure i'm being a bit dim. Any pointers would be appreciated!

Thanks

Stephen

@bfraser
Copy link
Owner

bfraser commented Jun 12, 2015

Hi @stphnwallace thanks for your interest in the module!

As of Grafana version 2.x there no longer is a config.js file, so am I correct to assume that you are using the 1.x series? If so, I recommend using version 1.0.1 of this module (GitHub, Puppet Forge) as it is the last to support the 1.x series of Grafana.

In that version, datasource configuration in config.js (including Graphite) is managed via the datasources hash. There is an example of custom datasource parameters provided in the README, but essentially it would look like this:

class { 'grafana':
  datasources  => {
    'graphite' => {
      'type'    => 'graphite',
      'url'     => 'http://172.16.0.10',
      'default' => 'true'
    },
    'elasticsearch' => {
      'type'      => 'elasticsearch',
      'url'       => 'http://172.16.0.10:9200',
      'index'     => 'grafana-dash',
      'grafanaDB' => 'true',
    },
  }
}

If you are using Grafana version 2.x however, things are different. As mentioned, there is no config.js file anymore. Instead, Grafana has its own data backend (sqlite by default) and datasources are managed either through the web interface or via API. In order for the Puppet module to manage datasources for this version, it would be necessary to implement a provider which uses the API. Such a provider has not been written yet.

I hope that helps clarify things for you!

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