public-api
public-metrics

Create Metric

Create a new metric.

Requires read-write or admin scope. Accepts asset UUID, qualified name (e.g., "postgresql.mydb"), or asset name.

SDK Usage:

from anomalyarmor import Client
client = Client()
metric = client.metrics.create(
    "asset-uuid",
    metric_type="null_percent",
    table_path="catalog.schema.table",
    column_name="email",
)
post/api/v1/sdk/metrics/{asset_id}

Request

  • Base URL: http://localhost:8000
  • URL: http://localhost:8000/api/v1/sdk/metrics/{asset_id}
  • Auth: none declared

Path parameters

asset_idstring required

Headers

Authorizationstring

Request body

table_pathstring required

Fully qualified table path

column_namestring nullable

Column name (NULL for table-level metrics)

time_columnstring nullable

Column containing timestamp/date for time-windowed queries. When set, metric queries filter by this column using capture_interval bounds.

metric_type'distinct_count' | 'null_percentage' | 'mean' | 'sum' | 'min' | 'max' | 'duplicate_count' | 'duplicate_percent' | 'percentile' required

Types of metrics that can be tracked.

Statistical metrics compute aggregate values over time with ML-based anomaly detection.

capture_intervalstring required

Capture interval (hourly, daily, weekly, or cron)

group_by_columnsstring[] nullable

Optional dimensional grouping columns

sensitivityinteger

Stddev multiplier for anomaly detection (1-5)

operating_period_mode'off' | 'auto' | 'schedule'

Operating-period awareness (TECH-984): 'off' pools all history, 'schedule' segments by operating_schedule_id, 'auto' learns a calendar from history

operating_schedule_idstring uuid nullable

Public UUID of the operating schedule (required for 'schedule' mode)

Response

Successful Response

successboolean required
dataunknown
messagestring nullable
errorstring nullable
metaobject nullable

Changes

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