Description

Grafana is the leading graph and dashboard builder for visualizing
time series metrics.

Overview

This charm provides the latest stable version of Grafana.

Usage

juju deploy grafana
juju add-relation prometheus:grafana-source grafana:grafana-source

Above will automatically configure prometheus as grafana datasource

If admin password is not set using configuration option it is autogenerated.

To retrieve autogenerated password run:
$ juju run-action --wait grafana/0 get-admin-password

Actions

This charm supports importing dashboards, simply run:

$ juju run-action --wait grafana/0 import-dashboard dashboard="$(base64 mydashboard.json)"

where mydashboard.json is a json file:

{ "dashboard": { exported-json-dashboard },
"overwrite": true }

If you don't want to overwrite the dashboard, set overwrite to false.

There is also an action to create an API key, run:

$ juju run-action --wait grafana/0 create-api-key keyname= keyrole=

where the keyrole is one of Viewer, Editor, Read Only Editor or Admin.

User Management Actions

Currently user management is only implemented to manipulate users in the default
organisation.

You can retrieve the admin password, via:

$ juju run-action --wait grafana/0 get-admin-password

You can create a user:

$ juju run-action -w grafana/0 create-user name="John Citizen" \
email="john@example.com" login="john" password="redacted" \
role="Viewer"

where the role is one of Viewer, Editor, Read Only Editor or Admin.
This will create the user in the default organisation.

To reset a user's password:

$ juju run-action --wait grafana/0 set-user-password \
login=john new-password=citizen2

This again assumes the user is in the default organisation, if it
isn't it won't find the user.

If you need to change the user's role, run:

$ juju run-action --wait grafana/0 change-user-role login="john" \
new-role="Admin"

To delete a user, you simply run:

$ juju run-action --wait grafana/0 delete-user login=john

Development

Explicitly set JUJU_REPOSITORY:

export JUJU_REPOSITORY=/path/to/charms
mkdir -p $JUJU_REPOSITORY/layers

Branch code to

$JUJU_REPOSITORY/layers/layer-grafana/

Modify

Assemble the charm:

charm build

Contact Information

Author: Alvaro Uria alvaro.uria@canonical.com, Jacek Nykis jacek.nykis@canonical.com
Report bugs at: https://bugs.launchpad.net/grafana-charm
Location:
Composed grafana charm: cs:~prometheus-charmers/grafana
Grafana layer: https://code.launchpad.net/grafana-charm

Configuration

