Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.Docker Monitoring extension gathers metrics from the Docker Remote API, either using Unix Socket or TCP.
GET /containers/(id)/statsis available only from Docker version 1.17 onwards. If you are using an older version, the CPU Stats, Memory Stats and Network Stats will not be available.
sudo /path/to/docker daemon -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock &
<MachineAgent_Dir>/monitors/DockerMonitorand update the following details. Comment out properties which are not used
metricPrefix: To report the metrics only to a given Tier, use the second one instead. The TIER_ID can be found from the REST API
metricPrefix: Custom Metrics|Docker #metricPrefix: Server|Component:<TIER_ID>|Custom Metrics|Docker
unixSocket: commandFile: monitors/DockerMonitor/socket-command.sh
tcpSockets: Multiple TCP sockets can be added here. Each one should have a base URL and a unique display name. The metrics will be reported under this name.
tcpSockets: - baseUrl: http://127.0.0.1:2375 name: Server1
username[Required] A user that can login to controller ui and upload dashboard
password[Required*] Clear text password for the user to upload the dashboard. Optionally use the passwordEncrypted and encryptionKey
passwordEncrypted[Optional*] See the section Password Encryption Support
encryptionKey[Optional*] See the section Password Encryption Support
chmod +x MachineAgent/monitors/DockerMonitor/socket-command.sh
The extension will generate and upload the following custom dashboard to the controller. This feature requires the version 4x of Machine Agent and Controller. Please look at the dashboard section in config.yml for configuration.
Please make sure that the
customDashboard section of
config.yml is configured correctly.
Over time, you might need to update contents of the dashboard.To create a new dashboard, delete(or rename) the existing dashboard and let extension upload a new one. See troubleshooting steps 4 and 5.
To avoid setting the clear text password in the config.yml, please follow the process to encrypt the password and set the encrypted password and the key in the config.yml
java -cp "appd-exts-commons-1.1.2.jar" com.appdynamics.extensions.crypto.Encryptor myKey myPassword
/containers/id/statsto whichever one you want to test.
echo -e "GET /containers/$CONTAINER_ID/stats HTTP/1.0\r\n" | sudo nc -U /var/run/docker.sockPlease update the
$CONTAINER_ID. If this API doesn't return any JSON data in the response in addition to http headers, then you will have to enable TCP sockets. Please refer to Prerequisites#3 on how to enable TCP Sockets. Then modify the
config.ymland uncomment the
tcpSocketssection accorgingly. Comment out the
For Debian the flag
-q than can be enabled in
nc to get the data from Unix Sockets. Please see the comments in file socket-command.sh
Docker recommends using CURL version 7.40 or higher to communicate with Unix Socket. Please update CURL version. Please see the comments in file socket-command.sh
wget http://127.0.0.1:2375/containers/json -O - -q wget http://127.0.0.1:2375/containers/$CONTAINER_ID/stats -O - -qIf you are executing the command from different machine other than the Docker Host Machine, please update the host part of the above url
127.0.0.1to the IP of the Docker Host Machine. Also please update the port value
2375if needed. Please refer to Prerequisites#3 section for more details. Please update
-Dappdynamics.agent.maxMetrics=1000, if there is a metric limit reached error in the logs
customDashboardsection of config.yml. The properties are
controllerSslEnabled: true. This is only application to AppDynamics Saas Environment.
falsein config.yml. This will create an xml in the logs directory. Please upload it manually through the controller ui. To debug any issues, attach it to the support ticket.
<MachineAgent>/conf/logging/log4j.xmland update the level of the appender "com.appdynamics" to debug
Workbench is a feature that lets you preview the metrics before registering it with the controller. This is useful if you want to fine tune the configurations. Workbench is embedded into the extension jar.To use the workbench
java -jar /path/to/MachineAgent/monitors/DockerMonitor/docker-monitoring-extension.jarThis starts an http server at
http://host:9090/. This can be accessed from the browser.
#Get the stats curl http://localhost:9090/api/stats #Get the registered metrics curl http://localhost:9090/api/metric-paths
config.ymland validate it from the browser or the API
The metrics will be reported under the tree
Application Infrastructure Performance|$TIER|Custom Metrics|Docker
Please refer to this screenshot to view the complete list of metrics reported by the Docker Extension.
Please contact email@example.com with the following details
|Machine Agent Compatibility||4.0+|
Server|Component:<TIER_NAME>is no longer supported by machine agent. Have to use