Metrics Review
v0.5.5Full-page metrics and baseline review block. Displays AI-generated monitoring metrics with SQL/API/cross-source formulas, baseline configuration, and batch progress tracking.
Preview
Install & usage
npx shadcn@latest add @signalos/metrics-01Pulls the page source plus its widget dependencies (@signalos/tokens, @signalos/utils, @signalos/button, @signalos/badge, @signalos/dialog, @signalos/select, @signalos/checkbox, @signalos/input, @signalos/label, @signalos/tooltip, @signalos/textarea, @signalos/split-panel) into your app - you own the copy. Requires access.
usage
// after: npx shadcn@latest add @signalos/metrics-01
// mount the pulled page in a route, e.g. src/app/semantics-details/page.tsx
import MetricsReview from "@/components/blocks/metrics-01/MetricsReview"
export default function Page() {
return <MetricsReview />
}Props
CompositeAction
| Prop | Type | Default | Description |
|---|---|---|---|
| connector_id | string | undefined | - | |
| action_sql | string | undefined | - | |
| sql | string | undefined | - | |
| label | string | undefined | - | |
| result_label | string | undefined | - | |
| result_value | string | number | null | undefined | - | |
| action | string | undefined | - | |
| resource | string | undefined | - | |
| filter_field | string | undefined | - | |
| filter_value | string | undefined | - | |
| extract_field | string | undefined | - | |
| action_input | Record<string, unknown> | undefined | - | |
| ratio | unknown | - | |
| computation | unknown | - | |
| expected_result_type | string | undefined | - |
MetricActionInput
| Prop | Type | Default | Description |
|---|---|---|---|
| sql | string | undefined | - | |
| action | string | undefined | - | |
| resource | string | undefined | - | |
| connector_id | string | undefined | - | |
| filter_field | string | undefined | - | |
| filter_value | string | undefined | - | |
| extract_field | string | undefined | - | |
| action_input | Record<string, unknown> | undefined | - | |
| result_label | string | undefined | - | |
| result_value | string | number | null | undefined | - |
MetricFormulaAction
| Prop | Type | Default | Description |
|---|---|---|---|
| action | string | undefined | - | |
| resource | string | undefined | - | |
| input | { [key: string]: unknown; sql?: string | undefined; action_a?: MetricActionInput | undefined; action_b?: MetricActionInput | undefined; } | undefined | - | |
| filter_field | string | undefined | - | |
| filter_value | string | undefined | - | |
| extract_field | string | undefined | - | |
| expected_result_type | string | undefined | - | |
| ratio | unknown | - |
MetricComputation
| Prop | Type | Default | Description |
|---|---|---|---|
| expression | string | undefined | - |
SemanticMetric
| Prop | Type | Default | Description |
|---|---|---|---|
| metric_name* | string | - | |
| display_name | string | undefined | - | |
| description | string | undefined | - | |
| unit | string | undefined | - | |
| direction | MetricDirection | undefined | - | |
| current_value | string | number | null | undefined | - | |
| baseline_value | number | null | undefined | - | |
| baseline_stddev | number | null | undefined | - | |
| baseline_deviation | number | null | undefined | - | |
| baseline_window | BaselineWindow | undefined | - | |
| baseline_alpha | number | undefined | - | |
| baseline_sample_count | number | undefined | - | |
| baseline_source | string | undefined | - | |
| baseline_sql | string | undefined | - | |
| validation_status | MetricValidationStatus | undefined | - | |
| validation_error | string | undefined | - | |
| confidence | number | undefined | - | |
| is_anomalous | boolean | undefined | - | |
| is_cross_source | boolean | undefined | - | |
| cross_cluster | boolean | undefined | - | |
| source_cluster | string | undefined | - | |
| formula_action | MetricFormulaAction | undefined | - | |
| formula_human | string | undefined | - | |
| source_entities | string[] | undefined | - | |
| composite_actions | CompositeAction[] | undefined | - | |
| computation | string | MetricComputation | undefined | - | |
| metric_type | string | undefined | - | |
| reasoning | string | undefined | - | |
| join_paths | { from_table: string; from_column: string; to_table: string; to_column: string; join_type: string; }[] | undefined | - | |
| bridge_used | string | undefined | - | |
| signal_candidates | string[] | undefined | - | |
| related_metrics | string[] | undefined | - | |
| action_type | MetricActionType | undefined | - | |
| formula_sql | string | undefined | - | |
| review_origin | string | undefined | - |
MetricReviewItem
| Prop | Type | Default | Description |
|---|---|---|---|
| index* | number | - | |
| status* | "accepted" | "flagged" | "deleted" | - | |
| feedback* | string | - | |
| edits* | Partial<SemanticMetric> | - |
MetricReviewDecision
| Prop | Type | Default | Description |
|---|---|---|---|
| status* | "accepted" | "flagged" | - | |
| feedback* | string | - | |
| edits* | Partial<SemanticMetric> | - |
SqlTestResult
| Prop | Type | Default | Description |
|---|---|---|---|
| status* | "success" | "error" | "loading" | "idle" | - | |
| result | unknown | - | |
| baselineValue | number | null | undefined | - | |
| error | string | undefined | - |
MetricItemEdits
| Prop | Type | Default | Description |
|---|---|---|---|
| metric_name* | string | - | |
| display_name | string | undefined | - | |
| description | string | undefined | - | |
| unit | string | undefined | - | |
| direction | MetricDirection | undefined | - | |
| note | string | undefined | - | |
| action_type | MetricActionType | undefined | - | |
| formula_sql | string | undefined | - | |
| formula_action | Record<string, unknown> | MetricFormulaAction | undefined | - | |
| is_cross_source | boolean | undefined | - | |
| composite_actions | Record<string, unknown>[] | undefined | - | |
| computation | Record<string, unknown> | undefined | - |
SubmitMetricsReviewPayload
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | "confirm" | "retry" | - | |
| items | MetricReviewItem[] | undefined | - |
CreateSemanticMetricPayload
| Prop | Type | Default | Description |
|---|---|---|---|
| metric_name* | string | - | |
| display_name | string | undefined | - | |
| description | string | undefined | - | |
| unit | string | undefined | - | |
| direction | MetricDirection | undefined | - | |
| formula_action | MetricFormulaAction | undefined | - |
AddMetricPayload
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | "add_item" | "improve_new_item" | - | |
| connector_id* | string | - | |
| feedback | string | undefined | - | |
| item_edits* | MetricItemEdits | - |
AddMetricResponse
| Prop | Type | Default | Description |
|---|---|---|---|
| item | SemanticMetric | undefined | - | |
| soft_warning | string | undefined | - |
BaselineConfig
| Prop | Type | Default | Description |
|---|---|---|---|
| window* | BaselineWindow | - | |
| alpha* | number | - | |
| date_column_preference | string | undefined | - |
MetricsBatchInfo
| Prop | Type | Default | Description |
|---|---|---|---|
| batch_num* | number | - | |
| total_batches* | number | - | |
| metrics_in_batch* | number | - | |
| all_batches_complete | boolean | undefined | - |
MetricsFdeInput
| Prop | Type | Default | Description |
|---|---|---|---|
| items* | MetricReviewItem[] | - |
MetricSqlTestResult
| Prop | Type | Default | Description |
|---|---|---|---|
| status* | "success" | "error" | - | |
| metric_name | string | undefined | - | |
| current_value | string | number | null | undefined | - | |
| baseline_value | number | null | undefined | - | |
| validation_status | string | undefined | - | |
| validation_error | string | undefined | - | |
| sql | string | undefined | - |
MetricCatalogEntry
| Prop | Type | Default | Description |
|---|---|---|---|
| display_name | string | undefined | - | |
| description | string | undefined | - | |
| direction | MetricDirection | undefined | - | |
| unit | string | undefined | - | |
| connector_id | string | undefined | - | |
| source_cluster | string | undefined | - | |
| is_cross_source | boolean | undefined | - | |
| source_entities | string[] | undefined | - | |
| sql_logic | string | undefined | - |
MetricAddFormCompositeAction
| Prop | Type | Default | Description |
|---|---|---|---|
| result_label* | string | - | |
| kind* | "sql" | "api" | - | |
| connector_id* | string | - | |
| body* | string | - |
MetricAddFormState
| Prop | Type | Default | Description |
|---|---|---|---|
| type* | MetricActionType | - | |
| metric_name* | string | - | |
| display_name* | string | - | |
| description* | string | - | |
| unit* | string | - | |
| direction* | MetricDirection | - | |
| note* | string | - | |
| aiNote* | string | - | |
| sqlConnectorId* | string | - | |
| sql* | string | - | |
| apiConnectorId* | string | - | |
| formulaAction* | string | - | |
| composite* | MetricAddFormCompositeAction[] | - | |
| expression* | string | - | |
| method* | string | - | |
| interpretation* | string | - |
ActionState
| Prop | Type | Default | Description |
|---|---|---|---|
| loading | boolean | undefined | - | |
| value | unknown | - | |
| error | string | undefined | - |
MetricDetailViewProps
| Prop | Type | Default | Description |
|---|---|---|---|
| selectedMetric* | SemanticMetric | - | |
| sqlTestResults* | Record<number, SqlTestResult> | - | |
| actionResults* | Record<number, { a?: ActionState | undefined; b?: ActionState | undefined; }> | - | |
| selectedMetricIdx* | number | - | |
| copiedSql* | boolean | - | |
| expandedSql* | Record<number, boolean> | - | |
| onCopySql* | (sql: string) => void | - | |
| onExecuteMetric* | (idx: number) => void | - | |
| onExecuteAction* | (idx: number, side: "a" | "b") => void | - | |
| onExecuteBothActions* | (idx: number) => void | - |
Supporting types
export type MetricDirection = "up_is_good" | "down_is_good" | "neutral"
export type MetricValidationStatus = "validated" | "healed" | "failed"
export type BaselineWindow = "7d" | "30d" | "90d" | "6mo" | "1y" | "all"
export type MetricActionType = "sql" | "api" | "cross_source"
export type MetricUnit = | "count" | "percent" | "percentage" | "ratio" | "rate" | "currency" | "index" | "seconds" | "minutes" | "hours" | "days" | "months" | "years" | "score" | "bytes"
export type MetricCatalog = Record<string, MetricCatalogEntry>
export type MetricAddFormErrors = Partial< Record<keyof MetricAddFormState | "composite", string> >
More Semantics Stages variants
Changelog
0.5.5
- Lint issues resolved
0.5.4
- Decompose
MetricsReviewintoMetricDetailPanel,MetricsPageHeader,MetricAddDialog,MetricEditForm,MetricQueueList, andMetricDetailViewsubcomponents. - Extract field groups into
MetricBasicFields,MetricApiFields,MetricSqlFields,MetricCrossSourceFields; extractMetricApiActionEditor,MetricSqlEditor,MetricCompositeActions, andMetricTypeSelector.
0.5.3
- Replace raw scale token classes with semantic tokens (text-text-error, bg-bg-success, border-border-warning, etc.) to respect client theme overrides.
0.5.2
- Fix file casing: rename Metrics.types.ts to match PascalCase import paths.
0.5.1
- Change onSetEditedSql and onSetEditedCompositeSql prop types from React.Dispatch<SetStateAction<...>> to plain value callbacks, removing the leaked setter type from the public API.
0.4.1
0.4.0
- Replace
grid grid-cols-1 lg:grid-cols-12layout withSplitPanelwidget for the queue/detail split. - Add
@signalos/split-paneltoregistryDependencies.
0.3.0
- Refactor: lift all form state, validation, composite action mutations, and async submit logic out of
MetricAddDialogintoMetricsReview(parent). MetricAddDialogis now fully presentational — receives controlledform,errors,formError,activeTypeDesc, and individual change/submit callbacks as props.- Extract
getCompositeActionshelper toMetrics.utils.ts;MetricDetailViewandMetricEditFormnow import it instead of duplicating the derivation inline. - Added
MetricAddFormState,MetricAddFormCompositeAction,MetricAddFormErrorstometrics.types.ts.
0.2.0
- Breaking: Remove
pipelineIdprop — was unused internally. - Breaking:
MetricAddDialognow exportsConnectorLikeinstead of re-importingConnectorConfigfromsemantics-details-01; callers only need{ connector_id: string }. - Fix
registry-item.jsonfiles list — was incorrectly pointing atcross-source-01paths. - Fix description and
lucide-reactversion range in manifest; add missing@signalos/textareadep. - Replace raw palette tokens (
error-*,success-*,info-*,navy-*) with semantic tokens throughoutMetricsReview.tsxandMetricAddDialog.tsx. - Add
notefield toMetricItemEditsto match whatMetricAddDialogsubmits. - Remove dead
handleImproveWithAifunction andisImprovingstate.
0.1.0
Initial release.