Skip to main content

Description

The connection_mon probe checks whether a specific process currently holds an ESTABLISHED TCP connection to a service endpoint. Designed for “trace between two servers” — verifying connectivity between systems. Bidirectional matching: The same config can be deployed on both ends:
  • Forward: this host is the source (local = source, remote = dest service)
  • Reverse: this host is the dest (local = dest service, remote = source)
Requires both ProcessAdapter and ConnAdapter.

Config fields

FieldTypeRequiredDefaultDescription
typestringYesMust be "connection_mon"
namestringYesConnection link identifier
processNamestringYesProcess name glob (case-insensitive, same as process_mon)
executablePathstringNoExecutable path to narrow match (ANDed)
destServiceIpstringYesDestination service IP (well-known end)
destServicePortintYesDestination service port (1–65535)
sourceServiceIpstringNoSource IP (optional filter)
sourceServicePortintNoSource port (usually ephemeral, left unset)
protocolstringNo"tcp"Only "tcp" supported

Metrics

MetricTypeLabelsDescription
vms.connection_mon.statusstatusname, dest_ip, dest_port, proto, process_name, directionup or down
vms.connection_mon.upgauge(same)1 = ESTABLISHED connection found, 0 = none
vms.agent.permission_missinggaugecapability=CAP_SYS_PTRACEWhen agent cannot attribute sockets to PIDs

Example config

{
  "type": "connection_mon",
  "name": "app-to-postgres",
  "processName": "java",
  "destServiceIp": "10.0.1.50",
  "destServicePort": 5432
}

Notes

  • Only TCP ESTABLISHED state is considered “normal/healthy”.
  • Same config deployed on both ends: host A sees direction=forward, host B sees direction=reverse.
  • Without CAP_SYS_PTRACE, a process owned by another user shows 0 connections (false negative) with vms.agent.permission_missing emitted.