Skip to content

Events Schema

Framedash stores raw telemetry in a ClickHouse events table. You can read it with SQL from three places:

This page lists the columns and the validator rules so you can write queries without the Claude Code plugin.

Raw SQL requires an API key with the query:read scope (the Read-only + SQL preset); data:admin (the Full preset) also works, but keep data:admin keys for data export and erasure. A plain Read-only key can use the pre-built analytics endpoints and MCP tools but not the raw query path. An Ingest (events:write) key cannot query at all by design, and can learn only its own project ID and scopes via GET /v1/whoami.

Queries are validated, rewritten to enforce project isolation, and run against a read-only connection. The validator enforces:

  • SELECT only. No INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, SYSTEM, OPTIMIZE, KILL, or UNION / EXCEPT / INTERSECT.
  • Only two tables may appear in FROM / JOIN: events (raw events) and daily_sessions_project_mv (pre-aggregated daily sessions). Write plain FROM events; isolation filters are injected for you.
  • Do not reference tenant_id or project_id in your SQL. They are auto-scoped, and referencing them directly is rejected.
  • String literals use single quotes only. Double quotes and backticks are rejected.
  • A FROM written inside an expression is rejected with HTTP 400, and the error message always lists the same four function forms (the ones given below), whatever form the query used. This affects the SQL-standard spellings extract(HOUR FROM timestamp), trim(BOTH ' ' FROM s), substring(s FROM 2 FOR 3), overlay(s PLACING r FROM n), substr(...) / mid(...) written with FROM, and a IS DISTINCT FROM b / a IS NOT DISTINCT FROM b (a FROM followed directly by a parenthesized subquery, such as extract(HOUR FROM (SELECT ...)), is accepted). The equivalent function forms are toHour(timestamp) (likewise toYear, toQuarter, toMonth, toISOWeek, toDayOfMonth, toMinute, toSecond), trimBoth(s) / trimLeft(s) / trimRight(s) (a second argument gives the characters to trim, e.g. trimBoth(s, 'x')), substring(s, 2, 3), and isDistinctFrom(a, b) / isNotDistinctFrom(a, b).
  • Subqueries used inside expressions — IN (SELECT ...), NOT IN, = ANY (...), EXISTS (...) and scalar subqueries — can be nested at most six deep; a query that nests them deeper is rejected with HTTP 400. Subqueries in FROM and JOIN (derived tables) are not counted. Rewrite deep IN chains as JOINs or derived tables.
  • A tenant can run up to three queries at the same time. A further query waits up to 10 seconds for one of them to finish. If none finishes, the request is rejected with HTTP 429 and a Retry-After header; retry after the indicated number of seconds. If the query service as a whole is at capacity, it returns HTTP 503, also with Retry-After. Both are separate from the endpoint’s request rate limit.
  • No SETTINGS, FORMAT, or GLOBAL clauses. IN (SELECT ...) and IN ('a','b') are allowed; IN some_table is not.
  • indexHint(...) is rejected with HTTP 400.
  • $ outside a string literal is rejected with HTTP 400 ($ inside a string literal, such as event_name = 'a$b', is fine).
  • The names equals, and, identity and _CAST cannot be used as an alias name or as a lambda parameter name (for example arrayMap((and, v) -> ..., ...)); a query that does so is rejected with HTTP 400. Calling them as functions (equals(a, b), identity(x)) and using AND as the operator are unaffected.
  • The request’s limit (the default is 1000 on the REST endpoint) caps the number of rows a query returns. A query with its own top-level LIMIT <number>, such as LIMIT 5000 or LIMIT 10 OFFSET 5, keeps that LIMIT instead, even when it is larger. Only when a query has no top-level LIMIT <number> does an OFFSET or FETCH clause (for example ORDER BY timestamp OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY), or a LIMIT amount written as an expression such as LIMIT toUInt32(5), return the smaller of its own amount and limit. A result of more than 10,000 rows is rejected with HTTP 400 in every case.

Only a direct comparison of timestamp or event_name with a constant, written in the WHERE of the SELECT that reads events directly (FROM events), and joined to the other conditions with AND, narrows what a query reads.

