monitor_schema.models#

Console script for monitor_schema.

Subpackages#

Submodules#

Classes#

DatasetMetric

Metrics that are applicable at the dataset level.

SimpleColumnMetric

Simple column metrics that are basically just a single number.

ComplexMetrics

Sketch-based metrics that can only be processed by certain algorithms.

Analyzer

Configuration for running an analysis.

BaselineType

Supported baseline types.

ReferenceProfileId

A baseline based on a static reference profile.

TimeRangeBaseline

A static time range.

TrailingWindowBaseline

A dynamic trailing window.

SingleBatchBaseline

Using current batch.

DriftConfig

An analyzer using stddev for a window of time range.

DiffConfig

Detecting the differences between two numerical metrics.

ComparisonConfig

Compare whether the target against either an expect value or against the baseline.

ExperimentalConfig

Experimental algorithm that is not standardized by the above ones yet.

FixedThresholdsConfig

Fixed threshold analysis.

ColumnListChangeConfig

Compare whether the target is equal to a value or not.

SeasonalConfig

An analyzer using stddev for a window of time range.

StddevConfig

Calculates upper bounds and lower bounds based on stddev from a series of numbers.

DatasetMatrix

Define the matrix of fields and segments to fan out for monitoring.

ColumnMatrix

Define the matrix of columns and segments to fan out for monitoring.

TargetLevel

Which nested level we are targeting.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

Segment

A segment is a list of tags.

ColumnDiscreteness

Classifying the type.

ColumnDataType

Options for configuring data type for a column.

ColumnSchema

Schema configuration for a column.

WeightConfig

Object that specifies column weights.

SegmentWeightConfig

Object that specifies column weights for a segment.

EntitySchema

Schema definition of an entity.

ImmediateSchedule

Schedule the monitor to run immediately.

CronSchedule

Support for scheduling.

Cadence

Cadence for an analyzer or monitor run.

FixedCadenceSchedule

Support for scheduling based on a predefined cadence.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

Analyzer

Configuration for running an analysis.

EntitySchema

Schema definition of an entity.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

Monitor

Customer specified monitor configs.

Granularity

Supported granularity.

Document

The main document that dictates how the monitor should be run. This document is managed by WhyLabs internally.

CronSchedule

Support for scheduling.

FixedCadenceSchedule

Support for scheduling based on a predefined cadence.

ImmediateSchedule

Schedule the monitor to run immediately.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

GlobalAction

Actions that are configured at the team/organization level.

SendEmail

Action to send an email.

SlackWebhook

Action to send a Slack webhook.

RawWebhook

Action to send a Slack webhook.

AnomalyFilter

Filter the anomalies based on certain criteria. If the alerts are filtered down to 0, the monitor won't fire.

EveryAnomalyMode

Config mode that indicates the monitor will send out individual messages per anomaly.

DigestMode

Config mode that indicates the monitor will send out a digest message.

Monitor

Customer specified monitor configs.

SegmentTag

A single tag key value pair for a segment.

Segment

A segment is a list of tags.

Package Contents#

class monitor_schema.models.DatasetMetric[source]#

Bases: str, enum.Enum

Metrics that are applicable at the dataset level.

profile_count = 'profile.count'#
profile_last_ingestion_time = 'profile.last_ingestion_time'#
profile_first_ingestion_time = 'profile.first_ingestion_time'#
column_row_count_sum = 'column_row_count_sum'#
shape_column_count = 'shape_column_count'#
shape_row_count = 'shape_row_count'#
input_count = 'input.count'#
output_count = 'output.count'#
classification_f1 = 'classification.f1'#
classification_precision = 'classification.precision'#
classification_recall = 'classification.recall'#
classification_accuracy = 'classification.accuracy'#
classification_fpr = 'classification.fpr'#
classification_auroc = 'classification.auroc'#
regression_mse = 'regression.mse'#
regression_mae = 'regression.mae'#
regression_rmse = 'regression.rmse'#
class monitor_schema.models.SimpleColumnMetric[source]#

Bases: str, enum.Enum

Simple column metrics that are basically just a single number.

