I started using Grafana two weeks ago and am currently working with Grafana 10.2.0 and Zabbix.
I have three dashboards, each containing five panels. All my panels are stored in the library and are links. Each dashboard works with two variables:
Group: which includes all groups filtered by /^"client_name".*/ (each dashboard is specific to a client).
Host: which is a classic variable
Currently, when adding a new client, I need to:
Create a new user and set the appropriate permissions.
Create a folder, set permission.
Copy and paste the main dashboard.
Adjust the two variable filters for the new client.
My boss wants me to automate this process to minimize manual intervention. Ideally, I would like to use a regular expression or another mechanism so that:
Once a client user is created and given access to the main folder, their username is automatically used as a filter in the variable.
The dashboard dynamically displays only their data without requiring manual modifications.
Deleting step 3, 4 and half of the 2nd.
This would allow us to have a single dashboard for all clients instead of one dashboard per client. That way, data is displayed dynamically based on the client’s name, so it’s easier to set up, and I only need to maintain one dashboard instead of multiple copies.
I would like to know if it is possible to do that.
that is a good boss. yes it can be done. what backend are you using for the dashboards, do all users share the same backend to query data from or they have their own backend?
user 1 , data source database mysql,
user 2, rest api
or is it
user 1, datasource: mysql01, database: foo
user 2, datasource: mysql01, database: bar
or it is
user 1, datasource: mysql01, database: foo
user 2, datasource: mysql02, database: foo
or it is
user 1, datasource: mysql01, database: foo, table: user1
user 2, datasource: mysql01, database: foo, table: user2
For information i asked a trial for grafana enterprise to create multiple data sources with some restrictions added in data source configuration to have more options on security data source.
I am still looking a solution, just for information it is possible to use the reggex ${__user.login} that is dynamic based on the logged-in user in variables ?
I can see that is command is working in a text panel, we can see the name of logged-in user but impossible to work with in variables.
Thank’s you.