Skip to content

docs: metric-view runtime endpoint#484

Merged
atilafassina merged 3 commits into
mv-runtimefrom
docs/mv-runtime
Jul 21, 2026
Merged

docs: metric-view runtime endpoint#484
atilafassina merged 3 commits into
mv-runtimefrom
docs/mv-runtime

Conversation

@atilafassina

Copy link
Copy Markdown
Contributor

Stacked on #474 (base mv-runtime).

Documents the user-facing surface of the metric-view runtime that #474 adds — the POST /api/analytics/metric/:key endpoint — in the analytics plugin docs.

What's here

A new Metric views section in docs/docs/plugins/analytics.md covering:

  • The endpoint and its request body (measures, dimensions, filter, timeGrain/timeDimension, limit, format), with a field table.
  • How the request becomes SQL — a worked example showing the SELECT MEASURE(...) ... GROUP BY ALL the plugin builds, noting FQN/identifier backtick-quoting and parameter binding.
  • Filters — the recursive and/or tree and the full v1 operator vocabulary as a table, plus the cardinality/depth caps.
  • Executorsapp_service_principal (shared cache) vs user (per-user OBO cache), fixed by metric-views.json.
  • Response — the shared SSE envelope (warehouse_statusresult), cross-linked to the existing warehouse-readiness docs.
  • Errors and behavior — the 404 / 400 / 503 responses, dormant-when-absent, and hot-reload on edit.

Every SQL/JSON example is grounded in the runtime handler and the metric test suite, not invented.

Scope

  • Runtime endpoint only. No React hook ships on this branch, so no hook docs — those land with the hook PR.
  • The config half (declaring metric-views.json, type generation) is already documented in type-generation.md#metric-view-types; this section links to it rather than repeating it.
  • Docs only — no source changes.

Verification

  • pnpm docs:build — succeeds, no broken-link/anchor errors.
  • pnpm docs:check — clean.

This pull request and its description were written by Isaac.

Add a Metric views section to the analytics plugin docs covering the
POST /api/analytics/metric/:key runtime endpoint: request body, the
structured-request-to-SQL translation, the filter operator vocabulary,
executor cache scopes, the SSE response envelope, and error/behavior
cases. Also list the endpoint in the HTTP endpoints index.

Runtime endpoint only; the React hook and its docs land with a later PR.

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
@atilafassina
atilafassina requested a review from a team as a code owner July 20, 2026 14:56
@atilafassina
atilafassina requested review from calvarjorge and Copilot and removed request for a team July 20, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation for the Analytics plugin’s new Metric Views runtime endpoint (POST /api/analytics/metric/:key), describing the request shape, SQL translation behavior, filter grammar/operator vocabulary, executor/cache scope, SSE response envelope, and error semantics.

Changes:

  • Documented the new metric-view runtime endpoint, including request fields and validation constraints.
  • Added a worked “request → SQL” example, including identifier quoting and parameter binding.
  • Documented filter structure/operators, executor behavior, SSE response shape, and error cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/docs/plugins/analytics.md Outdated
Comment thread docs/docs/plugins/analytics.md Outdated
Comment thread docs/docs/plugins/analytics.md
…roup semantics

Address Copilot review feedback on PR #484:
- format: JSON is accepted as a deprecated alias for JSON_ARRAY; only
  Arrow formats are rejected on this route.
- contains/notContains render as LIKE :param with the %...% wrapping in
  the bound value, not literal interpolation.
- empty or: [] is rejected 400 while empty and: [] is a no-op.

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
@atilafassina
atilafassina merged commit da0dbf8 into mv-runtime Jul 21, 2026
@atilafassina
atilafassina deleted the docs/mv-runtime branch July 21, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants