Posts Create Org on Grafana and Set Privileges
Post
Cancel

Create Org on Grafana and Set Privileges


Goal:

Create Org, its user account and set user account privileges on Grafana. All actions are done by Grafana admin.

Steps:

  1. Login Grafana as admin, create new Org
  2. Create new users, set privileges, verify user and move to new Org
  3. Add data source
  4. Create / import and configure required dashboards for Org

briefting:

Let’s say you only have A Grafana server and you want to provide its services to many different entities, for example, different departments in your company or different customers that you provide services to, yet all of them can only see their own data. Also, all of them are read accessible only. Any kind of modification on data nor dashborad etc are prohibitted.

***

Create Org

Login as Grafana admin, repeat the steps to create new Orgs, CustomerA and CustomerB Grafana

Name the Org
Grafana

Grafana

Finish view of two new Orgs Grafana

Create / configure new user

Create users belong to the org and set as viewer Grafana

Configure user information
Grafana

Finish view of two new users. Click on user name to setup privileges and Org Grafana

Add user to the designated Org and assign read only privilege Grafana

Remove user from main Org to prevent reading other metrics Grafana

Add data source

Switch to newly created Org
Grafana

Select Org Grafana

Add data source
Grafana

Grafana

Select your data source, Prometheus in my case Grafana

Enter your Prometheus information, Save & test if Grafana is accessible to Prometheus Grafana

Import / configure dashboard

Import dashboard with dashboard ID
Grafana

Grafana

Enter your desired dashboard ID, click Load Grafana

Configure data source for the dashboard, click Import at last Grafana

At this moment, user in this Org is able to read everyone’s metrics, so we need to restrict user in this Org only capable of reading its own data Grafana

Restriction to read own data

Click setting on dashboard
Grafana

Click on variable “job”
Grafana

Input regex according to your needs. A preview value is show at bottom Grafana

Save changes
Grafana

Verify result

That’s it! Let’s login user account to verify Grafana

We can see that configuration settings are gone and only own metrics, CustomerA, can be seen!

This post is licensed under CC BY 4.0 by the author.