SIENTIAPDE-1325
Enhance OPC connection metrics by emitting total connections metric upon connection attempt. This change ensures accurate tracking of connection attempts in the OpcRepository class.
This commit is contained in:
@@ -165,6 +165,7 @@ class OpcRepository(SientiaMonitoring):
|
||||
'pod_id': self.pod_id,
|
||||
'server_name': self.server_name,
|
||||
}
|
||||
await self.emit_metric(metrics.OPC_CONNECTIONS_TOTAL, tags)
|
||||
try:
|
||||
self.last_reconnection_time = datetime.now()
|
||||
if self.client is None:
|
||||
@@ -175,7 +176,6 @@ class OpcRepository(SientiaMonitoring):
|
||||
'level': NotificationLevel.ERROR,
|
||||
}
|
||||
await self.client.connect()
|
||||
|
||||
|
||||
await self.emit_metric(
|
||||
metric_object=metrics.OPC_CONNECTION_STATUS,
|
||||
@@ -187,8 +187,6 @@ class OpcRepository(SientiaMonitoring):
|
||||
value=1,
|
||||
)
|
||||
|
||||
await self.emit_metric(metrics.OPC_CONNECTIONS_TOTAL, tags)
|
||||
|
||||
return True, {}
|
||||
except Exception as e:
|
||||
await self.disconnect()
|
||||
|
||||
Reference in New Issue
Block a user