cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

App Insights Viewer Data

dtank36
New Contributor III

We would like to display some "usage" data from an App, specifically using the Insights "Viewers" data. Is that data available for us to query via system tables or access via API, or only via the UI?

1 ACCEPTED SOLUTION

Accepted Solutions

dtank36
New Contributor III

Hi @sarahbhord,

Thanks for the response I did try those queries without any luck. I was hoping the User Authorization Actions example would work, but it doesn't return any results. We are using the preview feature Databricks Apps - On-Behalf-Of User Authorization, I don't know if that would have any impact on it?

View solution in original post

5 REPLIES 5

sarahbhord
Databricks Employee
Databricks Employee

Hey dtank36 

Thanks for reaching out! Check out the system.access.audit table to get viewer usage data.
You can filter by App identifier, action type, and timestamps to track engagement and usage. Here are some example queries you can use or adapt to your use-case. 

Best,

Sarah

dtank36
New Contributor III

Hi @sarahbhord,

Thanks for the response I did try those queries without any luck. I was hoping the User Authorization Actions example would work, but it doesn't return any results. We are using the preview feature Databricks Apps - On-Behalf-Of User Authorization, I don't know if that would have any impact on it?

sarahbhord
Databricks Employee
Databricks Employee

Hey @dtank36 - when you go into your UC and system tables, do you see the tables you are trying to query? Can you possibly look manually through the UI to see if they are there? 

Are you getting an error or just no records returned?

dtank36
New Contributor III

There is no data when I run the sample query provided here.
https://docs.databricks.com/aws/en/dev-tools/databricks-apps/monitor#track-user-authorization-action... 

I do see in the docs that there is mention of the app storing visits somewhere, but maybe that data isn't available?
Databricks records a view event when a user accesses the app through the app URL or through API access. It stores data as unique per user, per app.
https://docs.databricks.com/aws/en/dev-tools/databricks-apps/monitor#viewer-tracking 

sarahbhord
Databricks Employee
Databricks Employee

Got it. That probably means there arenโ€™t any audit events yet that match its filters.

  • Make sure youโ€™ve actually exercised the app using Onโ€‘Behalfโ€‘Of (have a few users sign in and trigger actions that call Databricks APIs through the app).

  • Confirm that system.access.audit is enabled and contains other recent rows for your workspace.

  • Temporarily relax the filters in the sample query (for example, remove the app id or narrow action types) to see if any OBO events show up at all.

Also - the โ€œViewersโ€ data you see in App Insights is stored in an internal Viewers table and isnโ€™t exposed through system tables or a public API, so itโ€™s only available in the UI. The system.access.audit table and the example โ€œUser Authorization Actionsโ€ queries are useful for appโ€‘level audit and security events, but they wonโ€™t return the same perโ€‘user viewer metrics you see in the Insights โ€œViewersโ€ panel, especially when using Onโ€‘Behalfโ€‘Of authorization.

For now, the options are:

  • Use system.access.audit to build your own usage views where possible (e.g., appโ€‘related events over time).

  • Continue to use the App Insights UI for the builtโ€‘in โ€œViewersโ€ data until Databricks exposes that table or equivalent via API or system tables.