count = 'count'#
median = 'median'#
max = 'max'#
min = 'min'#
mean = 'mean'#
stddev = 'stddev'#
variance = 'variance'#
unique_upper = 'unique_upper'#
unique_upper_ratio = 'unique_upper_ratio'#
unique_est = 'unique_est'#
unique_est_ratio = 'unique_est_ratio'#
unique_lower = 'unique_lower'#
unique_lower_ratio = 'unique_lower_ratio'#
count_bool = 'count_bool'#
count_bool_ratio = 'count_bool_ratio'#
count_integral = 'count_integral'#
count_integral_ratio = 'count_integral_ratio'#
count_fractional = 'count_fractional'#
count_fractional_ratio = 'count_fractional_ratio'#
count_string = 'count_string'#
count_string_ratio = 'count_string_ratio'#
count_null = 'count_null'#
count_null_ratio = 'count_null_ratio'#
inferred_data_type = 'inferred_data_type'#
quantile_p5 = 'quantile_5'#
quantile_p75 = 'quantile_75'#
quantile_p25 = 'quantile_25'#
quantile_p90 = 'quantile_90'#
quantile_p95 = 'quantile_95'#
quantile_p99 = 'quantile_99'#
class monitor_schema.models.ComplexMetrics[source]#

Bases: str, enum.Enum

Sketch-based metrics that can only be processed by certain algorithms.

