Use the Machine Agent to identify containers by container names only.
By default for Docker monitoring, the Machine Agent obtains a list of containers. For each container, the Machine Agent retrieves all running processes inside the container. Then, the Machine Agent matches the container to be monitored by the process full command line. Because there are many containers, the selection process lasts longer than a minute, causing gaps in reporting container metrics.
The Docker Use Container Name Selector configuration option provides an alternative way to select containers to be monitored by using the container's name. This option allows the Machine Agent to run significantly faster since the Machine Agent does not have to gather all the processes for each container.
To enable matching with the container name, you can either use an environment variable or a JVM property. If both are defined, the environment variable is used.
You can select which containers to be monitored by providing the regular expression,
containerNameSelectorRegex, to match the container names. By default, the Machine Agent matches all container names. Regular expressions are part of the
To exclude containers from monitoring, use an environment variable or the JVM property. If both are defined, the environment variable is used.
# default value
# environment variable
# JVM property