> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetsilicon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage analytics

> Track who is accessing content and running queries in your Silicon projects

For organization-wide reporting with editable charts and built-in dashboards, use the [usage analytics project](https://docs.meetsilicon.com/workspace-admin/usage-analytics-project.md). It includes people, content, apps, AI and query activity.

This page covers two project-level ways of understanding user activity:

1. [**Usage Analytics dashboards**](#usage-analytics-dashboards) - these are dashboards created by Silicon which give you an overview of your project's content and user activity.
2. [**Query tags**](#query-tags) - this is metadata which is added to your data warehouse queries and gives you information about who is querying data and what they are querying.

## Usage analytics dashboards

Each project has usage analytics dashboards created by Silicon giving you an overview of your project's content and user activity.

To see your usage analytics dashboards for a project, just click on the `settings` icon, `project settings`, then `usage analytics`.

Or you can also use our [search bar](https://docs.meetsilicon.com/explore/search.md) to get direct access to the different analytics dashboards by typing the name of the dashboard (eg: User activity)

### User Activity dashboard

This dashboard gives you an overview of the users in your project and the activity of your users.

Here's an overview of the fields used in the dashboard:

* **Number of users**: the total number of users that have access to the project.
* **Number of viewers**: the number of users with the `viewer` role that have access to the project.
* **Number of editors**: the number of users with the `editor` role that have access to the project.
* **Number of admins**: the number of users with the `admin` role that have access to the project.
* **% of weekly querying users**: the % of users which have run at least one query in the project in the last 7 days (out of all users in your project). Queries include viewing existing charts and dashboards.
* **Number of weekly querying users**: the number of users which have run at least one query in the project in the last 7 days.
* **Weekly average number of queries per user**: the rolling 7 day average number of queries that each user is running in your project.
* **Users that have run the most queries in the last 7 days**: a list of the users that have run the most queries in your project in the last 7 days.
* **Users that have updated the most charts in the last 7 days**: a list of users that have updated (including created) the most charts in the project in the last 7 days.
* **Users that have not run a query in the last 90 days**: a list of users that have not run a query in the project in the last 90 days. This includes viewing charts and dashboards.

#### Extended usage analytics

Contact [Silicon support](mailto:support@meetsilicon.com) to enable extended usage analytics, which adds two extra tables to the User Activity dashboard:

* **Dashboard views (top 20)**: ranks dashboards in the project by total view count.
* **Chart views (top 20)**: ranks charts in the project by total view count.

## Query tags

Query tags are metadata which is added to your data warehouse queries and gives you information about each query executed.

The following query tags are sent:

| Query Tag | Detail |
| - | - |
| organization\_uuid | Silicon organization unique identifier. |
| project\_uuid | Silicon project unique identifier. |
| user\_uuid | User unique identifier for the user that triggered the query. |
| embed | `true` when the query ran as the embed viewer, for example from an embedded dashboard or chart. Not set for AI agent embeds, whose queries run as the write actor and carry its `user_uuid`. See [User metadata](https://docs.meetsilicon.com/embed/reference.md#user-metadata). |
| external\_id | The `externalId` from the embed token's [user metadata](https://docs.meetsilicon.com/embed/reference.md#user-metadata), or the id Silicon generates when the token omits it. Set together with `embed`. |
| explore\_name | Name of the explore the query was run against. |
| chart\_uuid | Chart unique identifier. Only set when the query originates from a saved chart. |
| dashboard\_uuid | Dashboard unique identifier. Only set when the query originates from a dashboard. |
| saved\_sql\_uuid | Saved SQL chart unique identifier. Only set when a scheduled job is running a saved SQL chart. |
| scheduler\_uuid | Scheduler unique identifier. Only set when the query is triggered by a scheduled delivery, alert, or Google Sheets sync. |
| scheduler\_name | Human-readable name of the scheduler. Only set when the query is triggered by a scheduler. |
| job\_id | Scheduler job identifier for a single run of a scheduler. Only set when the query is triggered by a scheduler. |
| app\_uuid | [Data app](https://docs.meetsilicon.com/data-apps) unique identifier. Silicon sets it automatically when the query originates from a running data app. |
| query\_context | Which context the query was executed in. See [Query contexts](#query-contexts) below for the full list of values. |
| agent | `true` when an AI agent ran the query. Set with [agent identity](https://docs.meetsilicon.com/agents/agent-identity.md#find-agent-queries-in-the-warehouse). |
| agent\_surface | Where the AI agent ran, for example `mcp` or `slack_agent`. Only set with [agent identity](https://docs.meetsilicon.com/agents/agent-identity.md#find-agent-queries-in-the-warehouse). |
| agent\_client | The client of the AI agent, for example an MCP OAuth client ID or a Slack app ID. Only set with [agent identity](https://docs.meetsilicon.com/agents/agent-identity.md#find-agent-queries-in-the-warehouse). |
| agent\_uuid | The UUID of the Silicon AI agent that ran the query, for in-app chat and Slack agents. Not set for MCP queries. Only set with [agent identity](https://docs.meetsilicon.com/agents/agent-identity.md#find-agent-queries-in-the-warehouse). |
| user\_attribute\_`<name>` | One tag per [user attribute](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) value assigned to the querying user. Applies to both regular users and embed viewers, and requires no configuration. |

### Query contexts

The `query_context` tag identifies which surface triggered the query. Possible values:

| Value | Where the query came from |
| - | - |
| `dashboardView` | Viewing a dashboard. |
| `autorefreshedDashboard` | Dashboard auto-refresh tick. |
| `exploreView` | Running a query from the explore view. |
| `chartView` | Viewing a saved chart. |
| `chartHistory` | Viewing a chart's version history. |
| `sqlChartView` | Viewing a saved SQL chart. |
| `sqlRunner` | Running a query from the SQL runner. |
| `viewUnderlyingData` | Viewing the underlying data behind a result cell. |
| `filterAutocomplete` | Autocomplete lookups for filter values. |
| `calculateTotal` | Calculating a column total. |
| `calculateSubtotal` | Calculating a group subtotal. |
| `metricsExplorer` | Queries from the Metrics Explorer. |
| `csvDownload` | CSV export of query results. |
| `gsheets` | Ad-hoc Google Sheets export. |
| `alert` | Scheduled alert evaluating its condition. |
| `scheduledDelivery` | Scheduled delivery running. |
| `scheduledChart` | Scheduled chart delivery. |
| `scheduledDashboard` | Scheduled dashboard delivery. |
| `scheduledGsheetsChart` | Scheduled Google Sheets sync for a chart. |
| `scheduledGsheetsDashboard` | Scheduled Google Sheets sync for a dashboard. |
| `scheduledGsheetsSqlChart` | Scheduled Google Sheets sync for a SQL chart. |
| `preAggregateMaterialization` | Building a pre-aggregate materialization. |
| `embed` | Query from an [embedded](https://docs.meetsilicon.com/embed/reference.md) chart or dashboard. |
| `api` | Query issued through the Silicon HTTP API. |
| `cli` | Query issued through the [Silicon CLI](https://docs.meetsilicon.com/workflow/cli/reference.md). |
| `ai` | Query issued by a [Silicon AI agent](https://docs.meetsilicon.com/agents/set-up-agents.md). |
| `mcp.run_metric_query` | `run_metric_query` tool call from the [Silicon MCP server](https://docs.meetsilicon.com/agents/silicon-mcp.md). |
| `mcp.run_sql` | `run_sql` tool call from the Silicon MCP server. |
| `mcp.search_field_values` | `search_field_values` tool call from the Silicon MCP server. |
| `dataAppSample` | Sample query issued when previewing a data app. |

### User attribute tags

For every query, Silicon emits an extra `user_attribute_<name>` tag for each user attribute value assigned to the user running the query. This makes it possible to attribute warehouse cost, audit access, or debug row-level-security by user attribute directly from your warehouse's query history.

* Tags are emitted alongside the standard query tags for both signed-in users and embed viewers (using the attributes passed on the embed token).
* Values are carried through async query execution end-to-end, so they appear on the actual warehouse job (for example, as labels on a BigQuery job).
* Keys and values are sanitized to match warehouse tag constraints -- lower-cased, restricted to `a-z 0-9 _ -`, and truncated if too long. Invalid or oversized metadata is sanitized rather than blocking the query.
* No configuration is required -- user attribute tags are emitted automatically wherever query tags are already supported.

For example, a user with the `region` attribute set to `emea` and `customer_tier` set to `enterprise` will produce these additional tags on every warehouse query they trigger:

```text theme={null}
user_attribute_region=emea
user_attribute_customer_tier=enterprise
```

You can then filter your warehouse's query or job history by these tags (for example, `labels.user_attribute_region = "emea"` in BigQuery) to break down usage or cost by user attribute.

Query tags are stored differently in each data warehouse:

| Data Warehouse | Query Tag |
| :- | :- |
| BigQuery | Writes metadata as labels in your [job history](https://cloud.google.com/bigquery/docs/managing-jobs#view%5Fjob%5Fdetails%5F2). |
| Snowflake | Writes JSON metadata in the comment column of your [query history](https://docs.snowflake.com/en/user-guide/ui-history#viewing-query-details-and-results). |
| ClickHouse | Writes JSON metadata in the comment column of your [query log](https://clickhouse.com/docs/operations/system-tables/query_log). |
| Trino | Sends metadata as comma-separated `key=value` pairs in the [`X-Trino-Client-Tags`](https://trino.io/docs/current/develop/client-protocol.html#client-request-headers) HTTP header on each submitted query. |
| Redshift | Appends JSON metadata as a SQL comment in each submitted SQL query. |
| Databricks | Appends JSON metadata as a SQL comment in each submitted SQL query. |
| Postgres | Appends JSON metadata as a SQL comment in each submitted SQL query. |
| Athena | Appends JSON metadata as a SQL comment in each submitted SQL query. |

### Attribute BigQuery cost with job labels

On BigQuery, every query tag is a label on the job. BigQuery records the account that ran the job in `user_email`. That is the connection's service account, or the agent's own account with [agent identity](https://docs.meetsilicon.com/agents/agent-identity.md), never the Silicon user. To find who a job ran for, read the `user_uuid` label. To find which AI agent ran it, read `agent_uuid`.

BigQuery allows 64 labels on a job. When a query has more tags than that, Silicon keeps `agent`, `agent_surface`, `agent_client`, `agent_uuid` and `user_uuid` first, then the other query tags, then the user attribute tags. The labels beyond 64 are dropped, so `user_uuid` and the agent labels always stay on the job.

Silicon writes labels on the jobs it creates in the connection's execution project. Query `INFORMATION_SCHEMA.JOBS` in that project. This needs the `bigquery.jobs.listAll` permission, for example from the BigQuery Resource Viewer role. Replace `region-us` with the region of your datasets.

```sql Cost by Silicon user theme={null}
SELECT
  (SELECT value FROM UNNEST(labels) WHERE key = 'user_uuid') AS silicon_user_uuid,
  COUNT(*) AS jobs,
  SUM(total_bytes_billed) / POW(1024, 4) AS tib_billed,
  SUM(total_slot_ms) / 1000 / 3600 AS slot_hours
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY'
  AND EXISTS (SELECT 1 FROM UNNEST(labels) WHERE key = 'query_context')
GROUP BY silicon_user_uuid
ORDER BY tib_billed DESC;
```

```sql Cost by AI agent and user theme={null}
SELECT
  (SELECT value FROM UNNEST(labels) WHERE key = 'agent_uuid') AS agent_uuid,
  (SELECT value FROM UNNEST(labels) WHERE key = 'agent_surface') AS agent_surface,
  (SELECT value FROM UNNEST(labels) WHERE key = 'user_uuid') AS silicon_user_uuid,
  COUNT(*) AS jobs,
  SUM(total_bytes_billed) / POW(1024, 4) AS tib_billed,
  SUM(total_slot_ms) / 1000 / 3600 AS slot_hours
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY'
  AND EXISTS (
    SELECT 1 FROM UNNEST(labels) AS label
    WHERE label.key = 'agent' AND label.value = 'true'
  )
GROUP BY agent_uuid, agent_surface, silicon_user_uuid
ORDER BY tib_billed DESC;
```

`total_bytes_billed` drives on-demand cost, and `total_slot_ms` drives cost with capacity pricing. Label values are lower case. To match a `user_uuid` or `agent_uuid` to a name, compare it with the user or agent UUID in Silicon. The same labels are in the BigQuery [billing export](https://cloud.google.com/billing/docs/how-to/export-data-bigquery), so you can also group billed cost by them there.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.