tcp

Reference for the `tcp` collector.

tcp · collector · run nanook doc tcp for the same content in your terminal.

Tests TCP connectivity and measures dial latency.

Options

OptionTypeDefaultDescription
hoststring127.0.0.1target hostname
portstring80target port
timeoutstring5sdial timeout (e.g. 5s, 2m)

Metrics

MetricKindUnitDescription
tcp.statusbooltrue if the connection succeeded. Labels: addr.
tcp.latencynumericsecondsconnection latency in seconds. Labels: addr.

Examples

Database reachability

[[collectors]]
name = "redis"
kind = "tcp"
interval = 10
[collectors.opts]
host = "127.0.0.1"
port = 6379
timeout = 1000

Connection refused

[[alerts]]
expr = 'redis::tcp.status is "false"'
count = 2
channel = "ops"
escalate = { after = 60, channel = "oncall" }

Cross-az latency creeping up

[[alerts]]
expr = "redis::tcp.latency > 50ms"
count = 6
channel = "ops"