SIENTIAPDE-1325
Refactor OPC metrics in metrics.py and opc_repository.py - Replaced existing OPC connection metrics with new metrics for total connections and failed connections. - Updated the OPC connection status metric to include server URL and adjusted corresponding metric emissions in opc_repository.py.
This commit is contained in:
@@ -182,7 +182,7 @@ class OpcRepository(SientiaMonitoring):
|
||||
value=1,
|
||||
)
|
||||
|
||||
await self.emit_metric(metrics.OPC_CONNECTION_COUNT, tags)
|
||||
await self.emit_metric(metrics.OPC_CONNECTIONS_TOTAL, tags)
|
||||
|
||||
return True, {}
|
||||
except Exception as e:
|
||||
@@ -191,7 +191,7 @@ class OpcRepository(SientiaMonitoring):
|
||||
trace = traceback.format_exc()
|
||||
self.logger.custom_error(trace, self.metadata)
|
||||
|
||||
await self.emit_metric(metrics.OPC_CONNECTION_ERROR_COUNT, tags)
|
||||
await self.emit_metric(metrics.OPC_CONNECTIONS_FAILED, tags)
|
||||
|
||||
return False, {
|
||||
'notification_id': f'OPC_CONNECTION_ERROR_{self.id}',
|
||||
|
||||
Reference in New Issue
Block a user