SIENTIAPDE-1325
Refactor Ingestor and Metrics Classes for Enhanced Asynchronous Operations - Updated IngestorManager, OpcManager, and ResourceManager to utilize asynchronous methods for improved performance. - Integrated MetricsController into various classes for better observability and monitoring. - Adjusted unit tests to accommodate the new asynchronous behavior, ensuring proper mocking of async methods. - Removed deprecated Redis metrics and streamlined resource management logic.
This commit is contained in:
@@ -79,6 +79,13 @@ class IngestorManager(SientiaMonitoring):
|
||||
redis_username: str | None = redis_data.get('username', None)
|
||||
redis_password: str | None = redis_data.get('password', None)
|
||||
|
||||
SientiaMonitoring.__init__(
|
||||
self,
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
)
|
||||
|
||||
self.data_manager = DataManager(
|
||||
kafka_servers=kafka_servers,
|
||||
mongo_connection_string=mongo_connection_string,
|
||||
@@ -109,14 +116,6 @@ class IngestorManager(SientiaMonitoring):
|
||||
|
||||
self.metadata = metadata
|
||||
|
||||
SientiaMonitoring.__init__(
|
||||
self,
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
set_error_counter=True,
|
||||
)
|
||||
|
||||
async def initialize_opc_from_config(self, server_config: dict) -> OpcManager | None:
|
||||
"""
|
||||
Initializes an OPC Manager instance using the provided server configuration.
|
||||
|
||||
@@ -93,7 +93,6 @@ class OpcManager(SientiaMonitoring):
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
set_error_counter=True,
|
||||
)
|
||||
|
||||
metrics.OPC_CONNECTION_STATUS.labels(
|
||||
|
||||
@@ -82,7 +82,6 @@ class ResourceManager(SientiaMonitoring):
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
set_error_counter=True,
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
@@ -16,7 +16,6 @@ labels for multi-dimensional analysis and alerting.
|
||||
|
||||
from prometheus_client import Counter, Gauge, Histogram
|
||||
|
||||
|
||||
# Metric label definitions for consistent labeling across all metrics
|
||||
POD_ID_LABEL = ['pod_id']
|
||||
SERVER_LABELS = ['pod_id', 'server_name', 'server_url']
|
||||
|
||||
Reference in New Issue
Block a user