tcp
Reference for the `tcp` collector.
tcp· collector · runnanook doc tcpfor the same content in your terminal.
Tests TCP connectivity and measures dial latency.
Options
| Option | Type | Default | Description |
|---|---|---|---|
host | string | 127.0.0.1 | target hostname |
port | string | 80 | target port |
timeout | string | 5s | dial timeout (e.g. 5s, 2m) |
Metrics
| Metric | Kind | Unit | Description |
|---|---|---|---|
tcp.status | bool | — | true if the connection succeeded. Labels: addr. |
tcp.latency | numeric | seconds | connection latency in seconds. Labels: addr. |
Examples
Database reachability
[[]]
= "redis"
= "tcp"
= 10
[]
= "127.0.0.1"
= 6379
= 1000
Connection refused
[[]]
= 'redis::tcp.status is "false"'
= 2
= "ops"
= { = 60, = "oncall" }
Cross-az latency creeping up
[[]]
= "redis::tcp.latency > 50ms"
= 6
= "ops"