monitor_schema.models.monitor#
Schema for configuring a monitor.
Attributes#
Classes#
Support for scheduling. |
|
Support for scheduling based on a predefined cadence. |
|
Schedule the monitor to run immediately. |
|
Metadata for a top-level objects such as monitors, analyzers, and schema. |
|
No extras base model. |
|
Metadata related to a monitor. |
|
Actions that are configured at the team/organization level. |
|
Action to send an email. |
|
Action to send a Slack webhook. |
|
Action to send a Slack webhook. |
|
Filter the anomalies based on certain criteria. If the alerts are filtered down to 0, the monitor won't fire. |
|
Config mode that indicates the monitor will send out individual messages per anomaly. |
|
Enable the ability to group digest by various fields. |
|
Config mode that indicates the monitor will send out a digest message. |
|
Customer specified monitor configs. |
Functions#
|
Turn anyOf in JSON schema to oneOf. |
Module Contents#
- class monitor_schema.models.monitor.CronSchedule[source]#
Bases:
NoExtrasBaseModel
Support for scheduling.
- type: Literal['cron']#
- class monitor_schema.models.monitor.FixedCadenceSchedule[source]#
Bases:
NoExtrasBaseModel
Support for scheduling based on a predefined cadence.
- type: Literal['fixed']#
- cadence: Literal[Cadence, Cadence, Cadence, Cadence]#
- class monitor_schema.models.monitor.ImmediateSchedule[source]#
Bases:
NoExtrasBaseModel
Schedule the monitor to run immediately.
- type: Literal['immediate']#
- class monitor_schema.models.monitor.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.
- class monitor_schema.models.monitor.NoExtrasBaseModel[source]#
Bases:
pydantic.BaseModel
No extras base model.
Inherit to prevent accidental extra fields.
- monitor_schema.models.monitor.COLUMN_NAME_TYPE#
- monitor_schema.models.monitor.METRIC_NAME_STR#
- monitor_schema.models.monitor.anyOf_to_oneOf(schema: Dict[str, Any], field_name: str) None [source]#
Turn anyOf in JSON schema to oneOf.
onfOf is much stricter and pyDantic doesn’t produce this tag. We hijack the JSON schema object to set this correctly.
- class monitor_schema.models.monitor.MonitorConfigMetadata[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Metadata related to a monitor.
- class monitor_schema.models.monitor.GlobalAction[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Actions that are configured at the team/organization level.
- type: Literal['global']#
- class monitor_schema.models.monitor.SendEmail[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Action to send an email.
- type: Literal['email']#
- class monitor_schema.models.monitor.SlackWebhook[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Action to send a Slack webhook.
- type: Literal['slack']#
- target: pydantic.HttpUrl#
- class monitor_schema.models.monitor.RawWebhook[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Action to send a Slack webhook.
- type: Literal['raw']#
- target: pydantic.HttpUrl#
- class monitor_schema.models.monitor.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.
- monitor_schema.models.monitor.excludeMetrics: List[monitor_schema.models.utils.METRIC_NAME_STR] | None#
- class monitor_schema.models.monitor.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.monitor.DigestModeGrouping[source]#
-
Enable the ability to group digest by various fields.
- byField = 'byColumn'#
- byDataset = 'byDataset'#
- byAnalyzer = 'byAnalyzer'#
- byDay = 'byDay'#
- byHour = 'byHour'#
- class monitor_schema.models.monitor.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#
- groupBy: List[DigestModeGrouping] | None#
- class monitor_schema.models.monitor.Monitor[source]#
Bases:
monitor_schema.models.commons.NoExtrasBaseModel
Customer specified monitor configs.
- metadata: monitor_schema.models.commons.Metadata | 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#
- mode: EveryAnomalyMode | DigestMode#
- actions: List[GlobalAction | SendEmail | SlackWebhook | RawWebhook]#