dwhat

Free tool · BigQuery and Snowflake

Query attribution checker

Cost by dbt model or dashboard only works when queries carry a mark the tools left. Paste one query's metadata and see what dwhat's audit would recognise: the tool, the dbt model and the dashboard — or why it would show the query as unattributed.

Nothing you paste leaves this page. It is checked by this page's JavaScript, with the same parser the audit runs; it is not sent, stored or put in the address. No account and no warehouse access needed.

SQL comments can carry sensitive values — names, ids, emails, literals in the query. Paste only what you are allowed to, and trim the rest: the marks are all this needs.

Check your metadata

What are you pasting?
Made-up examples:

Up to 100,000 characters of SQL (the audit keeps the first 20,000), 20,000 of labels, and 2,000 of a query tag, as Snowflake allows. Labels can be a JSON object or BigQuery's TO_JSON_STRING(labels) array.

What the audit would recognise

What dwhat reads, and where to find it

Some marks are what a tool writes by default; the others are dwhat's own convention, which you add. Either way a mark only changes queries run after it is added: the history already in your warehouse keeps the metadata it had, and nothing can attribute those queries after the fact.

SQL comments

dbt's default comment, as dwhat reads it

/* {"app": "dbt", "node_id": "model.my_project.orders"} */
BigQuery: recent query text that carries a dbt comment
SELECT job_id, creation_time, query
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY)
  AND job_type = 'QUERY'
  AND REGEXP_CONTAINS(query, r'"app": *"dbt"')
ORDER BY creation_time DESC
LIMIT 20

Documentation: dbt: query-comment · BigQuery: INFORMATION_SCHEMA.JOBS view · Snowflake: QUERY_HISTORY view

BigQuery job labels

A dashboard label, set for every query in a BigQuery session

SET @@query_label = "dashboard:revenue_daily";
BigQuery: recent jobs and their labels, as JSON to paste here
SELECT job_id, creation_time, TO_JSON_STRING(labels) AS labels
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY)
  AND job_type = 'QUERY'
  AND ARRAY_LENGTH(labels) > 0
ORDER BY creation_time DESC
LIMIT 20

Documentation: BigQuery: add labels to jobs · BigQuery: labels, and their requirements · dbt: query-comment · Looker Studio: monitor and analyze BigQuery data source queries · BigQuery: INFORMATION_SCHEMA.JOBS view

Snowflake QUERY_TAG

A dashboard tag, set for a session

ALTER SESSION SET QUERY_TAG = '{"dashboard": "Revenue daily", "tool": "Hex"}';
Snowflake: recent queries with a tag
SELECT query_id, start_time, query_tag
FROM snowflake.account_usage.query_history
WHERE start_time >= DATEADD('day', -1, CURRENT_TIMESTAMP())
  AND COALESCE(query_tag, '') <> ''
ORDER BY start_time DESC
LIMIT 20

Documentation: Snowflake: the QUERY_TAG parameter · Snowflake: QUERY_HISTORY view

What it does not do

See what those models and dashboards cost

The audit reads 45 days of query history with a read-only account and splits the cost by user, dbt model and dashboard, with the unattributed share shown as such.

Connect a read-only account for a free audit

The link is the checker's address alone — never what you pasted.

Related guides