Zurück zum Blogguides

The TCP check: boring, and still the first one to set up

2 Min. Lesezeit

There is a hierarchy to monitoring checks and the TCP connect check sits near the bottom of it in sophistication. Open a socket to host and port, measure how long the handshake took, close. That is the whole check. It is also the monitor that catches more real outages per configuration minute than almost anything else, because "nothing is listening" remains the most common way services fail.

What a connect actually proves

A completed handshake says the host is up, the network path works, the firewall allows it, and something accepts connections on that port. For anything listening on TCP that is not HTTP, databases, mail, SSH, game servers, vendor appliances, this is the baseline that has to hold before any deeper check can even run.

The latency number pulls weight too. Connect time trending upward is the early signal for network path problems, saturated backends and overloaded daemons, visible before the first timeout. Uptriva measures it on every check, lets you set a latency threshold, and can run the same port from multiple probe regions so "down for everyone" and "down on one route" stay distinguishable.

Where the check ends

A port that accepts connections proves nothing about what happens next. The application behind it can hang on the handshake, reject every login, or answer with errors, and the connect check reports green through all of it. That is not a flaw, it is the definition of the layer. The mistake is expecting a transport check to be an application check.

So the rule is simple: TCP monitor as the floor, protocol check on top where one exists. FTP, SSH, Postgres and friends all have dedicated check types that go further. And for ports that should never face the internet, the same TCP check runs on the internal agent, which is usually the more important half of the job anyway: your database port should pass from inside and fail from outside.

Set it first

On a new service the TCP monitor belongs in the first five minutes, before the clever checks, because it needs no credentials, no protocol knowledge and no maintenance, and it catches the failures that take the whole service down. It is on the free tier along with HTTP, DNS, ping and heartbeat checks, so the floor costs nothing. Details at /monitoring/tcp.

FAQ

What is TCP port monitoring?

A check that opens a TCP connection to a host and port on a schedule and reports whether it succeeded plus how long it took. It verifies a service is accepting connections, without testing the protocol behind it.

When should I use a TCP check instead of HTTP?

For anything that does not speak HTTP: databases, mail servers, SSH, game servers, custom protocols, load balancers. If the service listens on a port, a TCP check is the baseline monitor for it.

Does a successful TCP connect mean the service is healthy?

No. It means the port accepts connections. The application behind it can still hang, reject logins or return errors, so pair the TCP check with a protocol-level check where one exists.

Weiterlesen