Accepted forms:

  • timestamp <op> C, C <op> timestamp, timestamp BETWEEN C AND C, where <op> is =, <, <=, >, >=
  • The same with toDate, toStartOfDay, toStartOfHour, toStartOfMonth, toYYYYMMDD, or toYYYYMM around timestamp
  • event_name = '...', event_name IN ('...', ...)
  • C is built only from string and number literals, now(), today(), yesterday(), INTERVAL n UNIT, + and -, and toDate / toDateTime / toStartOfDay / toStartOfHour / toStartOfMonth of such a constant.
    • A time text must be 'YYYY-MM-DD', optionally followed by a space or T and hh:mm:ss, optionally with up to six fraction digits. The year must be 1900 or later ('1899-12-31' does not narrow). Examples that narrow: '2026-11-01', '2026-11-01 00:00:00', '2026-11-01T00:00:00.5' (a text with fractional seconds narrows only when compared with bare timestamp, not with toStartOfDay(timestamp) or toStartOfHour(timestamp)). A text with a time zone ('2026-11-01T00:00:00Z', +09:00), without seconds ('2026-11-01 00:00'), or naming a day that does not exist does not narrow. All times are UTC.
    • A number must be a whole number (no decimal point). Compared with timestamp it is Unix time in seconds, from 0 to 999,999,999,999: timestamp >= 1767225600 narrows; a date and time written as one number such as 20261101000000 does not. With toYYYYMM(timestamp) it must be a six-digit number (202611), with toYYYYMMDD(timestamp) an eight-digit number (20261101).
    • The two sides must be of matching kinds: toDate(timestamp) and toStartOfMonth(timestamp) compare with a date ('2026-11-01', today(), toDate(...)), not with a text that has a time of day and not with a number; toYYYYMM / toYYYYMMDD compare only with numbers.
    • In INTERVAL n UNIT, n is a whole number and UNIT is one of SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR in the singular. A condition written with a plural unit (INTERVAL 7 DAYS) or a quoted interval (INTERVAL '7 days') does not narrow, but the other conditions of the same WHERE still do.

A condition does not narrow the read when it is under OR, negated (NOT) or wrapped in parentheses, on a joined table, on an alias-qualified column (e.timestamp), inside any other function, in an outer query over a subquery, or in HAVING. Such a condition still filters the result.

Example:

SELECT map_id, count() AS deaths
FROM events
WHERE timestamp >= today() - 7
AND event_name = 'player_death'
AND map_id != ''
GROUP BY map_id

Here, the first two conditions (timestamp and event_name) narrow what is read, while map_id != '' only filters rows after they are read.

Conditions on other columns (player_id, map_id, build_id, …) filter rows after they are read; they do not make a query cheaper. As a rough example of the scale, reading more than around 20 million rows of a range can hit the 2 GB read limit and fail, so always bound queries by time.

A JOIN runs in the order it is written, and the server does not reorder joined tables or swap the two sides. The side written on the right of JOIN is read first and kept in memory while the left side is read, so put the smaller, more tightly filtered side on the right (for example a subquery that already narrows by timestamp and event_name) and the large side on the left. A query with the large side on the right can fail on the per-query memory limit.

The timestamp and event_name conditions of a query narrow nothing at all when the query:

  • contains a lambda anywhere (-> or lambda(...), for example arrayExists(x -> ...));
  • uses a grammar keyword as an alias name after AS (for example count() AS all, AS limit, AS then), or uses SELECT, DISTINCT, BY or PARTITION as an alias name without AS;
  • contains a number written directly against a letter, _ or a trailing dot, such as 1e6, 0x1F or 5. (ordinary decimals such as 59.5 are fine);
  • has a subquery that begins with WITH;
  • uses CASE timestamp WHEN ... or CASE event_name WHEN ... (the form CASE WHEN <condition> THEN ... is fine inside parentheses or outside the WHERE, but not at the WHERE’s own level);
  • defines an alias named timestamp or event_name (for example SELECT fps AS timestamp);
  • is so long or so deeply nested that the database refuses the larger statement the server creates to narrow the read, so the query runs without narrowing.

