How to log dashboard viewed

  • Grafana version: 8.3.3

As a platform engineer
I want to see which dashboards my users are viewing
So that I can proactively contact users with poorly performing dashboards

We used to LDAP authenticate users in a Nginx proxy layer in front of Grafana.
We were able to use Nginx logs to see which dashboards users were accessing.
Now we LDAP authenticate inside grafana.
And I can not see how to tell which dashboard a user is accessing.

Hi Matthew :+1:,

how to tell which dashboard a user is accessing

I would say it will be tricky and not straightforward. There were usefull logs before (Grafana 6.x) which can be parsed nicely, but they are not available in Grafana 8.x.

Ideas:

  • try to increase log level to debug and parse/process logs, e.g.:
t=2022-01-27T14:39:10+0000 lvl=dbug msg="User granted access to execute action" logger=dashboard.permissions userId=1 orgId=1 uname=admin dashId=4 action=View
t=2022-01-27T14:39:11+0000 lvl=dbug msg="Client wants to subscribe" logger=live user=1 client=cd9b4cbb-eeb8-499d-b6ea-53bbb46b62a5 channel=1/grafana/dashboard/uid/-F7MS7K7k

I can proactively contact users with poorly performing dashboards

Dashboard loading itself is only loading of dummy json (dashboard model). For the performance you should consider asynchronous loading of data via datasource(s), so I would say analytics in the frontend will be the best option (Google Analytics, …). Maybe Sentry, React tracing, …

Please let us know how did you solve this problem. I would like to hear your solution. Thanks.