Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
86ae3cb
chore(appkit): metric-view route skeleton + measures-only SQL (PR2 ph…
atilafassina Jul 9, 2026
e04e857
chore(appkit): metric dimensions + structured filter engine (PR2 phas…
atilafassina Jul 9, 2026
8fb5222
chore(appkit): apply timeGrain via explicit timeDimension (PR2 phase 2b)
atilafassina Jul 9, 2026
14b5816
chore(appkit): metric OBO dispatch + cache-key isolation (PR2 phase 3)
atilafassina Jul 9, 2026
93a4d82
chore(appkit): harden metric route lookup, arg uniqueness, sort key, …
atilafassina Jul 10, 2026
8b22e85
chore(appkit): unify metric-view FQN grammar + quote at SQL interpola…
atilafassina Jul 10, 2026
7cd30dc
chore(appkit): load metric registry lazily with an mtime-validated cache
atilafassina Jul 10, 2026
622baa2
chore(appkit): quote measure/dimension identifiers + close review-rou…
atilafassina Jul 10, 2026
92b6673
refactor(appkit): split metric runtime modules
atilafassina Jul 10, 2026
e4d448f
refactor(appkit): derive metric operator sets from shared bases
atilafassina Jul 20, 2026
94fe04f
chore: adjust comments
atilafassina Jul 20, 2026
e7ffb3f
docs: metric-view runtime endpoint (#484)
atilafassina Jul 21, 2026
daf8081
fix(analytics): reject empty and-group in metric filter validation
atilafassina Jul 21, 2026
b475283
refactor(analytics): route metric-view config reads through AppManager
atilafassina Jul 21, 2026
ed7d3bd
fix(analytics): json-encode measures/dimensions in metric cache key
atilafassina Jul 21, 2026
f2ec598
fix(analytics): render empty AND filter group as vacuous-true
atilafassina Jul 21, 2026
329c7f6
chore: adjust comments
atilafassina Jul 21, 2026
2d1b0e9
refactor(analytics): read metric-views.json per request, drop mtime c…
atilafassina Jul 21, 2026
610801a
chore(appkit): relocate metric-view config to config/metric-views/def…
atilafassina Jul 22, 2026
487e615
refactor(analytics): hoist definitions.json filename to shared METRIC…
atilafassina Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://databricks.github.io/appkit/schemas/metric-source.schema.json",
"metricViews": {
"revenue": {
"source": "appkit_demo.public.revenue_metrics"
Expand Down
19 changes: 19 additions & 0 deletions apps/dev-playground/shared/appkit-types/metric-views.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,31 @@ declare module "@databricks/appkit-ui/react" {
measures: {
"active_accounts": {
type: "bigint";
display_name: "Active Accounts";
format: "#,##0";
};
"churn_rate": {
type: "decimal";
display_name: "Churn Rate";
};
"avg_ltv": {
type: "double";
display_name: "Average LTV";
format: "$#,##0.00";
};
};
dimensions: {
"segment": {
type: "string";
display_name: "Customer Segment";
};
"region": {
type: "string";
display_name: "Region";
};
"csm_email": {
type: "string";
display_name: "CSM Email";
};
};
};
Expand Down Expand Up @@ -80,27 +88,38 @@ declare module "@databricks/appkit-ui/react" {
measures: {
"mrr": {
type: "double";
display_name: "Monthly Recurring Revenue";
format: "$#,##0.00";
};
"arr": {
type: "double";
display_name: "Annual Recurring Revenue";
format: "$#,##0.00";
description: "Annualized contract value across all active subscriptions";
};
"new_arr": {
type: "double";
display_name: "New ARR";
format: "$#,##0.00";
};
"churned_arr": {
type: "double";
display_name: "Churned ARR";
format: "$#,##0.00";
};
};
dimensions: {
"region": {
type: "string";
display_name: "Region";
};
"segment": {
type: "string";
display_name: "Customer Segment";
};
"created_at": {
type: "timestamp_ltz";
display_name: "Subscription Start";
time_grain: readonly ["day", "hour", "minute", "month", "quarter", "week", "year"];
};
};
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/development/type-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ In blocking mode the generator starts a stopped warehouse, waits (bounded) for i

## Metric-view types

`generate-types` (and the Vite plugin) emit metric-view types **additively** — there is no separate command. When a `config/queries/metric-views.json` file is present, the same run that generates your query types also DESCRIBEs each declared [UC Metric View](../plugins/analytics.md) and writes `metric-views.d.ts` into `shared/appkit-types/`:
`generate-types` (and the Vite plugin) emit metric-view types **additively** — there is no separate command. When a `config/metric-views/definitions.json` file is present, the same run that generates your query types also DESCRIBEs each declared [UC Metric View](../plugins/analytics.md) and writes `metric-views.d.ts` into `shared/appkit-types/`:

- `metric-views.d.ts` — augments the `MetricRegistry` interface so `useMetricView('<key>', …)` is autocompleted and type-checked. Each view's measures, dimensions, and their semantic metadata (SQL type, display name, format, time grains) are encoded at the type level.

If `metric-views.json` is absent the metric path stays dormant (nothing is emitted). When present it follows the **same** warehouse-readiness contract as query types: in the default non-blocking run a view that can't be described yet — a cold warehouse, or a bad/unreachable source — is written with permissive types and a warning, while under `--wait` that same situation fails the build so CI never ships incomplete metric types. A malformed `metric-views.json` (invalid JSON, or a source that isn't a three-part UC FQN) fails fast in every mode.
If `config/metric-views/definitions.json` is absent the metric path stays dormant (nothing is emitted). When present it follows the **same** warehouse-readiness contract as query types: in the default non-blocking run a view that can't be described yet — a cold warehouse, or a bad/unreachable source — is written with permissive types and a warning, while under `--wait` that same situation fails the build so CI never ships incomplete metric types. A malformed `definitions.json` (invalid JSON, or a source that isn't a three-part UC FQN) fails fast in every mode.

`metric-views.json` is keyed by metric key; each entry names the three-part UC FQN of the view and, optionally, the executor it runs as (`app_service_principal`, the default, or `user`):
`definitions.json` is keyed by metric key; each entry names the three-part UC FQN of the view and, optionally, the executor it runs as (`app_service_principal`, the default, or `user`):

```json
{
Expand Down
Loading
Loading