Btw, do you have a good suggestion, how to implement node health check properly?
I mean what should be done when connection is opened - in order to count it as "Created".. so that "Closed" metric would match :)
What we did before was like this (C#):
private bool GetEndpointHealth()
{
try
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(Endpoint.HostName, Endpoint.Port);
socket.Close();
return true;
}
catch
{
return false;
}
}
But it does not validate if credentials are correct.. that was not our point - we just wanted to make sure that server is started and listening..
So I would not even consider it as "Opening connection".. :)
with best regards
Mantas