From ba126e6e7c96bba2fd211b129c3ab20c4d0f35b6 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Wed, 18 Nov 2020 23:03:48 +0200 Subject: [PATCH] events handling: early skipping of extremely frequent exec_* events The exec_create, exec_start, exec_die and other events are generated by health checks --- connector/docker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connector/docker.go b/connector/docker.go index 98059af..4a39bf9 100644 --- a/connector/docker.go +++ b/connector/docker.go @@ -87,7 +87,11 @@ func (cm *Docker) watchEvents() { } actionName := e.Action - // Action may have additional param: "exec_create: redis-cli ping" or "health_status: healthy" + // fast skip all exec_* events: exec_create, exec_start, exec_die + if strings.HasPrefix(actionName, "exec_") { + continue + } + // Action may have additional param i.e. "health_status: healthy" // We need to strip to have only action name sepIdx := strings.Index(actionName, ": ") if sepIdx != -1 {