You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On all my Docker hosts, I'm accumulating a perpetually-growing set of files in /var/log/scalyr-agent-2, two for each Docker container that has ever been launched on the host (one for stdout, one for stderr).
My agent config for Docker monitoring (we use the docker_api log mode rather than syslog because we want to be able to run docker logs locally on the hosts in addition to viewing logs on Scalyr):
// Send Docker logs to Scalyr.
{
monitors: [
{
// Log each Docker container's output in a separate Scalyr logfile
module: "scalyr_agent.builtin_monitors.docker_monitor",
api_socket: "/var/run/docker.sock",
log_mode: "docker_api",
// Container metrics are pretty noisy and we already have system metrics
report_container_metrics: false
}
]
}
Example of the problem (this is from one of our CI servers where containers get launched constantly):
Thanks for reporting this issue. I'm currently looking in to it, but in the meantime, there is a workaround where you can use the config option docker_raw_logs: true in the docker_monitor config e.g.
// Send Docker logs to Scalyr.
{
monitors: [
{
// Log each Docker container's output in a separate Scalyr logfile
module: "scalyr_agent.builtin_monitors.docker_monitor",
api_socket: "/var/run/docker.sock",
log_mode: "docker_api",
docker_raw_logs: true,
// Container metrics are pretty noisy and we already have system metrics
report_container_metrics: false
}
]
}
You'll also need to map the hosts docker log directory to the same path on the container. This is typically /var/lib/docker/containers which should be mapped in with something like:
docker run ... -v /var/lib/docker/containers:/var/lib/docker/containers
Once you've done this, then the agent won't create its own files on disk, instead it will read directly from the container log files.
On all my Docker hosts, I'm accumulating a perpetually-growing set of files in
/var/log/scalyr-agent-2
, two for each Docker container that has ever been launched on the host (one for stdout, one for stderr).My agent config for Docker monitoring (we use the
docker_api
log mode rather than syslog because we want to be able to rundocker logs
locally on the hosts in addition to viewing logs on Scalyr):Example of the problem (this is from one of our CI servers where containers get launched constantly):
Expected behavior would be for the agent to delete the files as soon as it has successfully sent the logs to the Scalyr servers.
The text was updated successfully, but these errors were encountered: