Skip to main content
Learn more about TCP Monitors in the TCP monitor overview.
Use TCP Monitors to verify connectivity and response times of your TCP services. The examples below show how to configure monitoring for different types of services.
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)
For additional setup information, see CLI overview.

Configuration

The TCP Monitoring configuration consists of specific TCP monitoring options and inherited general monitoring options.

TcpMonitor Options

request
object
required
TCP connection configuration that defines the hostname, port, and optional data to send.Usage:
Parameters:Examples:
Use cases: Database connectivity, cache service monitoring, custom TCP service validation.
degradedResponseTime
number
default:"4000"
Response time threshold in milliseconds for marking the monitor as degraded (warning state).Usage:
Examples:
Use cases: Early performance warnings, gradual degradation detection.
maxResponseTime
number
default:"5000"
Maximum response time in milliseconds before the monitor is marked as failed.Usage:
Examples:
Use cases: Performance monitoring, SLA compliance, connection timeout management.

TcpMonitor Assertions

To define assertions for the request of an TcpMonitor you should use the TcpAssertionBuilder. The following sources are available for TCP monitor assertions:
  • responseTime(): Assert the total response time of the TCP request
  • responseData(): Assert the value in the response data
Here are some examples:
  • Assert the total response time of the TCP request
  • Asserting the value in the response
Learn more in our docs on Assertions.

General Monitor Options

name
string
required
Friendly name for your TCP monitor that will be displayed in the Checkly dashboard and used in notifications.Usage:
frequency
Frequency
How often the TCP monitor should run. Use the Frequency enum to set the check interval.Usage:
Examples:
Available frequencies: 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
locations
string[]
default:"[]"
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.
activated
boolean
default:"true"
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.