)]}'
{"ceilometer/polling/dynamic_pollster.py":[{"author":{"_account_id":20100,"name":"Shaoman Zhang","email":"zhang.shaoman@zte.com.cn","username":"zhang.shaoman"},"change_message_id":"3f7364a426e152a6ec26e8fd1bb05541a4d5e6d1","unresolved":false,"context_lines":[{"line_number":15,"context_line":"\"\"\"Dynamic pollster component"},{"line_number":16,"context_line":"    This component enables operators to create new pollsters on the fly"},{"line_number":17,"context_line":"    via configuration. The configuration files are read from"},{"line_number":18,"context_line":"    \u0027/etc/ceilometer/dynamic/\u0027. The pollster are defined in YAML files"},{"line_number":19,"context_line":"    similar to the idea used for handling notifications."},{"line_number":20,"context_line":"\"\"\""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_51bcc768","line":18,"range":{"start_line":18,"start_character":5,"end_line":18,"end_character":29},"updated":"2019-09-06 09:20:31.000000000","message":"should be /etc/ceilometer/pollsters.d/","commit_id":"c4914318ac942cf3765e327edc7eb42408b84115"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"f7d9a5f523783ec5a281a33d614ed360e0451837","unresolved":false,"context_lines":[{"line_number":15,"context_line":"\"\"\"Dynamic pollster component"},{"line_number":16,"context_line":"    This component enables operators to create new pollsters on the fly"},{"line_number":17,"context_line":"    via configuration. The configuration files are read from"},{"line_number":18,"context_line":"    \u0027/etc/ceilometer/dynamic/\u0027. The pollster are defined in YAML files"},{"line_number":19,"context_line":"    similar to the idea used for handling notifications."},{"line_number":20,"context_line":"\"\"\""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_3821e8a0","line":18,"range":{"start_line":18,"start_character":5,"end_line":18,"end_character":29},"in_reply_to":"5faad753_51bcc768","updated":"2019-09-06 12:41:44.000000000","message":"Fixed. Thanks for spotting that.","commit_id":"c4914318ac942cf3765e327edc7eb42408b84115"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"1f32d6b6288c61c36516ff87415943e3665eea21","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d next(iter(response_json))"},{"line_number":229,"context_line":"            return response_json[first_entry_name]"},{"line_number":230,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_2b3e6229","line":228,"range":{"start_line":228,"start_character":31,"end_line":228,"end_character":35},"updated":"2019-09-07 08:10:57.000000000","message":"I think we should add a StopIteration expection here, then we can pass the py37 tests.","commit_id":"5f201753d1701d1f5b9e0ce40d86d51e5f0311fb"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"67a589a0618d9c03b0d455a6b685db193a9f2bce","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d next(iter(response_json))"},{"line_number":229,"context_line":"            return response_json[first_entry_name]"},{"line_number":230,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_c650e535","line":228,"range":{"start_line":228,"start_character":31,"end_line":228,"end_character":35},"in_reply_to":"5faad753_2b3e6229","updated":"2019-09-07 13:23:31.000000000","message":"done","commit_id":"5f201753d1701d1f5b9e0ce40d86d51e5f0311fb"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"914c22eedb948e88edac26e8e6053edf1dac100b","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"}],"source_content_type":"text/x-python","patch_set":24,"id":"3fa7e38b_cc850ed1","line":231,"range":{"start_line":231,"start_character":19,"end_line":231,"end_character":31},"updated":"2019-10-09 00:42:55.000000000","message":"here we can just use the StopIteration exception","commit_id":"098642448f9c4bf6181b483e319c0a4b907ca766"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"f08265f43a1557a34cc9b1ef5dafaa08139f937b","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"}],"source_content_type":"text/x-python","patch_set":24,"id":"3fa7e38b_14048417","line":231,"range":{"start_line":231,"start_character":19,"end_line":231,"end_character":31},"in_reply_to":"3fa7e38b_cc850ed1","updated":"2019-10-09 12:01:50.000000000","message":"I tried that, but if I catch `except StopIteration as s`, it does not work. Python is throwing a runtime.\n\n\u0027RuntimeError: generator raised StopIteration\u0027","commit_id":"098642448f9c4bf6181b483e319c0a4b907ca766"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    ALL_POLLSTER_FIELDS \u003d [\u0027name\u0027, \u0027sample_type\u0027, \u0027unit\u0027, \u0027value_attribute\u0027,"},{"line_number":39,"context_line":"                           \u0027endpoint_type\u0027, \u0027url_path\u0027, \u0027metadata_fields\u0027,"},{"line_number":40,"context_line":"                           \u0027skip_sample_values\u0027, \u0027value_mapping\u0027,"},{"line_number":41,"context_line":"                           \u0027default_value_mapping\u0027,  \u0027metadata_map\u0027,"},{"line_number":42,"context_line":"                           \u0027preserve_mapped_metadata\u0027]"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    REQUIRED_POLLSTER_FIELDS \u003d [\u0027name\u0027, \u0027sample_type\u0027, \u0027unit\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"3fa7e38b_0ca3fb9f","line":41,"range":{"start_line":41,"start_character":54,"end_line":41,"end_character":66},"updated":"2019-10-11 01:02:37.000000000","message":"Please use \u0027metadata_mapping\u0027 to keep naming consistency","commit_id":"db47531629dbe076cb3103bd55c4d53f7cab27bd"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    METADATA_FIELDS \u003d []"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    name \u003d \"\u003cpollsterEmptyName\u003e\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def __init__(self, pollster_definitions, conf\u003dNone):"},{"line_number":53,"context_line":"        super(DynamicPollster, self).__init__(conf)"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2c74b7ce","line":50,"range":{"start_line":50,"start_character":12,"end_line":50,"end_character":31},"updated":"2019-10-11 01:02:37.000000000","message":"Suggestion: using empty string is more reasonable.\n\nIs there particular reason to define \u0027METADATA_FIELDS\u0027 and \u0027name\u0027 as class scoped variables?","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    METADATA_FIELDS \u003d []"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    name \u003d \"\u003cpollsterEmptyName\u003e\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def __init__(self, pollster_definitions, conf\u003dNone):"},{"line_number":53,"context_line":"        super(DynamicPollster, self).__init__(conf)"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2767f0eb","line":50,"range":{"start_line":50,"start_character":12,"end_line":50,"end_character":31},"in_reply_to":"3fa7e38b_2c74b7ce","updated":"2019-10-11 02:13:19.000000000","message":"None. I will remove it. \n\nI will also use empty String.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            self.pollster_definitions[\u0027skip_sample_values\u0027] \u003d []"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        if \u0027value_mapping\u0027 not in self.pollster_definitions:"},{"line_number":73,"context_line":"            self.pollster_definitions[\u0027value_mapping\u0027] \u003d []"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if \u0027default_value_mapping\u0027 not in self.pollster_definitions:"},{"line_number":76,"context_line":"            self.pollster_definitions[\u0027default_value_mapping\u0027] \u003d -1"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2c2277ba","line":73,"range":{"start_line":73,"start_character":57,"end_line":73,"end_character":59},"updated":"2019-10-11 01:02:37.000000000","message":"According to the doc, \u0027value_mapping\u0027 should be a dict.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            self.pollster_definitions[\u0027skip_sample_values\u0027] \u003d []"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        if \u0027value_mapping\u0027 not in self.pollster_definitions:"},{"line_number":73,"context_line":"            self.pollster_definitions[\u0027value_mapping\u0027] \u003d []"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if \u0027default_value_mapping\u0027 not in self.pollster_definitions:"},{"line_number":76,"context_line":"            self.pollster_definitions[\u0027default_value_mapping\u0027] \u003d -1"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_879b44c7","line":73,"range":{"start_line":73,"start_character":57,"end_line":73,"end_character":59},"in_reply_to":"3fa7e38b_2c2277ba","updated":"2019-10-11 02:13:19.000000000","message":"Sure, it is replaced by the dict when the user configured it. When the user does not configure, this was ignored. Anyways, I changed as you suggested.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            self.pollster_definitions[\u0027preserve_mapped_metadata\u0027] \u003d True"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if \u0027metadata_mapping\u0027 not in self.pollster_definitions:"},{"line_number":82,"context_line":"            self.pollster_definitions[\u0027metadata_mapping\u0027] \u003d []"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def validate_pollster_definition(self):"},{"line_number":85,"context_line":"        missing_required_fields \u003d \\"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2c0b572a","line":82,"range":{"start_line":82,"start_character":60,"end_line":82,"end_character":62},"updated":"2019-10-11 01:02:37.000000000","message":"According to the doc, \u0027metadata_mapping\u0027 should be a dict.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            self.pollster_definitions[\u0027preserve_mapped_metadata\u0027] \u003d True"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if \u0027metadata_mapping\u0027 not in self.pollster_definitions:"},{"line_number":82,"context_line":"            self.pollster_definitions[\u0027metadata_mapping\u0027] \u003d []"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def validate_pollster_definition(self):"},{"line_number":85,"context_line":"        missing_required_fields \u003d \\"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_a7a0c0f5","line":82,"range":{"start_line":82,"start_character":60,"end_line":82,"end_character":62},"in_reply_to":"3fa7e38b_2c0b572a","updated":"2019-10-11 02:13:19.000000000","message":"fixed","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":87,"context_line":"             if field not in self.pollster_definitions]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        if missing_required_fields:"},{"line_number":90,"context_line":"            LOG.debug(\"Dynamic pollster[%s] missing the following fields [%s]\""},{"line_number":91,"context_line":"                      % (self.pollster_definitions, missing_required_fields))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if missing_required_fields:"},{"line_number":94,"context_line":"            raise declarative.DynamicPollsterDefinitionException("}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_8c4ccb9e","line":91,"range":{"start_line":90,"start_character":0,"end_line":91,"end_character":77},"updated":"2019-10-11 01:02:37.000000000","message":"Not needed.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":87,"context_line":"             if field not in self.pollster_definitions]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        if missing_required_fields:"},{"line_number":90,"context_line":"            LOG.debug(\"Dynamic pollster[%s] missing the following fields [%s]\""},{"line_number":91,"context_line":"                      % (self.pollster_definitions, missing_required_fields))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if missing_required_fields:"},{"line_number":94,"context_line":"            raise declarative.DynamicPollsterDefinitionException("}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_47a1ccf6","line":91,"range":{"start_line":90,"start_character":0,"end_line":91,"end_character":77},"in_reply_to":"3fa7e38b_8c4ccb9e","updated":"2019-10-11 02:13:19.000000000","message":"removed","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        for definition_key in self.pollster_definitions:"},{"line_number":105,"context_line":"            if definition_key not in self.ALL_POLLSTER_FIELDS:"},{"line_number":106,"context_line":"                LOG.info("},{"line_number":107,"context_line":"                    \"Field [%s] defined in [%s] is unknown \""},{"line_number":108,"context_line":"                    \"and will be ignored. Valid fields are [%s].\""},{"line_number":109,"context_line":"                    % (definition_key, self.pollster_definitions,"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_4c42536a","line":106,"range":{"start_line":106,"start_character":16,"end_line":106,"end_character":24},"updated":"2019-10-11 01:02:37.000000000","message":"Should be LOG.warning","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        for definition_key in self.pollster_definitions:"},{"line_number":105,"context_line":"            if definition_key not in self.ALL_POLLSTER_FIELDS:"},{"line_number":106,"context_line":"                LOG.info("},{"line_number":107,"context_line":"                    \"Field [%s] defined in [%s] is unknown \""},{"line_number":108,"context_line":"                    \"and will be ignored. Valid fields are [%s].\""},{"line_number":109,"context_line":"                    % (definition_key, self.pollster_definitions,"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_67a64812","line":106,"range":{"start_line":106,"start_character":16,"end_line":106,"end_character":24},"in_reply_to":"3fa7e38b_4c42536a","updated":"2019-10-11 02:13:19.000000000","message":"Ok","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_e715583e","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":33},"updated":"2019-10-11 01:02:37.000000000","message":"Does this HTTPError cover the errors like connection timeout or Connection refused?","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"5519d1845774313a2eb628ea42cda0fc6acf9dd9","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2753706d","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":33},"in_reply_to":"3fa7e38b_07af54e3","updated":"2019-10-11 03:14:06.000000000","message":"If we don\u0027t catch those exceptions, what if they happen?","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"228234457a19ff2d5849bd1f23ca22e01ad1d342","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_1298f0bd","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":33},"in_reply_to":"3fa7e38b_2753706d","updated":"2019-10-11 03:29:08.000000000","message":"Ok, I changed that in changetset 32.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_07af54e3","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":33},"in_reply_to":"3fa7e38b_e715583e","updated":"2019-10-11 02:13:19.000000000","message":"No. My intention was to cover only HTTP errors. So you think we need to catch all other as well? \n\nThen, we would need to use RequestException","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_471eac5f","line":125,"range":{"start_line":125,"start_character":16,"end_line":125,"end_character":25},"updated":"2019-10-11 01:02:37.000000000","message":"Should be LOG.error or LOG.warning, this is important information that should be easy for cloud operators to find.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                samples \u003d self.execute_request_get_samples("},{"line_number":123,"context_line":"                    keystone_client\u003dmanager._keystone, endpoint\u003dendpoint)"},{"line_number":124,"context_line":"            except HTTPError as e:"},{"line_number":125,"context_line":"                LOG.debug(\"Error [%s] while loading samples for [%s] \""},{"line_number":126,"context_line":"                          \"for dynamic pollster [%s].\""},{"line_number":127,"context_line":"                          % (e, endpoint, self.name))"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_27acd0eb","line":125,"range":{"start_line":125,"start_character":16,"end_line":125,"end_character":25},"in_reply_to":"3fa7e38b_471eac5f","updated":"2019-10-11 02:13:19.000000000","message":"fixed","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code !\u003d requests.codes.ok:"},{"line_number":218,"context_line":"            resp.raise_for_status()"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        response_json \u003d resp.json()"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        entry_size \u003d len(response_json)"},{"line_number":223,"context_line":"        LOG.debug(\"Entries [%s] in the JSON for request [%s] \""},{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_47530c17","line":222,"range":{"start_line":220,"start_character":0,"end_line":222,"end_character":39},"updated":"2019-10-11 01:02:37.000000000","message":"Some services(like Neutron or Octavia, etc.) return responses like the following:\n\n    {\n      \"resources\": [\n        resource1,\n        resource2\n      ]\n    }\n\nSo \u0027len(response_json)\u0027 and all the following logic don\u0027t make sense. We should find an appropriate way to deal with all the potential situations.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"228234457a19ff2d5849bd1f23ca22e01ad1d342","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code !\u003d requests.codes.ok:"},{"line_number":218,"context_line":"            resp.raise_for_status()"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        response_json \u003d resp.json()"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        entry_size \u003d len(response_json)"},{"line_number":223,"context_line":"        LOG.debug(\"Entries [%s] in the JSON for request [%s] \""},{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_d2bb380c","line":222,"range":{"start_line":220,"start_character":0,"end_line":222,"end_character":39},"in_reply_to":"3fa7e38b_07b2f494","updated":"2019-10-11 03:29:08.000000000","message":"And, what is the problem? I jest need the first entry. that is why I execute `next(iter(response_json))`.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code !\u003d requests.codes.ok:"},{"line_number":218,"context_line":"            resp.raise_for_status()"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        response_json \u003d resp.json()"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        entry_size \u003d len(response_json)"},{"line_number":223,"context_line":"        LOG.debug(\"Entries [%s] in the JSON for request [%s] \""},{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_47ef8c1c","line":222,"range":{"start_line":220,"start_character":0,"end_line":222,"end_character":39},"in_reply_to":"3fa7e38b_47530c17","updated":"2019-10-11 02:13:19.000000000","message":"I would rather merge this in, and extend it as the concrete cases appear. It is already a huge PR, and we are already extending it to cover other use cases that we have. Just to give you an example, we have the following configurations in production, and they work just fine:\n\n```\n- name: \"dynamic.network.services.vpn.connection\"\n  sample_type: \"gauge\"\n  unit: \"ipsec_site_connection\"\n  value_attribute: \"status\"\n  endpoint_type: \"network\"\n  url_path: \"v2.0/vpn/ipsec-site-connections\"\n  metadata_fields:\n    - \"name\"\n    - \"vpnservice_id\"\n    - \"description\"\n    - \"status\"\n    - \"peer_address\"\n  value_mapping:\n    ACTIVE: \"1\"\n  metadata_map:\n    name: \"display_name\"\n  default_value_mapping: 0\n\n- name: \"dynamic.network.services.router\"\n  sample_type: \"gauge\"\n  unit: \"router\"\n  value_attribute: \"status\"\n  endpoint_type: \"network\"\n  url_path: \"v2.0/routers\"\n  metadata_fields:\n    - \"name\"\n    - \"flavor_id\"\n    - \"description\"\n    - \"ha\"\n    - \"status\"\n    - \"created_at\"\n    - \"updated_at\"\n  value_mapping:\n    ACTIVE: \"1\"\n  metadata_map:\n    name: \"display_name\"\n  default_value_mapping: 0\n\n- name: \"dynamic.network.services.lb.loadbalancer\"\n  sample_type: \"gauge\"\n  unit: \"loadbalancer\"\n  value_attribute: \"provisioning_status\"\n  endpoint_type: \"load-balancer\"\n  url_path: \"v2/lbaas/loadbalancers\"\n  metadata_fields:\n    - \"name\"\n    - \"flavor_id\"\n    - \"description\"\n    - \"provisioning_status\"\n    - \"vip_address\"\n    - \"operating_status\"\n    - \"created_at\"\n    - \"updated_at\"\n  value_mapping:\n    ACTIVE: \"1\"\n  metadata_map:\n    name: \"display_name\"\n  default_value_mapping: 0\n\n```\n\nThese are all pollster that did not existed or were not working as we expected them to work.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"5519d1845774313a2eb628ea42cda0fc6acf9dd9","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code !\u003d requests.codes.ok:"},{"line_number":218,"context_line":"            resp.raise_for_status()"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        response_json \u003d resp.json()"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        entry_size \u003d len(response_json)"},{"line_number":223,"context_line":"        LOG.debug(\"Entries [%s] in the JSON for request [%s] \""},{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_07b2f494","line":222,"range":{"start_line":220,"start_character":0,"end_line":222,"end_character":39},"in_reply_to":"3fa7e38b_47ef8c1c","updated":"2019-10-11 03:14:06.000000000","message":"The `len(response_json)` is definitely incorrect, using your loadbalancer pollster definition, the following is the debug info in my environment: http://dpaste.com/0KM83CY. There is only 1 load balancer, but `len(response_json)` returns 2.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"eba60366a877d2f3bf3c3d80047d21fe39a8ea5a","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_0d221553","line":233,"updated":"2019-10-11 06:41:20.000000000","message":"A new question, if the RuntimeError is raised, \u0027first_entry_name\u0027 is None, what\u0027s the result of \u0027response_json[first_entry_name]\u0027?","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a8468d6c7a1ea1b7cd4dbccaa18188ed4ec13be3","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_c4974c45","line":233,"in_reply_to":"3fa7e38b_0d221553","updated":"2019-10-23 13:09:11.000000000","message":"It will never be None. \n\nAnyways, if an exception happens, it will be captured in ceilometer/polling/manager.py at line 221.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"5519d1845774313a2eb628ea42cda0fc6acf9dd9","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_929b80c7","line":234,"range":{"start_line":227,"start_character":0,"end_line":234,"end_character":50},"updated":"2019-10-11 03:14:06.000000000","message":"I have another example which doesn\u0027t fit into the code. When I list Aodh alarms the response is like http://dpaste.com/248FJXS, it\u0027s different from the response we get from Neutron or Octavia.\n\nI\u0027d suggest we check the type of \u0027response_json\u0027 and add one more field in the pollster definition named \u0027resource_name\u0027 or \u0027resource_attribute\u0027, so your loadbalancer example will be changed to http://dpaste.com/1SNRRBT\n\nOne more thing, if the URL including project_id is not supported, please add some description in the doc.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a8468d6c7a1ea1b7cd4dbccaa18188ed4ec13be3","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_049c8459","line":234,"range":{"start_line":227,"start_character":0,"end_line":234,"end_character":50},"in_reply_to":"3fa7e38b_8d6045a7","updated":"2019-10-23 13:09:11.000000000","message":"\u003e OK, so you don\u0027t prefer the way \"wouldn\u0027t it be better to raise a question, and then let me execute the changes (after we discuss them)\", do you?\n\nI did not understand what you mean.\n\n\u003e I do believe your team will continue working on this but let\u0027s describe the things that are already supported and things that are not at the moment. I still prefer we describe the caveats of the dynamic pollster mechanism for now, and remove once it\u0027s implemented in the future.\n\nOk. I will describe what is support, and what is not supported yet.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"228234457a19ff2d5849bd1f23ca22e01ad1d342","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_b2655cb7","line":234,"range":{"start_line":227,"start_character":0,"end_line":234,"end_character":50},"in_reply_to":"3fa7e38b_929b80c7","updated":"2019-10-11 03:29:08.000000000","message":"This Aodh would be a problem. However, as I said, let\u0027s improve over time. Otherwise, we will never finish. It is just not feasible to map all possible use cases, and just after we cover all of them, we publish something. It is not promised the support for project_ids APIs, that is why it was not documented. However, it is a good idea that we can work on in the future.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"eba60366a877d2f3bf3c3d80047d21fe39a8ea5a","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                  \"for dynamic pollster [%s].\""},{"line_number":225,"context_line":"                  % (response_json, url, self.name))"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        if entry_size \u003e 0:"},{"line_number":228,"context_line":"            first_entry_name \u003d None"},{"line_number":229,"context_line":"            try:"},{"line_number":230,"context_line":"                first_entry_name \u003d next(iter(response_json))"},{"line_number":231,"context_line":"            except RuntimeError as e:"},{"line_number":232,"context_line":"                LOG.debug(\"Generator threw a StopIteration \""},{"line_number":233,"context_line":"                          \"and we need to catch it [%s].\" % e)"},{"line_number":234,"context_line":"            return response_json[first_entry_name]"},{"line_number":235,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_8d6045a7","line":234,"range":{"start_line":227,"start_character":0,"end_line":234,"end_character":50},"in_reply_to":"3fa7e38b_b2655cb7","updated":"2019-10-11 06:41:20.000000000","message":"OK, so you don\u0027t prefer the way \"wouldn\u0027t it be better to raise a question, and then let me execute the changes (after we discuss them)\", do you?\n\nI do believe your team will continue working on this but let\u0027s describe the things that are already supported and things that are not at the moment. I still prefer we describe the caveats of the dynamic pollster mechanism for now, and remove once it\u0027s implemented in the future.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"21f6d708a1108de6f23fcac25db575a83755dfb4","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class DynamicPollster(plugin_base.PollsterBase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    ALL_POLLSTER_FIELDS \u003d [\u0027name\u0027, \u0027sample_type\u0027, \u0027unit\u0027, \u0027value_attribute\u0027,"},{"line_number":39,"context_line":"                           \u0027endpoint_type\u0027, \u0027url_path\u0027, \u0027metadata_fields\u0027,"},{"line_number":40,"context_line":"                           \u0027skip_sample_values\u0027, \u0027value_mapping\u0027,"},{"line_number":41,"context_line":"                           \u0027default_value\u0027,  \u0027metadata_mapping\u0027,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3fa7e38b_adb15a46","line":38,"updated":"2019-10-14 19:34:03.000000000","message":"Hello Rafael,\n\nCould you split the pollster fields into REQUIRED,OPTIONAL and ALL sets? like:\n\nOPTIONAL_POLLSTER_FIELDS \u003d [\u0027metadata_fields\u0027, \u0027skip_sample_values\u0027, \u0027value_mapping\u0027, \u0027default_value\u0027, \u0027metadata_mapping\u0027, \u0027preserve_mapped_metadata\u0027]\n\nREQUIRED_POLLSTER_FIELDS \u003d [\u0027name\u0027, \u0027sample_type\u0027, \u0027unit\u0027, \u0027value_attribute\u0027, \u0027endpoint_type\u0027, \u0027url_path\u0027]\n\nALL_POLLSTER_FIELDS \u003d OPTIONAL_POLLSTER_FIELDS + REQUIRED_POLLSTER_FIELDS","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a8468d6c7a1ea1b7cd4dbccaa18188ed4ec13be3","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class DynamicPollster(plugin_base.PollsterBase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    ALL_POLLSTER_FIELDS \u003d [\u0027name\u0027, \u0027sample_type\u0027, \u0027unit\u0027, \u0027value_attribute\u0027,"},{"line_number":39,"context_line":"                           \u0027endpoint_type\u0027, \u0027url_path\u0027, \u0027metadata_fields\u0027,"},{"line_number":40,"context_line":"                           \u0027skip_sample_values\u0027, \u0027value_mapping\u0027,"},{"line_number":41,"context_line":"                           \u0027default_value\u0027,  \u0027metadata_mapping\u0027,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3fa7e38b_470a7e20","line":38,"in_reply_to":"3fa7e38b_adb15a46","updated":"2019-10-23 13:09:11.000000000","message":"Good idea. Thanks.\nDone.","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"}],"ceilometer/polling/manager.py":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":306,"context_line":"            LOG.info(\"Variable \u0027pollsters_definitions_dirs\u0027 not defined.\")"},{"line_number":307,"context_line":"            return []"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        LOG.info(\"Looking for dynamic pollsters configurations at [%s].\""},{"line_number":310,"context_line":"                 % pollsters_definitions_dirs)"},{"line_number":311,"context_line":"        pollsters_definitions_files \u003d []"},{"line_number":312,"context_line":"        for directory in pollsters_definitions_dirs:"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_2c86f7ba","line":309,"range":{"start_line":309,"start_character":66,"end_line":309,"end_character":70},"updated":"2019-10-11 01:02:37.000000000","message":"Using \u0027[]\u0027 everywhere looks weird. In addition, when using \u0027LOG.xxx()\u0027, it\u0027s not recommended to use the format `\"%s\" % var`, please take a look at https://docs.openstack.org/oslo.log/latest/user/guidelines.html#adding-variables-to-log-messages","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":306,"context_line":"            LOG.info(\"Variable \u0027pollsters_definitions_dirs\u0027 not defined.\")"},{"line_number":307,"context_line":"            return []"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        LOG.info(\"Looking for dynamic pollsters configurations at [%s].\""},{"line_number":310,"context_line":"                 % pollsters_definitions_dirs)"},{"line_number":311,"context_line":"        pollsters_definitions_files \u003d []"},{"line_number":312,"context_line":"        for directory in pollsters_definitions_dirs:"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_27da9077","line":309,"range":{"start_line":309,"start_character":66,"end_line":309,"end_character":70},"in_reply_to":"3fa7e38b_2c86f7ba","updated":"2019-10-11 02:13:19.000000000","message":"Well, I use it to mark where the variable starts and ends. This way I know that the content of the variable is in the []. Otherwise, I can never be sure about the variable that is written in the log.\n\nI will fix the String format.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"            LOG.info(\"File [%s] has [%s] dynamic pollster configurations.\" %"},{"line_number":333,"context_line":"                     (pollsters_definitions_file, len(pollsters_cfg)))"},{"line_number":334,"context_line":"            LOG.trace(\"Pollsters configurations [%s] loaded from file [%s].\" %"},{"line_number":335,"context_line":"                      (pollsters_cfg, pollsters_definitions_file))"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"            for pollster_cfg in pollsters_cfg:"},{"line_number":338,"context_line":"                pollster_name \u003d pollster_cfg[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_4c9b3316","line":335,"range":{"start_line":334,"start_character":0,"end_line":335,"end_character":66},"updated":"2019-10-11 01:02:37.000000000","message":"The log here is redundant, pollsters configuration is printed in the method \u0027declarative.load_definitions()\u0027. Also, we usually use LOG.debug rather than LOG.trace.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"            LOG.info(\"File [%s] has [%s] dynamic pollster configurations.\" %"},{"line_number":333,"context_line":"                     (pollsters_definitions_file, len(pollsters_cfg)))"},{"line_number":334,"context_line":"            LOG.trace(\"Pollsters configurations [%s] loaded from file [%s].\" %"},{"line_number":335,"context_line":"                      (pollsters_cfg, pollsters_definitions_file))"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"            for pollster_cfg in pollsters_cfg:"},{"line_number":338,"context_line":"                pollster_name \u003d pollster_cfg[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa7e38b_a73c4093","line":335,"range":{"start_line":334,"start_character":0,"end_line":335,"end_character":66},"in_reply_to":"3fa7e38b_4c9b3316","updated":"2019-10-11 02:13:19.000000000","message":"Ok, removed","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"}],"doc/source/admin/telemetry-dynamic-pollster.rst":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":107,"context_line":"      CHECK_COMPLETE: \"16\""},{"line_number":108,"context_line":"      ADOPT_COMPLETE: \"17\""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"*  ``default_value_mapping``: optional parameter. The default value for"},{"line_number":111,"context_line":"   the value mapping in case the variable value receives data that is not"},{"line_number":112,"context_line":"   mapped to something in the ``value_mapping`` configuration. This"},{"line_number":113,"context_line":"   attribute is only used when ``value_mapping`` is defined. Moreover, it"}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_cc2ac38f","line":110,"range":{"start_line":110,"start_character":5,"end_line":110,"end_character":26},"updated":"2019-10-11 01:02:37.000000000","message":"The name is confusing, i thought it\u0027s a dict but according to the description, it\u0027s a value, so please change the name to \u0027default_value\u0027 or something else.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":107,"context_line":"      CHECK_COMPLETE: \"16\""},{"line_number":108,"context_line":"      ADOPT_COMPLETE: \"17\""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"*  ``default_value_mapping``: optional parameter. The default value for"},{"line_number":111,"context_line":"   the value mapping in case the variable value receives data that is not"},{"line_number":112,"context_line":"   mapped to something in the ``value_mapping`` configuration. This"},{"line_number":113,"context_line":"   attribute is only used when ``value_mapping`` is defined. Moreover, it"}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_679ac862","line":110,"range":{"start_line":110,"start_character":5,"end_line":110,"end_character":26},"in_reply_to":"3fa7e38b_cc2ac38f","updated":"2019-10-11 02:13:19.000000000","message":"`default_value` makes sense. Thanks for the suggestion.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"  .. code-block:: yaml"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    value_mapping:"},{"line_number":125,"context_line":"      name: \"display_name\""},{"line_number":126,"context_line":"      some_attribute: \"new_attribute_name\""},{"line_number":127,"context_line":""}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_ac1f476a","line":124,"range":{"start_line":124,"start_character":4,"end_line":124,"end_character":17},"updated":"2019-10-11 01:02:37.000000000","message":"Should be \u0027metadata_mapping\u0027","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"  .. code-block:: yaml"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    value_mapping:"},{"line_number":125,"context_line":"      name: \"display_name\""},{"line_number":126,"context_line":"      some_attribute: \"new_attribute_name\""},{"line_number":127,"context_line":""}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_c7c13c31","line":124,"range":{"start_line":124,"start_character":4,"end_line":124,"end_character":17},"in_reply_to":"3fa7e38b_ac1f476a","updated":"2019-10-11 02:13:19.000000000","message":"Good catch.","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"086c060eb1b35ca124881f41d488fab669a5b89c","unresolved":false,"context_lines":[{"line_number":125,"context_line":"      name: \"display_name\""},{"line_number":126,"context_line":"      some_attribute: \"new_attribute_name\""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"*  ``preserve_mapped_metadata``: indicates if we preserve the old metadata name"},{"line_number":129,"context_line":"   when it gets mapped to a new one. The default value is ``True``."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"The complete YAML configuration to gather data from Magnum (that has been used"}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_0c0e9b3a","line":128,"range":{"start_line":128,"start_character":5,"end_line":128,"end_character":29},"updated":"2019-10-11 01:02:37.000000000","message":"Could you please help me to understand the relationship between metadata_mapping and preserve_mapped_metadata?","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"64cd190baec59b55e932b605d9c9df773c7a8ca3","unresolved":false,"context_lines":[{"line_number":125,"context_line":"      name: \"display_name\""},{"line_number":126,"context_line":"      some_attribute: \"new_attribute_name\""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"*  ``preserve_mapped_metadata``: indicates if we preserve the old metadata name"},{"line_number":129,"context_line":"   when it gets mapped to a new one. The default value is ``True``."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"The complete YAML configuration to gather data from Magnum (that has been used"}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa7e38b_e741d8a7","line":128,"range":{"start_line":128,"start_character":5,"end_line":128,"end_character":29},"in_reply_to":"3fa7e38b_0c0e9b3a","updated":"2019-10-11 02:13:19.000000000","message":"Sure. This request came from the billing team in the organization. They had some integration in place that used an attribute that exists in all of the APIs monitored so far. However, this attribute did not exist in a newly monitored API (which is monitored via the dynamic pollster system). We then introduced the \u0027metadata_mapping\u0027 feature, which is an option that allows people to map a metadata field to a new name. We then had a problem, for the operation team when troubleshooting something, they are used to the original attribute value, whereas the billing people would only care for the new one. We then created this option to preserve the mapped metadata name when sending data to Gnocchi (if we choose to do so).\n\nLet me show a concrete case. We use the following configuration to monitor load balancers. And, we had an integration that expected the name of the resouce to come from a \"display_name\" field. However, the \"v2/lbaas/loadbalancers\" API does not have such property. Therefore, we mapped the metadata \"name\" under a new name \"display_name\". We can then choose to send just the new mapped name to Gnocchi or both of them via \"preserve_mapped_metadata\" parameter. Did you understand its usage now?\n```\n- name: \"dynamic.network.services.lb.loadbalancer\"\n  sample_type: \"gauge\"\n  unit: \"loadbalancer\"\n  value_attribute: \"provisioning_status\"\n  endpoint_type: \"load-balancer\"\n  url_path: \"v2/lbaas/loadbalancers\"\n  metadata_fields:\n    - \"name\"\n    - \"flavor_id\"\n    - \"description\"\n    - \"provisioning_status\"\n    - \"vip_address\"\n    - \"operating_status\"\n    - \"created_at\"\n    - \"updated_at\"\n  value_mapping:\n    ACTIVE: \"1\"\n  metadata_map:\n    name: \"display_name\"\n  default_value_mapping: 0\n\n```","commit_id":"5fcb4a07c6ac38a9033a8364ab2c52c3b83ba4c9"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a35d42916f2bb6d7ca109a9d20a058109e1b06d4","unresolved":false,"context_lines":[{"line_number":131,"context_line":"The complete YAML configuration to gather data from Magnum (that has been used"},{"line_number":132,"context_line":"as an example) is the following:"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"  .. code-block:: yaml"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"      ---"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-rst","patch_set":33,"id":"3fa7e38b_2de4b10c","line":134,"updated":"2019-10-11 06:45:32.000000000","message":"Don\u0027t need to make indention if the code block is not in the list.","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a8468d6c7a1ea1b7cd4dbccaa18188ed4ec13be3","unresolved":false,"context_lines":[{"line_number":131,"context_line":"The complete YAML configuration to gather data from Magnum (that has been used"},{"line_number":132,"context_line":"as an example) is the following:"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"  .. code-block:: yaml"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"      ---"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-rst","patch_set":33,"id":"3fa7e38b_c4274cc7","line":134,"in_reply_to":"3fa7e38b_2de4b10c","updated":"2019-10-23 13:09:11.000000000","message":"ok","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"a35d42916f2bb6d7ca109a9d20a058109e1b06d4","unresolved":false,"context_lines":[{"line_number":194,"context_line":"      ---"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"      - name: \"dynamic.network.services.vpn.connection\""},{"line_number":197,"context_line":"      sample_type: \"gauge\""},{"line_number":198,"context_line":"      unit: \"ipsec_site_connection\""},{"line_number":199,"context_line":"      value_attribute: \"status\""},{"line_number":200,"context_line":"      endpoint_type: \"network\""}],"source_content_type":"text/x-rst","patch_set":33,"id":"3fa7e38b_adc18156","line":197,"updated":"2019-10-11 06:45:32.000000000","message":"There should be two spaces as indention.","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a8468d6c7a1ea1b7cd4dbccaa18188ed4ec13be3","unresolved":false,"context_lines":[{"line_number":194,"context_line":"      ---"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"      - name: \"dynamic.network.services.vpn.connection\""},{"line_number":197,"context_line":"      sample_type: \"gauge\""},{"line_number":198,"context_line":"      unit: \"ipsec_site_connection\""},{"line_number":199,"context_line":"      value_attribute: \"status\""},{"line_number":200,"context_line":"      endpoint_type: \"network\""}],"source_content_type":"text/x-rst","patch_set":33,"id":"3fa7e38b_44159c48","line":197,"in_reply_to":"3fa7e38b_adc18156","updated":"2019-10-23 13:09:11.000000000","message":"done","commit_id":"f1deb9926504b348731c6f7ee27fbda1ad0a9a8f"}]}
