SIENTIAPDE-1307: Integrate metrics controller and update sientia-dataops-library to 1.5.1. This change adds metrics collection capabilities to activities and updates the dataops library dependency. (18 files changed, 143 insertions(+), 16 deletions(-))
This commit is contained in:
@@ -19,6 +19,7 @@ with workflow.unsafe.imports_passed_through():
|
||||
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
|
||||
from sientia_do.notifications.models import NotificationLevel
|
||||
from sientia_do.observability.logger import Logger
|
||||
from sientia_do.observability.metrics_controller import MetricsController
|
||||
from sientia_do.temporal.activities.postgres import Postgres
|
||||
from sqlalchemy import text
|
||||
|
||||
@@ -42,10 +43,6 @@ class ExperimentTracking(Postgres):
|
||||
|
||||
The activity uses the existing Postgres connection pool and adds experiment-specific
|
||||
operations with proper error handling and notifications.
|
||||
|
||||
Attributes:
|
||||
logger (Logger): Logger instance for observability
|
||||
notification_handler (NotificationHandler): Handler for sending notifications
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@@ -59,6 +56,7 @@ class ExperimentTracking(Postgres):
|
||||
max_connections: int,
|
||||
logger: Logger,
|
||||
notification_handler: NotificationHandler,
|
||||
metrics_controller: MetricsController,
|
||||
):
|
||||
"""
|
||||
Initialize ExperimentTracking activity with database configuration.
|
||||
@@ -73,6 +71,7 @@ class ExperimentTracking(Postgres):
|
||||
max_connections: Maximum connections in pool
|
||||
logger: Logger instance for observability
|
||||
notification_handler: Notification handler for alerts
|
||||
metrics_controller: Metrics controller for observability
|
||||
|
||||
Raises:
|
||||
ConnectionError: If database connection cannot be established
|
||||
@@ -87,6 +86,7 @@ class ExperimentTracking(Postgres):
|
||||
max_connections=max_connections,
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
)
|
||||
|
||||
def __del__(self):
|
||||
|
||||
Reference in New Issue
Block a user