POST /v1/projects/{projectId}/query and the MCP tool
run_query run one read-only ClickHouse SELECT over the project’s own telemetry.
Dashboards keep queries and preset views as panels over one time range.
Search logs
Explore opens on Logs: find log records without writing SQL, on every plan. A few words make the search:
A field is one of the record’s own (
event.name, service.name, service.version,
app.build_id, os.name, os.version, device.model.identifier, session.id,
app.installation.id, trace_id, span_id, severity.text, country), a resource attribute
with the resource. prefix, or any other attribute. The Fields list shows the attribute keys of
the last day and their most common values: a value adds its filter. The records come newest
first with their volume per interval by severity, and each opens to its attributes and its
session.
The same search is POST /v1/projects/{projectId}/explore/logs with severity, body,
filters (up to 20) and a time range of up to 90 days within your detail retention. Apsio
writes the SQL from those fields and sends every value as a query parameter; the SQL comes back
in the answer to read, or to open in the SQL tab. A search stops at 10 seconds and 10,000 rows,
and a project runs 60 a minute per caller.
Live tail
Live tail on the Logs page shows the records that match the search as they arrive, on every plan. Turn it On above the records: new ones come in at the top, the last 200 stay on the page, and the page says how many devices are streaming, that is how many installs sent a matching record in the last minute.- One device or user. Enter a user hash or an install id in Tail one device or user, or choose Tail on a record to follow its user (or its install, when it has no user hash). All devices goes back to the whole fleet.
- What it shows. The tail reads the stored records; nothing streams from the devices. A record shows once ingest has stored it, from a few seconds to about 30 seconds after the device sent it. A record that waited more than an hour to be stored (an ingest backlog) is not tailed.
- When it stops. After 15 minutes without activity on the page it turns itself off. While the tab is hidden it waits, and a tab hidden for more than 2 minutes starts again from now. A poll that fails on the network or the server is tried three more times before the tail stops and says so; a refused one stops it at once.
- From a terminal. Copy tail command copies the same search as a command for the CLI.
POST /v1/projects/{projectId}/explore/logs/tail, polled every 2 seconds. It
takes Explore’s app_id, build and filters with severity, body, device (an install id
or a user hash) and cursor, the next_cursor of the poll before. The first poll, without a
cursor, answers the last records of the last 5 minutes. Each answer has at most 200 new lines,
oldest first (one with resent also holds up to 2,000 lines of the last 2 minutes again), and:
Every record, here and in Search logs, carries its
installation_id, the install that wrote
it. A project takes 40 tail polls a minute per caller, apart from the searches’ 60; past it the
answer is 429 with Retry-After: 2. A project token, an agent’s OAuth token and a console
session can all tail.
Chart metrics
Metrics charts one metric of the project per interval, on every plan. Pick it from the metrics the apps sent in the last 7 days, then how to aggregate each interval:
Sums and histograms are read as delta points; cumulative points are left out. Group by a field
(
service.version, os.name, os.version, device.model.identifier, country, …) or an
attribute to split the chart into the 10 largest groups, with the rest as one more series, and
filter with the same key:value, -key:value and has:key words as logs. The same chart is
POST /v1/projects/{projectId}/explore/metrics, and the metrics to pick from are at
GET /v1/projects/{projectId}/explore/metrics/catalog.
Search spans
Traces finds spans without writing SQL, on every plan: the SDK’sapp.start,
app.screen.load and HTTP client spans, and any span your code starts with the OpenTelemetry
tracer. A few words make the search:
A field is one of the span’s own (
span.name, span.kind, span.status_code, service.name,
service.version, app.build_id, os.name, os.version, device.model.identifier,
session.id, app.installation.id, trace_id, span_id, parent_span_id, http.request.method,
url.template, country), a resource attribute with the resource. prefix, or any other
attribute; the Fields list shows the span attribute keys of the last day. The spans come newest
or slowest first, each with its kind and status, with their count, failures, and median and
95th percentile duration per interval, and each opens its trace.
The same search is POST /v1/projects/{projectId}/explore/traces with filters, errors_only,
root_only, min_duration_ms, max_duration_ms and sort (recent or slowest), with the
same time range, SQL and limits as logs. The suggestions are
GET /v1/projects/{projectId}/explore/fields with signal=spans.
What a query reads
Six tables, with only the project’s own rows:
Each table’s columns and their ClickHouse types are in Explore’s table list and at
GET /v1/projects/{projectId}/query/schema. Reads stop at your plan’s
retention: detail for logs, spans and metrics, crashes and
release health for sessions and occurrences.
The examples Explore starts from:
ts whenever you can: a query that reads less runs faster and stays within its limits.
What a query cannot do
The database decides what a query may read, not a parser of your SQL. The query runs as a ClickHouse user of the project whose grants reach the six tables’ own columns and nothing else, whose row policies keep it to the project and your plan’s retention, and whose limits it cannot change:- One
SELECT. A write,SET,SETTINGS,FORMAT,INTO OUTFILEor a second statement is refused. - No other table. No other database or system table, no dictionary, and no virtual column
such as
_partor_part_offset, which would count other tenants’ rows.merge()is refused too. - Attributes by key.
attributes['http.route'],mapContains(attributes, 'k')andmapKeys(attributes)work on every table’s attribute maps; a map’s subcolumns by name (attributes.keys,attributes.values) are refused: usemapKeysandmapValues. - No outside source. Table functions that read elsewhere (
url,s3,remote,file,mysqland the like) are refused. Generators that read nothing (numbers,values,generateRandom,view) work, within the read limit.
Limits
The project also has a share of the server per minute and per hour, so one project’s queries
cannot slow down another’s.
The rows and bytes a query read come back rounded to two significant digits, and 64-bit integers
as strings.
Audit
Every query is written to your organization’s audit log before it runs, asquery.run: the
project, who ran it (a user or a token), how (the console, a token, OAuth or MCP, with the
tool), and the SHA-256 and length of its SQL. Never its text, and never a row of its result.
A time range
Send arange ({"from": "...", "to": "..."}, RFC 3339, at most 90 days) and three
placeholders take its values, as ClickHouse query parameters, never as text in your SQL:
range says what the placeholders were.
Dashboards fill them with the board’s time range.
Dashboards
A dashboard is a board of panels over one time range: 1 hour, 24 hours, 7 days or 30 days. A project has at most 20 dashboards, and a dashboard at most 24 panels. Each panel is drawn as a line, bars, one number or a table, with the columns to draw, a unit and an optional threshold line.
The presets:
A panel runs when the board opens, when the range changes and on Refresh, two at a time; a
board can refresh itself every 5 minutes. A result is kept in the API for a minute, so a board
reopened within it costs no query. No result is stored: retention and erasure apply to
dashboards as to everything else.
Compare with the previous period. The board’s checkbox shows each panel beside the same length
of time just before its range, on the panel’s own axis: dashed on a line, a second bar, the
previous figure under a stat or the vitals. Each compared panel runs twice, and a SQL panel’s
second run counts toward your plan’s query rate as the first does. Tables, charts of categories,
panels with more than three lines, release health, SQL that does not use
{from} or {to} and
per-day charts over a range under a day say they are not compared. A period that
reaches past your plan’s retention shows only what is kept, so it can read lower than it was.
Who edits. Every member creates boards and edits boards and panels; owners and admins delete
them. A project’s changes are limited to 20 a minute per person, and each one is in the audit
log.
Agents. Agents read boards with list_dashboards, get_dashboard and
run_dashboard_panel, and write them with create_dashboard, add_panel, update_panel and
delete_panel once you grant their client dashboard writes in Settings › Agents and tokens.
Without a grant a write is refused with grant_required and a link to that page. The agent keeps
your role, and a grant unused for 90 days expires; see Letting an agent
write. A project token writes only when created with the
dashboards:write scope (Settings › Agents and tokens (Access tokens)), and never deletes.
Board names, panel titles and SQL can be written by anyone in the project. The console shows
them as text, and MCP returns them as untrusted data.
From an agent or a script
get_query_schema and run_query; see
Agents.