Custom Datadog agent check for collecting TCP queue metrics using "ss" command
This check runs the command ss --numeric --listening --tcp
every 1 second on the host and parses the output to collect Send-Q and Recv-Q bytes broken down by port.
ss.listening.sendq
ss.listening.recvq
To enable this check follow the same steps as a custom agent check: https://docs.datadoghq.com/developers/metrics/agent_metrics_submission/?tab=count#tutorial
-
Install the Datadog agent: https://app.datadoghq.com/account/settings#agent
-
Create the directory
ss_tcp_queue.d/
in/etc/datadog-agent/conf.d/
-
Within
/etc/datadog-agent/conf.d/ss_tcp_queue.d
add the file ss_tcp_queue.yaml -
Go to
/etc/datadog-agent/checks.d/
and add the file ss_tcp_queue.py -
Validate the custom check is running correctly with the Agent’s status subcommand. Look for ss_tcp_queue under the Checks section:
=========
Collector
=========
Running Checks
==============
(...)
ss_tcp_queue (1.0.0)
-----------------------
Instance ID: metrics_example:d884b5186b651429 [OK]
Total Runs: 2
Metric Samples: Last Run: 8, Total: 16
Events: Last Run: 0, Total: 0
Service Checks: Last Run: 0, Total: 0
Average Execution Time : 2ms
(...)
```