The Usage page is a Looker-created dashboard that presents usage information about your Looker instance. Admins can use the data to better understand how their users utilize the application. To view the Usage page, from the Server section of the Admin menu, select Usage.
The i__looker
model
All of the information in the Usage panel is based on a LookML model called i__looker. Understanding that model can help you build useful, custom reports around the usage of your Looker instance and information about saved Looks and dashboards. See our Creating Looker usage and metadata reports with i__looker documentation page to learn more.
Usage dashboard
The Usage dashboard is accessed from the Admin page of Looker:
You can download or schedule the Usage dashboard just as any other dashboard.
Also, you can drill into metrics and elements like any other dashboard:
Query by Source tile
The Query by Source tile, which is located at the top of the Usage page, includes information about the number of queries run from different sources within Looker. The possible sources are:
- API (version number): Queries that came from the Looker API for the instance.
- Dashboard: Queries relating to tiles present on a dashboard.
- Dashboard Prefetch: Queries from the API to pre-run a dashboard.
- Explore: Queries associated with running Explores.
- Other: Queries from sources that do not fall into any other category.
- Private Embed: Queries that were initiated by a private embed context.
- Public Embed: Queries run from content that is accessed via public URL.
- Query: Short for
source_query
, queries generated by Looker’s internal i__looker database. - Renderer: Queries relating to the generation of images (.png and .pdf) for scheduled items and downloads.
- SQL Runner: Queries that are run directly in the SQL Runner.
- Saved Look: Queries associated with Looks.
- Scheduled Task: Queries run by Looker when it generates a Look or dashboard for delivery.
- Suggest Filter: Queries generated when users click on a filter that generates suggestions. In this case, Looker runs a
SELECT DISTINCT
on the filtered field to find the suggestions to surface to the user.
Context comments for SQL queries
Looker adds a unique comment to the beginning of each SQL query. The comments are added to queries from Explores, SQL Runner, the API, and filter suggestions. Context comments are automatically included.
Context comments on Google BigQuery connections are disabled by default because context comments invalidate Google BigQuery’s ability to cache and can negatively impact cache performance. You can enable context comments for a BigQuery connection by deselecting the Disable Context Comment setting on the Connection Settings page for the connection. See the Google BigQuery documentation page for more information.
Context comments are added in the following format:
-- Looker Query Context '{ "user_id":<user ID>,"history_id":<history ID>,"instance_slug":"<Looker instance number>"}'
The comments provide the following information:
user_id
: The unique identifier for each user on the Looker instance. You can match this user ID to the user IDs on the Users page in the Admin menu.history_id
: The unique identifier for each query that is run on the database by the Looker instance. This is the same history ID that is shown in the details of each query on the Queries page.instance_slug
: The ID number of the Looker instance that issued the query. Looker support can use this information to help you troubleshoot, if necessary.
The context comments are added to outgoing SQL commands right before the SQL is sent to the database. This prevents the comments from affecting the caching of Looker queries, but it also means that you cannot see the added comments in most places in Looker (such as the Queries page or i__looker).
Instead, you’ll see these comments in your database logs, which is useful for security and auditing. You might also be able to query the comments in SQL Runner:
This example is for Amazon Redshift. See the documentation for your SQL dialect to determine the command you’d need to run.