Mthaddon Grafana

juju deploy mthaddon-grafana
Show information
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Channel Version Revision Published Runs on
latest/stable 4 4 19 Mar 2021
Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04


16.04 18.04 14.04


Graph and Dashboard builder Read more

Discuss this charm

Share your thoughts on this charm with the community on discourse.

Join the discussion


This charm provides the latest stable version of Grafana.


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


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=<name> keyrole=<role>

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="" login="john" password="redacted" \

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" \

To delete a user, you simply run:

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

Auth proxy

If deployed behind a reverse proxy, you can configure Grafana to let it handle authentication by enabled auth-proxy.

juju config grafana auth-proxy=true

Check grafana documentation on how to configure apache as the reverse proxy.

Users will be created/signup automatically with "Viewer" permissions. To change the default permissions of a user, use the change-user-role action passing the openID identifier or the email if the user updated it as the "login":

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

If not all URL paths are behind the reverse proxy auth, and anonymous=true is set, those paths will be accessible (view only) to non-authenticated users.


Explicitly set JUJU_REPOSITORY:

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

Branch code to



Assemble the charm:

charm build

Contact Information

Author: Alvaro Uria, Jacek Nykis Report bugs at: Location: Composed grafana charm: cs:~prometheus-charmers/grafana Grafana layer: