Alerter
zenml.alerter
Alerters allow you to send alerts from within your pipeline.
This is useful to immediately get notified when failures happen, and also for general monitoring / reporting.
Attributes
__all__ = ['BaseAlerter', 'BaseAlerterConfig', 'BaseAlerterFlavor', 'BaseAlerterStepParameters']
module-attribute
Classes
BaseAlerter(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: StackComponent
, ABC
Base class for all ZenML alerters.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
Attributes
config: BaseAlerterConfig
property
Returns the BaseAlerterConfig
config.
Returns:
Type | Description |
---|---|
BaseAlerterConfig
|
The configuration. |
Functions
ask(question: str, params: Optional[BaseAlerterStepParameters] = None) -> bool
Post a message to a chat service and wait for approval.
This can be useful to easily get a human in the loop, e.g., when deploying models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
question
|
str
|
Question to ask (message to be posted). |
required |
params
|
Optional[BaseAlerterStepParameters]
|
Optional parameters of this function. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if operation succeeded and was approved, else False. |
Source code in src/zenml/alerter/base_alerter.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
post(message: str, params: Optional[BaseAlerterStepParameters] = None) -> bool
Post a message to a chat service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Message to be posted. |
required |
params
|
Optional[BaseAlerterStepParameters]
|
Optional parameters of this function. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if operation succeeded, else False. |
Source code in src/zenml/alerter/base_alerter.py
46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
BaseAlerterConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: StackComponentConfig
Base config for alerters.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
BaseAlerterFlavor
Bases: Flavor
, ABC
Base class for all ZenML alerter flavors.
Attributes
config_class: Type[BaseAlerterConfig]
property
Returns BaseAlerterConfig class.
Returns:
Type | Description |
---|---|
Type[BaseAlerterConfig]
|
The BaseAlerterConfig class. |
implementation_class: Type[BaseAlerter]
property
type: StackComponentType
property
BaseAlerterStepParameters
Bases: BaseModel
Step parameters definition for all alerters.
Modules
base_alerter
Base class for all ZenML alerters.
Classes
BaseAlerter(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: StackComponent
, ABC
Base class for all ZenML alerters.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: BaseAlerterConfig
property
Returns the BaseAlerterConfig
config.
Returns:
Type | Description |
---|---|
BaseAlerterConfig
|
The configuration. |
ask(question: str, params: Optional[BaseAlerterStepParameters] = None) -> bool
Post a message to a chat service and wait for approval.
This can be useful to easily get a human in the loop, e.g., when deploying models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
question
|
str
|
Question to ask (message to be posted). |
required |
params
|
Optional[BaseAlerterStepParameters]
|
Optional parameters of this function. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if operation succeeded and was approved, else False. |
Source code in src/zenml/alerter/base_alerter.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
post(message: str, params: Optional[BaseAlerterStepParameters] = None) -> bool
Post a message to a chat service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Message to be posted. |
required |
params
|
Optional[BaseAlerterStepParameters]
|
Optional parameters of this function. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if operation succeeded, else False. |
Source code in src/zenml/alerter/base_alerter.py
46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
BaseAlerterConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: StackComponentConfig
Base config for alerters.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
BaseAlerterFlavor
Bases: Flavor
, ABC
Base class for all ZenML alerter flavors.
config_class: Type[BaseAlerterConfig]
property
Returns BaseAlerterConfig class.
Returns:
Type | Description |
---|---|
Type[BaseAlerterConfig]
|
The BaseAlerterConfig class. |
implementation_class: Type[BaseAlerter]
property
type: StackComponentType
property
BaseAlerterStepParameters
Bases: BaseModel
Step parameters definition for all alerters.