Show information on current user sessions in Grafana dashboard

Is it possible to show information available from ‘Administration - Users’ in the dashboard (i.e. in Table) without any additional external datasources:

As well as more detailed information for the particular user:

If it’s not possible by Grafana means, may be there is an example how to push such data into InfluxDB?

if you are willing to try another datasource, you can use the json api plugin, or infinity plugin, and then access the grafana rest api, change localhost and admin to your details:

http://admin:admin@127.0.0.1:3000/api/users?perpage=100&page=1

and display this in a table

3 Likes

Also another way is to use global variables

${__user.id} is the ID of the current user. ${__user.login} is the login handle of the current user. ${__user.email} is the email for the current user.

1 Like

Thank you, will try this option.

Thank you, but using global variables I can get information only about current user. But I need information about all active user sessions.

1 Like

Thank you. It works for user with admin rights. Can it be allowed for non-admin user (not giving him admin rights, just giving the right to view user list)?

I get the following error:
You’ll need additional permissions to perform this action. Permissions needed: users:read

How to set users:read permission for the particular user? Or this is not possible in Grafana OSS?

Is it possible to use Grafana service account and its token instead of basic authorization to access this information?

Can’t figure out how to configure infinity plugin for that, I get 403 error when try to access /api/users?perpage=100&page=1

The Users HTTP API does not currently work with an API Token. API Tokens are linked to an organization and an organization role. They cannot be given the permission of server users access, only users can be given that permission. To use these API calls you can use Basic Auth and the Grafana user must have the Grafana Admin role.

1 Like