SIENTIAPDE-1325
SIENTIAPDE-1325: Refactor Ingestor and Manager Classes for Enhanced Asynchronous Operations - Introduced asynchronous methods across Ingestor, IngestorManager, DataManager, and OpcManager to improve performance and responsiveness. - Integrated MetricsController into various classes for better observability and monitoring. - Updated Redis and MongoDB interactions to support asynchronous operations, enhancing data handling efficiency. - Removed deprecated Redis metrics and streamlined resource management logic. - Adjusted unit tests to accommodate the new asynchronous behavior and ensure proper mocking of async methods.
This commit is contained in:
@@ -16,6 +16,7 @@ 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']
|
||||
@@ -145,25 +146,6 @@ KAFKA_CONNECTION_STATUS = Gauge(
|
||||
POD_ID_LABEL,
|
||||
)
|
||||
|
||||
# --- Resource Manager (Redis) Metrics ---
|
||||
REDIS_OPERATIONS_TOTAL = Counter(
|
||||
'redis_operations_total', 'Total number of Redis operations performed', REDIS_LABELS
|
||||
)
|
||||
REDIS_OPERATIONS_ERRORS = Counter(
|
||||
'redis_operations_errors_total',
|
||||
'Total number of errors in Redis operations',
|
||||
REDIS_LABELS,
|
||||
)
|
||||
REDIS_OPERATIONS_DURATION = Histogram(
|
||||
'redis_operations_duration_seconds',
|
||||
'Duration of Redis operations in seconds',
|
||||
REDIS_LABELS,
|
||||
)
|
||||
REDIS_CONNECTION_STATUS = Gauge(
|
||||
'redis_connection_status',
|
||||
'Connection status with Redis (1=connected, 0=disconnected)',
|
||||
POD_ID_LABEL,
|
||||
)
|
||||
|
||||
# --- Notification Metrics ---
|
||||
NOTIFICATIONS_SENT = Counter(
|
||||
|
||||
Reference in New Issue
Block a user