Nothing in a WHERE narrows the read when that WHERE contains:

  • the word FETCH;
  • an INTERVAL whose amount is computed or in parentheses, such as INTERVAL 7 * 2 DAY or INTERVAL (7) DAY (write INTERVAL 14 DAY instead);
  • a CASE expression or the ? : conditional operator written at the WHERE’s own level, outside parentheses (for example WHERE timestamp >= today() - 7 AND CASE WHEN fps > 30 THEN 1 ELSE 0 END = 1 narrows nothing; the same expression inside parentheses does not stop narrowing).

In all these cases the results are the same; only the amount of data read differs, and with it the speed and whether the query hits the 2 GB read limit.

Results are { "rows": [ { "col": "value" } ], "rowCount": 123 }. The CLI and MCP tool return exactly this shape. Calling the REST endpoint directly gets the standard API envelope around it: { "success": true, "data": { "rows": [...], "rowCount": 123 } }. The MCP query tool caps results at 1000 rows; the REST endpoint and CLI cap at 10000. For larger extracts, page with LIMIT ... OFFSET ... or narrow the timestamp range.

ColumnTypeNotes
event_nameStringEvent name, e.g. player_death, level_start, perf_heartbeat
timestampDateTime64(6)Event time (UTC)
session_idStringPlay-session id
player_idStringStable player/device id
position_x, position_y, position_zFloat32World coordinates
map_idStringMap/level identifier
fpsFloat32Frames per second (perf events)
frame_time_msFloat32Frame time in ms (perf events)
memory_used_bytesInt64Memory in bytes (perf events)
gpu_time_msFloat32GPU time in ms (perf events)
game_thread_msFloat32Game-thread time in ms
render_thread_msFloat32Render-thread time in ms
camera_yaw, camera_pitchNullable(Float32)Camera orientation
sourceStringautomated for the SDK’s own internal events (session_start, perf_heartbeat); player for your Track(...) calls. Not a CI indicator — see Conventions below
build_idStringBuild identifier (perf-diff candidate)
platformStringe.g. windows, android
engine_versionStringEngine/build version string
attributesMap(String, String)Custom string attributes
metricsMap(String, Float64)Custom numeric metrics

Map columns use bracket access: attributes['ci.branch'], metrics['score'].

There is no server_timestamp column. Use timestamp for event time. Selecting an unknown column returns a query error, so check the names above first. A rejected query comes back as HTTP 400 with the ClickHouse diagnostic message (unknown column, table, or function; syntax errors; type mismatches; forbidden operations); only infrastructure failures return 500.

  • The automatic performance event is perf_heartbeat. Filter perf queries with WHERE event_name = 'perf_heartbeat'; not every event carries fps / frame_time_ms.
  • source = 'automated' marks the SDK’s own internal events (session_start, perf_heartbeat) as opposed to your Track(...) calls — it is set on every session, CI or not, and does not identify CI runs by itself.
  • To isolate CI profiling data, filter on build_id or the attributes['ci.*'] tags (set by BeginAutomatedSession/BeginAutomatedSessionFromEnvironment), not on source.
  • CI metadata rides in attributes: attributes['ci.branch'], attributes['ci.commit'], attributes['ci.scenario'], alongside the first-class build_id column.
  • Event names are free-form strings you choose in Track(...). The official SDK samples use snake_case (player_death, level_start); keep one convention across your title.
  • Always bound timestamp using the direct comparison forms above so queries narrow what they read and stay well within the 2 GB read limit.

Active players today:

SELECT uniqExact(player_id) AS dau
FROM events
WHERE timestamp >= today()

Event volume by name over the last 7 days:

SELECT event_name, count() AS events, uniqExact(session_id) AS sessions
FROM events
WHERE timestamp >= today() - 7
GROUP BY event_name
ORDER BY events DESC

Performance percentiles per build:

SELECT build_id,
count() AS samples,
round(quantile(0.50)(fps), 1) AS fps_p50,
round(quantile(0.95)(frame_time_ms), 2) AS frametime_p95_ms
FROM events
WHERE event_name = 'perf_heartbeat'
AND timestamp >= today() - 14
GROUP BY build_id
ORDER BY samples DESC