Learn more about TCP Monitors in the TCP monitor overview.
Prerequisites
Prerequisites
Before creating TCP Monitors, ensure you have:
- An initialized Checkly CLI project
- Network access to the TCP services you want to monitor
- Knowledge of the target hostname and port number
- Understanding of the expected response format (if sending data)
Configuration
The TCP Monitoring configuration consists of specific TCP monitoring options and inherited general monitoring options.Parameter | Type | Required | Default | Description |
---|---|---|---|---|
request | object | ✅ | - | TCP connection configuration object |
degradedResponseTime | number | ❌ | 4000 | Response time threshold in milliseconds for degraded status |
maxResponseTime | number | ❌ | 5000 | Maximum response time in milliseconds before marking as failed |
TcpMonitor
Options
TCP connection configuration that defines the hostname, port, and optional data to send.Usage:Parameters:
Define assertions using the Examples:Use cases: Database connectivity, cache service monitoring, custom TCP service validation.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
hostname | string | ✅ | - | The hostname to connect to (without scheme or port) |
port | number | ✅ | - | The port number for the TCP connection |
ipFamily | string | ❌ | 'IPv4' | IP family: 'IPv4' | 'IPv6' |
data | string | ❌ | - | Data to send to the target host |
assertions | TcpAssertion[] | ❌ | [] | Response assertions using TcpAssertionBuilder |
Use the
hostname
parameter without including a scheme (like http://
) or port number. Specify the port separately using the port
parameter.TcpAssertionBuilder
to validate both response time and response data:Response time threshold in milliseconds for marking the monitor as degraded (warning state).Usage:Examples:Use cases: Early performance warnings, gradual degradation detection.
Maximum response time in milliseconds before the monitor is marked as failed.Usage:Examples:Use cases: Performance monitoring, SLA compliance, connection timeout management.
General Monitor Options
Friendly name for your TCP monitor that will be displayed in the Checkly dashboard and used in notifications.Usage:
How often the TCP monitor should run. Use the Examples:Available frequencies:
Frequency
enum to set the check interval.Usage:EVERY_10S
, EVERY_20S
, EVERY_30S
, EVERY_1M
, EVERY_2M
, EVERY_5M
, EVERY_10M
, EVERY_15M
, EVERY_30M
, EVERY_1H
, EVERY_2H
, EVERY_3H
, EVERY_6H
, EVERY_12H
, EVERY_24H
Array of public location codes where the TCP monitor should run from. Multiple locations provide geographic coverage.Usage:Examples:Use cases: Global connectivity testing, regional service monitoring, network latency analysis.
Whether the TCP monitor is enabled and will run according to its schedule.Usage:Examples:
Examples
When sending data to services, ensure you use proper protocol formatting. For example, Redis commands should end with
\r\n
.