**To configure a TCP monitor using code, learn more about the TCP Monitor Construct.
Basic Setup
Configure your TCP monitor by specifying the target service:
- Hostname: The server you want to monitor (e.g.
db.example.com
) - Port: The TCP port your service is listening on (e.g.
3306
for MySQL) - IP family: Defaults to IPv4
Assertions
Configure connection timeouts and data transmission assertions:
- Connection timeout: Maximum time to wait for connection (default: 10 seconds)
- Read timeout: Time to wait for response after connection (default: 10 seconds)
- Data to send: Optional data to transmit after establishing connection
Response Validation
Validate the service response for more precise monitoring:
- Response data: Expected text pattern in the response
- Response time limits: Define performance thresholds for degraded or failed states
Frequency
Set how often the monitor runs (every 10 seconds to 24 hours):
Scheduling & Locations

- Strategy: Choose between round-robin or parallel execution. Learn more about scheduling strategies
- Locations: Select one or more public or private locations to run the monitor from
Additional Settings
- Name: Give your monitor a clear name to identify it in dashboards and alerts
- Tags: Use tags to organize monitors across dashboards and maintenance windows
- Retries: Define how failed runs should be retried. See retry strategies
- Alerting: Configure your alert settings, alert channels, or set up webhooks for custom integrations
TCP monitors provide network-level connectivity verification. For application-level monitoring, consider adding synthetic monitoring to your monitoring strategy.