nagios_context
(string) A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them.
juju
install_file
(string) Location where grafana .deb file can be found. If set install_sources and install_keys options are ignored. Example: install_file: http://my.company.com/packages/grafana/grafana_3.0.0_amd64.deb
http_proxy
(string) Proxy URL to use for install_file
install_method
(string) How to install Grafana. If set to "apt", empty string or unset, the package will be installed using apt-get. If set to "snap", snap package will be installed
apt
install_keys
(string) YAML list of GPG keys for installation sources, as a string. For apt repository URLs, use the public key ID used to verify package signatures. For other sources such as PPA, use empty string. This list must have the same number of elements as install_sources, even if the key items are all empty string. An example to go with the above for install_sources: install_keys: | - "" - ""
- | -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQINBFLUbogBEADceEoxBDoE6QM5xV/13qiELbFIkQgy/eEi3UesXmJblFdU7wcD LOW3NuOIx/dgbZljeMEerj6N1cR7r7X5sVoFVEZiK4RLkC3Cpdns0d90ud2f3VyK K7PXRBstdLm3JlW9OWZoe4VSADSMGWm1mIhT601qLKKAuWJoBIhnKY/RhA/RBXt7 z22g4ta9bT67PlliTo1a8y6DhUA7gd+5TsVHaxDRrzc3mKObdyS5LOT/gf8Ti2tY BY5MBbQ8NUGExls4dXKlieePhKutFbde7sq3n5sdp1Ndoran1u0LsWnaSDx11R3x iYfXJ6xGukAc6pYlUD1yYjU4oRGhD2fPyuewqhHNUVwqupTBQtEGULrtdwK04kgI H93ssGRsLqUKe88uZeeBczVuupv8ZLd1YcQ29AfJHe6nsevsgjF+eajYlzsvC8BN q3nOvvedcuI6BW4WWFjraH06GNTyMAZi0HibTg65guZXpLcpPW9hTzXMoUrZz8Mv J9yUBcFPKuFOLDpRP6uaIbxJsYqiituoltl0vgS/vJcpIVVRwSaqPHa6S63dmKm2 6gq18v4l05mVcInPn+ciHtcSlZgQkCsRTSvfUrK+7nzyWtNQMGKstAZ7AHCoA8Pb c3i7wyOtnTgfPFHVpHg3JHsPXKk9/71YogtoNFoETMFeKL1K+O+GMQddYQARAQAB tDdwYWNrYWdlY2xvdWQgb3BzI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DZ3JuwpaUAHAtguPy0QddvF I4R7eFDVwHT0sS3AsG0HAOCY/1FRe8cAw/+9Vp0oDtOvBWAXycnCbdQeHvwh2+Uj 2u2f7K3CDMoevcBl4L5fkFkYTkmixCDy5nst1VM5nINueUIkUAJJbOGpd6yFdif7 mQR0JWcPLudb+fwusJ4UEACYWhPa8Gxa7eYopRsydlcdEzwpmo6E+V8GIdLFRFFp KHQEzbSW5coxzU6oOiPbTurCZorIMHTA9cpAZoMUGKaSt19UKIMvSqtcDayhgf4c Z2ay1z0fdJ2PuLeNnWeiGyfq78q6wqSaJq/h6JdAiwXplFd3gqJZTrFZz7A6Q6Pd 7B+9PZ/DUdEO3JeZlHJDfRmfU2XPoyPUoq79+whP5Tl3WwHUv7Fg357kRSdzKv9D bgmhqRHlgVeKn9pwN4cpVBN+idzwPefQksSKH4lBDvVr/9j+V9mmrOx7QmQ5LCc/ 1on+L0dqo6suoajADhKy+lDQbzs2mVb4CLpPKncDup/9iJbjiR17DDFMwgyCoy5O HJICQ5lckNNgkHTS6Xiogkt28YfK4P3S0GaZgIrhKQ7AmO3O+hB12Zr+olpeyhGB OpBD80URntdEcenvfnXBY/BsuAVbTGXiBzrlBEyQxg656jUeqAdXg+nzCvP0yJlB UOjEcwyhK/U2nw9nGyaR3u0a9r24LgijGpdGabIeJm6O9vuuqFHHGI72pWUEs355 lt8q1pAoJUv8NehQmlaR0h5wcwhEtwM6fiSIUTnuJnyHT053GjsUD7ef5fY1KEFm aZeW04kRtFDOPinz0faE8hvsxzsVgkKye1c2vkXKdOXvA3x+pZzlTHtcgMOhjKQA sA== =H60S -----END PGP PUBLIC KEY BLOCK-----
port
(string) The port grafana will expose web services on.
3000
root_url
(string) The full public facing url
%(protocol)s://%(domain)s:%(http_port)s/
google_analytics_ua_id
(string) Google Universal Analytics ID per http://docs.grafana.org/installation/configuration/#google-analytics-ua-id
default_dashboards
(string) List of default dashboards to be loaded on Grafana storage backend (default: sqlite3 backend)
dashboards_backup_dir
(string) Location where to put dashboard dumps
/srv/backups
app_mode
(string) production or development
production
anonymous_role
(string) The role given to anonymous users if enabled.
Viewer
admin_password
(string) Grafana admin password. Default, pwgen(16) random password. See also README.md for instructions how to retrieve automatically generated password
nagios_servicegroups
(string) Comma separated list of nagios servicegroups for the graphite check
juju
datasources
(string) - type,name,access,url,password,user,database
smtp_host
(string) The SMTP host and port that grafana will send emails via. If unset SMTP will not be enabled Example: smtp.example.com:25
smtp_auth
(string) The SMTP username and password that the Grafana plugin will authenticate with in "username:password" format. Example mysmtpuser:secret
anonymous
(boolean) Whether to allow anonymous users, defaults to False.
snap_channel
(string) If install_method is set to "snap" this option controlls channel name. Supported values are: "stable", "candidate", "beta" and "edge"
stable
snap_proxy
(string) HTTP/HTTPS web proxy for Snappy to use when accessing the snap store.
install_plugins
(string) Comma separated list of http(s) URLs where grafana plugin tarballs can be found. Example: install_plugins: http://my.company.com/packages/grafana/plugins/plugin-panel.tar.gz
snap_proxy_url
(string) The address of a Snappy Enterprise Proxy to use for snaps e.g. http://snap-proxy.example.com
dashboards_backup_schedule
(string) Cron schedule for dashboards backups
instance_name
(string) Grafana instance name, for example "grafana.example.com". If unset defaults to server hostname
smtp_from_address
(string) The SMTP from address that the Grafana plugin will use when addressing emails.
admin@grafana.localhost
install_sources
(string) YAML list of additional installation sources, as a string. The number of install_sources must match the number of install_keys. For example: install_sources: | - ppa:project1/ppa - ppa:project2/ppa
- 'deb https://packagecloud.io/grafana/stable/debian/ wheezy main'