From 5e20934ee2295f5bf38d85dba693e621cf2acce7 Mon Sep 17 00:00:00 2001 From: Olivier Vielpeau Date: Wed, 19 Apr 2017 15:38:36 -0400 Subject: [PATCH] [auto_conf] Allow multiple instances per check In some cases (and for some checks), it makes sense to have multiple instances of the same check running against a container. Example: `php_fpm` check when the user wants to check multiple `status_url`s. So. instead of only taking into account the first instance, take into account all of them. --- utils/service_discovery/abstract_config_store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/service_discovery/abstract_config_store.py b/utils/service_discovery/abstract_config_store.py index afbe1a2501..436f508093 100644 --- a/utils/service_discovery/abstract_config_store.py +++ b/utils/service_discovery/abstract_config_store.py @@ -241,7 +241,8 @@ def _get_auto_config(self, image_name): continue auto_conf = get_auto_conf(check_name) init_config, instances = auto_conf.get('init_config', {}), auto_conf.get('instances', []) - templates.append((check_name, init_config, instances[0] or {})) + for instance in instances: + templates.append((check_name, init_config, instance or {})) return templates