histogram = 'histogram'#
frequent_items = 'frequent_items'#
unique_sketch = 'unique_sketch'#
column_list = 'column_list'#
class monitor_schema.models.Analyzer[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Configuration for running an analysis.

An analysis targets a metric (note that a metric could be a complex object) for one or multiple fields in one or multiple segments. The output is a list of ‘anomalies’ that might show issues with data.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
targetSize: int | None#
schedule: monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.FixedCadenceSchedule | None#
disabled: bool | None#
disableTargetRollup: bool | None#
targetMatrix: monitor_schema.models.analyzer.targets.ColumnMatrix | monitor_schema.models.analyzer.targets.DatasetMatrix | None#
dataReadinessDuration: str | None#
batchCoolDownPeriod: str | None#
backfillGracePeriodDuration: str | None#
config: monitor_schema.models.analyzer.algorithms.ConjunctionConfig | monitor_schema.models.analyzer.algorithms.DisjunctionConfig | monitor_schema.models.analyzer.algorithms.DiffConfig | monitor_schema.models.analyzer.algorithms.ComparisonConfig | monitor_schema.models.analyzer.algorithms.ListComparisonConfig | monitor_schema.models.analyzer.algorithms.FrequentStringComparisonConfig | monitor_schema.models.analyzer.algorithms.ColumnListChangeConfig | monitor_schema.models.analyzer.algorithms.FixedThresholdsConfig | monitor_schema.models.analyzer.algorithms.StddevConfig | monitor_schema.models.analyzer.algorithms.DriftConfig | monitor_schema.models.analyzer.algorithms.ExperimentalConfig | monitor_schema.models.analyzer.algorithms.SeasonalConfig#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.BaselineType[source]#

Bases: str, enum.Enum

Supported baseline types.

BatchTimestamp = 'BatchTimestamp'#
Reference = 'Reference'#
TrailingWindow = 'TrailingWindow'#
TimeRange = 'TimeRange'#
CurrentBatch = 'CurrentBatch'#
class monitor_schema.models.ReferenceProfileId[source]#

Bases: _Baseline

A baseline based on a static reference profile.

A typical use case is to use a “gold” dataset and upload its profile to WhyLabs. This can be a training dataset as well for an ML model.

type: Literal[BaselineType]#
profileId: str#
class monitor_schema.models.TimeRangeBaseline[source]#

Bases: _SegmentBaseline

A static time range.

Instead of using a single profile or a trailing window, user can lock in a “good” period.

type: Literal[BaselineType]#
range: monitor_schema.models.commons.TimeRange#
class monitor_schema.models.TrailingWindowBaseline[source]#

Bases: _SegmentBaseline

A dynamic trailing window.

This is useful if you don’t have a static baseline to monitor against. This is the default mode for most monitors.

type: Literal[BaselineType]#
size: int#
offset: int | None#
exclusionRanges: List[monitor_schema.models.commons.TimeRange] | None#
class monitor_schema.models.SingleBatchBaseline[source]#

Bases: _SegmentBaseline

Using current batch.

This is used when you want to use one batch to monitor another batch in a different metric entity.

type: Literal[BaselineType]#
offset: int | None#
datasetId: str#
class monitor_schema.models.DriftConfig[source]#

Bases: AlgorithmConfig

An analyzer using stddev for a window of time range.

This analysis will detect whether the data drifts or not. By default, we use hellinger distance with a threshold of 0.7.

type: Literal[AlgorithmType]#
algorithm: Literal['hellinger', 'jensenshannon', 'kl_divergence', 'psi']#
metric: Literal[ComplexMetrics, ComplexMetrics]#
threshold: float#
minBatchSize: int | None#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.SingleBatchBaseline#
class monitor_schema.models.DiffConfig[source]#

Bases: AlgorithmConfig

Detecting the differences between two numerical metrics.

type: Literal[AlgorithmType]#
mode: DiffMode#
thresholdType: ThresholdType | None#
threshold: float#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.SingleBatchBaseline#
class monitor_schema.models.ComparisonConfig[source]#

Bases: AlgorithmConfig

Compare whether the target against either an expect value or against the baseline.

This is useful to detect data type change, for instance.

type: Literal[AlgorithmType]#
operator: ComparisonOperator#
expected: ExpectedValue | None#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.SingleBatchBaseline | None#
class monitor_schema.models.ExperimentalConfig[source]#

Bases: AlgorithmConfig

Experimental algorithm that is not standardized by the above ones yet.

type: Literal[AlgorithmType]#
implementation: str#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.SingleBatchBaseline#
stub: AlgorithmType | None#
class monitor_schema.models.FixedThresholdsConfig[source]#

Bases: AlgorithmConfig

Fixed threshold analysis.

If user fails to set both upper bound and lower bound, this algorithm becomes a no-op. WhyLabs might enforce the present of either fields in the future.

type: Literal[AlgorithmType]#
upper: float | None#
lower: float | None#
class monitor_schema.models.ColumnListChangeConfig[source]#

Bases: AlgorithmConfig

Compare whether the target is equal to a value or not.

This is useful to detect data type change, for instance.

type: Literal[AlgorithmType]#
mode: Literal['ON_ADD_AND_REMOVE', 'ON_ADD', 'ON_REMOVE'] = 'ON_ADD_AND_REMOVE'#
metric: Literal[ComplexMetrics]#
exclude: List[monitor_schema.models.utils.COLUMN_NAME_TYPE] | None#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.SingleBatchBaseline#
class monitor_schema.models.SeasonalConfig[source]#

Bases: _ThresholdBaseConfig

An analyzer using stddev for a window of time range.

This will fall back to Poisson distribution if there is only 1 value in the baseline.

This only works with TrailingWindow baseline (TODO: add backend validation)

type: Literal[AlgorithmType]#
algorithm: Literal['arima']#
minBatchSize: int | None#
alpha: float | None#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline#
stddevTimeRanges: List[monitor_schema.models.commons.TimeRange] | None#
stddevMaxBatchSize: int | None#
stddevFactor: float | None#
class monitor_schema.models.StddevConfig[source]#

Bases: _ThresholdBaseConfig

Calculates upper bounds and lower bounds based on stddev from a series of numbers.

An analyzer using stddev for a window of time range.

This calculation will fall back to Poisson distribution if there is only 1 value in the baseline. For 2 values, we use the formula sqrt((x_i - avg(x))^2 / n - 1)

type: Literal[AlgorithmType]#
factor: float | None#
minBatchSize: int | None#
baseline: monitor_schema.models.analyzer.baseline.TrailingWindowBaseline | monitor_schema.models.analyzer.baseline.TimeRangeBaseline | monitor_schema.models.analyzer.baseline.ReferenceProfileId#
class monitor_schema.models.DatasetMatrix[source]#

Bases: _BaseMatrix

Define the matrix of fields and segments to fan out for monitoring.

.

type: Literal[TargetLevel]#
class monitor_schema.models.ColumnMatrix[source]#

Bases: _BaseMatrix

Define the matrix of columns and segments to fan out for monitoring.

type: Literal[TargetLevel]#
include: List[ColumnGroups | monitor_schema.models.utils.COLUMN_NAME_TYPE] | None#
exclude: List[ColumnGroups | monitor_schema.models.utils.COLUMN_NAME_TYPE] | None#
profileId: str | None#
class monitor_schema.models.TargetLevel[source]#

Bases: str, enum.Enum

Which nested level we are targeting.

dataset = 'dataset'#
column = 'column'#
class monitor_schema.models.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#
class monitor_schema.models.Segment[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

A segment is a list of tags.

We normalize these in the backend.

tags: List[SegmentTag]#
class monitor_schema.models.ColumnDiscreteness[source]#

Bases: str, enum.Enum

Classifying the type.

discrete = 'discrete'#
continuous = 'continuous'#
class monitor_schema.models.ColumnDataType[source]#

Bases: str, enum.Enum

Options for configuring data type for a column.

integral = 'integral'#
fractional = 'fractional'#
boolean = 'bool'#
string = 'string'#
unknown = 'unknown'#
null = 'null'#
class monitor_schema.models.ColumnSchema[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Schema configuration for a column.

Should be generated by WhyLabs originally but can be overridden by users.

discreteness: ColumnDiscreteness#
dataType: ColumnDataType#
classifier: str | None#
class monitor_schema.models.WeightConfig[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Object that specifies column weights.

  • By default, the weight of a column is None (unspecified)

  • If the weight is unspecified, the column is EXCLUDED when you perform a filter/sort by weight

  • For sorting, unweighted column take the LEAST PRECEDENCE, meaning that weight column have higher priorities

  • They are not hierarchical: if a segment weight config is specified and a column does not have a weight in that

config, we will not use any hierarchy to resolve the value. It will be None - Order of unweighted column is undefined.

weights: Dict[monitor_schema.models.utils.COLUMN_NAME_TYPE, float]#
class monitor_schema.models.SegmentWeightConfig[source]#

Bases: WeightConfig

Object that specifies column weights for a segment.

segment: monitor_schema.models.segments.Segment | None#
class monitor_schema.models.EntitySchema[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Schema definition of an entity.

metadata: monitor_schema.models.commons.Metadata | None#
columns: Dict[monitor_schema.models.utils.COLUMN_NAME_TYPE, ColumnSchema]#
class monitor_schema.models.ImmediateSchedule[source]#

Bases: NoExtrasBaseModel

Schedule the monitor to run immediately.

type: Literal['immediate']#
class monitor_schema.models.CronSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling.

type: Literal['cron']#
cron: str#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.Cadence[source]#

Bases: str, enum.Enum

Cadence for an analyzer or monitor run.

hourly = 'hourly'#
daily = 'daily'#
weekly = 'weekly'#
monthly = 'monthly'#
class monitor_schema.models.FixedCadenceSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling based on a predefined cadence.

type: Literal['fixed']#
cadence: Literal[Cadence, Cadence, Cadence, Cadence]#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#
class monitor_schema.models.Analyzer[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Configuration for running an analysis.

An analysis targets a metric (note that a metric could be a complex object) for one or multiple fields in one or multiple segments. The output is a list of ‘anomalies’ that might show issues with data.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
targetSize: int | None#
schedule: monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.FixedCadenceSchedule | None#
disabled: bool | None#
disableTargetRollup: bool | None#
targetMatrix: monitor_schema.models.analyzer.targets.ColumnMatrix | monitor_schema.models.analyzer.targets.DatasetMatrix | None#
dataReadinessDuration: str | None#
batchCoolDownPeriod: str | None#
backfillGracePeriodDuration: str | None#
config: monitor_schema.models.analyzer.algorithms.ConjunctionConfig | monitor_schema.models.analyzer.algorithms.DisjunctionConfig | monitor_schema.models.analyzer.algorithms.DiffConfig | monitor_schema.models.analyzer.algorithms.ComparisonConfig | monitor_schema.models.analyzer.algorithms.ListComparisonConfig | monitor_schema.models.analyzer.algorithms.FrequentStringComparisonConfig | monitor_schema.models.analyzer.algorithms.ColumnListChangeConfig | monitor_schema.models.analyzer.algorithms.FixedThresholdsConfig | monitor_schema.models.analyzer.algorithms.StddevConfig | monitor_schema.models.analyzer.algorithms.DriftConfig | monitor_schema.models.analyzer.algorithms.ExperimentalConfig | monitor_schema.models.analyzer.algorithms.SeasonalConfig#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.EntitySchema[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Schema definition of an entity.

metadata: monitor_schema.models.commons.Metadata | None#
columns: Dict[monitor_schema.models.utils.COLUMN_NAME_TYPE, ColumnSchema]#
class monitor_schema.models.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#
class monitor_schema.models.Monitor[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Customer specified monitor configs.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
analyzerIds: List[constr(regex='^[A-Za-z0-9_\\-]+$')]#
schedule: monitor_schema.models.commons.FixedCadenceSchedule | monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.ImmediateSchedule#
disabled: bool | None#
severity: int | None#
mode: EveryAnomalyMode | DigestMode#
actions: List[GlobalAction | SendEmail | SlackWebhook | RawWebhook]#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.Granularity[source]#

Bases: str, enum.Enum

Supported granularity.

hourly = 'hourly'#
daily = 'daily'#
weekly = 'weekly'#
monthly = 'monthly'#
class monitor_schema.models.Document[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

The main document that dictates how the monitor should be run. This document is managed by WhyLabs internally.

id: uuid.UUID | None#
schemaVersion: Literal[1]#
metadata: monitor_schema.models.commons.Metadata | None#
orgId: str#
datasetId: str#
granularity: Granularity#
allowPartialTargetBatches: bool | None#
entitySchema: monitor_schema.models.column_schema.EntitySchema | None#
weightConfig: monitor_schema.models.column_schema.EntityWeights | None#
analyzers: List[monitor_schema.models.analyzer.Analyzer]#
monitors: List[monitor_schema.models.monitor.Monitor]#
class monitor_schema.models.CronSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling.

type: Literal['cron']#
cron: str#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.FixedCadenceSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling based on a predefined cadence.

type: Literal['fixed']#
cadence: Literal[Cadence, Cadence, Cadence, Cadence]#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.ImmediateSchedule[source]#

Bases: NoExtrasBaseModel

Schedule the monitor to run immediately.

type: Literal['immediate']#
class monitor_schema.models.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#
class monitor_schema.models.GlobalAction[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Actions that are configured at the team/organization level.

type: Literal['global']#
target: str#
class monitor_schema.models.SendEmail[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Action to send an email.

type: Literal['email']#
target: str#
class monitor_schema.models.SlackWebhook[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Action to send a Slack webhook.

type: Literal['slack']#
target: pydantic.HttpUrl#
class monitor_schema.models.RawWebhook[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Action to send a Slack webhook.

type: Literal['raw']#
target: pydantic.HttpUrl#
class monitor_schema.models.AnomalyFilter[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Filter the anomalies based on certain criteria. If the alerts are filtered down to 0, the monitor won’t fire.

includeColumns: List[monitor_schema.models.utils.COLUMN_NAME_TYPE] | None#
excludeColumns: List[monitor_schema.models.utils.COLUMN_NAME_TYPE] | None#
minWeight: float | None#
maxWeight: float | None#
minRankByWeight: int | None#
maxRankByWeight: int | None#
minTotalWeight: float | None#
maxTotalWeight: float | None#
minAlertCount: int | None#
maxAlertCount: int | None#
includeMetrics: List[monitor_schema.models.utils.METRIC_NAME_STR] | None#
class monitor_schema.models.EveryAnomalyMode[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Config mode that indicates the monitor will send out individual messages per anomaly.

type: Literal['EVERY_ANOMALY']#
filter: AnomalyFilter | None#
class monitor_schema.models.DigestMode[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Config mode that indicates the monitor will send out a digest message.

type: Literal['DIGEST']#
filter: AnomalyFilter | None#
creationTimeOffset: str | None#
datasetTimestampOffset: str | None#
groupBy: List[DigestModeGrouping] | None#
class monitor_schema.models.Monitor[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Customer specified monitor configs.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
analyzerIds: List[constr(regex='^[A-Za-z0-9_\\-]+$')]#
schedule: monitor_schema.models.commons.FixedCadenceSchedule | monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.ImmediateSchedule#
disabled: bool | None#
severity: int | None#
mode: EveryAnomalyMode | DigestMode#
actions: List[GlobalAction | SendEmail | SlackWebhook | RawWebhook]#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.SegmentTag[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

A single tag key value pair for a segment.

key: str#
value: str#
class monitor_schema.models.Segment[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

A segment is a list of tags.

We normalize these in the backend.

tags: List[SegmentTag]#