Introduction
This article provides the steps needed to configure the Scalyr Agent's Docker monitor to exclude container names. More information on the parameters referenced below (and other Docker monitor fields) can be found here: https://app.scalyr.com/help/monitors/docker-monitor
Configuration
First, access the Scalyr Agent's Docker container
docker ps
docker exec -i -t <container ID> /bin/bash
Edit the Scalyr Agent's Docker configuration file in /etc/scalyr-agent-2/agent.d/docker.json
Using the text editor of your choice, update the monitors
section
{
monitors: [
{
module: "scalyr_agent.builtin_monitors.docker_monitor",
container_globs: ["*"],
container_globs_exclude: ["SERVICE_NAME"]
}
]
}
Notes:
- Since the
container_globs
andcontainer_globs_exclude
variables are specific to the Docker monitor, they don't require the SCALYR_ prefix - The
container_globs
variable is explicitly set to * (since it is "None" by default). It is processed beforecontainer_globs_exclude
- Replace "SERVICE_NAME" with the name of the container(s) that you wish to exclude. Wildcards can be used.
- You can quickly retrieve the container name by running
docker ps
and referring to the "NAMES" column - If possible, minimize the use of wildcards. For example, to exclude all containers containing the container name "web", either web* (suffixes included) or web (exact match) would work
- You can quickly retrieve the container name by running
- The same configuration can also be applied to Docker labels via the
label_include_globs
andlabel_exclude_globs
parameters (see: https://app.scalyr.com/help/monitors/docker-monitor).
Comments
0 comments
Please sign in to leave a comment.