Servers

Read-only ClickHouse SQL over this server's analytics relations (see the catalog). One SELECT per request; tenancy and plan retention are enforced inside ClickHouse. At most 2 SQL requests run at once per organization: a third waits up to 2.5 s, then answers 429 with details. Requires server:read.

post/api/v1/servers/{id}/analytics/sql

Request

  • Base URL: https://cloud.manufact.com
  • URL: https://cloud.manufact.com/api/v1/servers/{id}/analytics/sql
  • Auth: none declared

Path parameters

idstring uuid required

Request body

sqlstring required

One ClickHouse SELECT (or UNION) over the analytics relations: events: Raw gateway events, one row per request. Drill-down only: each query may read at most 20M rows (about one day of the busiest server). Use the rollups for aggregates. metrics_hourly: Hourly cube of every event ingredient (100 days). Additive columns are sums: use sum(events), never count(). Sketch columns need their -Merge function. metrics_daily: Daily cube of every event ingredient (400 days), same columns as metrics_hourly. sessions_daily: Narrow daily rollup for headline sessions and actors by client, country and branch. Segments map to traffic_class. sessions_hourly: Narrow hourly rollup for headline sessions and actors by client and branch (100 days, no country). Prefer it to metrics_hourly for windows up to 2 days. clients_daily: Narrow daily rollup for headline sessions, actors and latency by client, client and protocol version and branch (no country). The narrowest daily relation for headline numbers. tool_health_daily: Narrow daily rollup for per-tool and per-client health and tokens: error classes, latency digests and output tokens by method, resource and client. tool_interactions: Exact tool index: one row per (server, tool, hour, interaction). Answers 'sessions that used tool X' exactly at any window: uniqExact(interaction_id). actors_hourly: Account or token actor activity on tools/call events, by client, tool and branch. Full-period user rankings use sums and merged session sketches. actors_daily: Account or token actor activity on tools/call events, by client, tool and branch. Full-period user rankings use sums and merged session sketches.

branchstring
includeInternalboolean
maxRowsinteger

Response

OK

queryIdstring required
truncatedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.