)]}'
{"etc/monasca/log-api-config.conf":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# Uncomment for monaasca-vagrant environment"},{"line_number":44,"context_line":"identity_uri \u003d http://192.168.10.5:35357"},{"line_number":45,"context_line":"auth_uri \u003d http://192.168.10.5:5000"},{"line_number":46,"context_line":"admin_password \u003d admin"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"admin_user \u003d admin"},{"line_number":49,"context_line":"admin_tenant_name \u003d admin"}],"source_content_type":"text/plain","patch_set":11,"id":"5a9d85d2_d01dd9be","line":46,"range":{"start_line":46,"start_character":0,"end_line":46,"end_character":14},"updated":"2016-06-20 20:19:53.000000000","message":"I would prefer not changing the defaults as the DevStack environment is the \"official\" environment for testing these days.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# Uncomment for monaasca-vagrant environment"},{"line_number":44,"context_line":"identity_uri \u003d http://192.168.10.5:35357"},{"line_number":45,"context_line":"auth_uri \u003d http://192.168.10.5:5000"},{"line_number":46,"context_line":"admin_password \u003d admin"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"admin_user \u003d admin"},{"line_number":49,"context_line":"admin_tenant_name \u003d admin"}],"source_content_type":"text/plain","patch_set":11,"id":"5a9d85d2_39ffcf68","line":46,"range":{"start_line":46,"start_character":0,"end_line":46,"end_character":14},"in_reply_to":"5a9d85d2_d01dd9be","updated":"2016-06-21 05:24:38.000000000","message":"Sorry, that was done by mistake. I will fix that in next patch set.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"}],"monasca_log_api/reference/common/log_publisher.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        return msg_str"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def truncate(self, envelope, diff_size):"},{"line_number":190,"context_line":"        \"\"\"Truncates the message if needed."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        Each message send to kafka is verified."}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_9086b1b7","line":189,"range":{"start_line":189,"start_character":8,"end_line":189,"end_character":16},"updated":"2016-06-20 20:19:53.000000000","message":"If this is private, should this have a \"_\" for the method prefix?","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        return msg_str"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def truncate(self, envelope, diff_size):"},{"line_number":190,"context_line":"        \"\"\"Truncates the message if needed."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        Each message send to kafka is verified."}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_b41e2661","line":189,"range":{"start_line":189,"start_character":8,"end_line":189,"end_character":16},"in_reply_to":"5a9d85d2_9086b1b7","updated":"2016-06-21 05:24:38.000000000","message":"Yes, I think I will make all those methods private, apart from send_message.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        Method checks if message serialized to json"},{"line_number":194,"context_line":"        exceeds maximum allowed size that can be posted to kafka"},{"line_number":195,"context_line":"        queue. If so, method truncates message property of the log"},{"line_number":196,"context_line":"        by difference between message and allowed size."},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        :param Envelope envelope: original envelope"},{"line_number":199,"context_line":"        :param int diff_size: difference between maximum size and envelope size"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_2e9151f1","line":196,"range":{"start_line":196,"start_character":8,"end_line":196,"end_character":10},"updated":"2016-06-20 20:19:53.000000000","message":"Is this comment still accurate. Seems like thus method is expecting to do truncation.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        Method checks if message serialized to json"},{"line_number":194,"context_line":"        exceeds maximum allowed size that can be posted to kafka"},{"line_number":195,"context_line":"        queue. If so, method truncates message property of the log"},{"line_number":196,"context_line":"        by difference between message and allowed size."},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        :param Envelope envelope: original envelope"},{"line_number":199,"context_line":"        :param int diff_size: difference between maximum size and envelope size"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_f45eeee7","line":196,"range":{"start_line":196,"start_character":8,"end_line":196,"end_character":10},"in_reply_to":"5a9d85d2_2e9151f1","updated":"2016-06-21 05:24:38.000000000","message":"I still cannot decide how to organize that code. \nHowever I think that I\u0027ll move entire truncation logic inside _truncate method and make it like _transform message by default verifies envelope and executes truncation.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        LOG.warn((\u0027Detected message that exceeds %d bytes,\u0027"},{"line_number":207,"context_line":"                  \u0027message will be truncated by %d bytes\u0027),"},{"line_number":208,"context_line":"                 CONF.log_publisher.max_message_size,"},{"line_number":209,"context_line":"                 truncated_by)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        log_msg \u003d envelope[\u0027log\u0027][\u0027message\u0027]"},{"line_number":212,"context_line":"        truncated_log_msg \u003d log_msg[:-truncated_by]"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_6e4fd992","line":209,"range":{"start_line":209,"start_character":17,"end_line":209,"end_character":29},"updated":"2016-06-20 20:19:53.000000000","message":"Wondering if it would be better to move this warn message to outside of this method.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        LOG.warn((\u0027Detected message that exceeds %d bytes,\u0027"},{"line_number":207,"context_line":"                  \u0027message will be truncated by %d bytes\u0027),"},{"line_number":208,"context_line":"                 CONF.log_publisher.max_message_size,"},{"line_number":209,"context_line":"                 truncated_by)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        log_msg \u003d envelope[\u0027log\u0027][\u0027message\u0027]"},{"line_number":212,"context_line":"        truncated_log_msg \u003d log_msg[:-truncated_by]"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_14ebbab1","line":209,"range":{"start_line":209,"start_character":17,"end_line":209,"end_character":29},"in_reply_to":"5a9d85d2_6e4fd992","updated":"2016-06-21 05:24:38.000000000","message":"This shouldn\u0027t be a problem in next PS","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        failed_to_send \u003d all_count - sent_count"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        if failed_to_send \u003d\u003d 0:"},{"line_number":263,"context_line":"            LOG.info(\u0027Successfully published all [%d] messages\u0027,"},{"line_number":264,"context_line":"                     sent_count)"},{"line_number":265,"context_line":"        else:"},{"line_number":266,"context_line":"            error_str \u003d (\u0027Failed to sent all messages, %d \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_6e3199a2","line":263,"range":{"start_line":263,"start_character":22,"end_line":263,"end_character":34},"updated":"2016-06-20 20:19:53.000000000","message":"I would not suggest this log message at info level as it will add lot\u0027s of log messages to the file. Debug or trace levels would be better.","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        failed_to_send \u003d all_count - sent_count"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        if failed_to_send \u003d\u003d 0:"},{"line_number":263,"context_line":"            LOG.info(\u0027Successfully published all [%d] messages\u0027,"},{"line_number":264,"context_line":"                     sent_count)"},{"line_number":265,"context_line":"        else:"},{"line_number":266,"context_line":"            error_str \u003d (\u0027Failed to sent all messages, %d \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_b4dc6613","line":263,"range":{"start_line":263,"start_character":22,"end_line":263,"end_character":34},"in_reply_to":"5a9d85d2_6e3199a2","updated":"2016-06-21 05:24:38.000000000","message":"Done","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            LOG.info(\u0027Successfully published all [%d] messages\u0027,"},{"line_number":264,"context_line":"                     sent_count)"},{"line_number":265,"context_line":"        else:"},{"line_number":266,"context_line":"            error_str \u003d (\u0027Failed to sent all messages, %d \u0027"},{"line_number":267,"context_line":"                         \u0027messages out of %d have not been published\u0027)"},{"line_number":268,"context_line":"            LOG.error(error_str, failed_to_send, all_count)"},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_e86d8105","line":266,"range":{"start_line":266,"start_character":36,"end_line":266,"end_character":40},"updated":"2016-06-20 20:19:53.000000000","message":"sent -\u003e send","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            LOG.info(\u0027Successfully published all [%d] messages\u0027,"},{"line_number":264,"context_line":"                     sent_count)"},{"line_number":265,"context_line":"        else:"},{"line_number":266,"context_line":"            error_str \u003d (\u0027Failed to sent all messages, %d \u0027"},{"line_number":267,"context_line":"                         \u0027messages out of %d have not been published\u0027)"},{"line_number":268,"context_line":"            LOG.error(error_str, failed_to_send, all_count)"},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_94d7aaec","line":266,"range":{"start_line":266,"start_character":36,"end_line":266,"end_character":40},"in_reply_to":"5a9d85d2_e86d8105","updated":"2016-06-21 05:24:38.000000000","message":"Done","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"5ea142048f22ca6a21b92f1b3f82cb4edc01f153","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        :rtype: str"},{"line_number":167,"context_line":"        \"\"\""},{"line_number":168,"context_line":"        if not self._is_message_valid(message):"},{"line_number":169,"context_line":"            raise InvalidMessageException()"},{"line_number":170,"context_line":"        return self._truncate(message)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _truncate(self, envelope):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_9177339f","line":169,"range":{"start_line":169,"start_character":18,"end_line":169,"end_character":41},"updated":"2016-06-24 19:00:03.000000000","message":"I sort of liked it better when this test was done in the loop up above in the for message loop on line 137 better, but I don\u0027t think it is worth changing.","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"0d58cc72a80b5da65740af7c1206839325d00108","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        :rtype: str"},{"line_number":167,"context_line":"        \"\"\""},{"line_number":168,"context_line":"        if not self._is_message_valid(message):"},{"line_number":169,"context_line":"            raise InvalidMessageException()"},{"line_number":170,"context_line":"        return self._truncate(message)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _truncate(self, envelope):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_9c3a98e5","line":169,"range":{"start_line":169,"start_character":18,"end_line":169,"end_character":41},"in_reply_to":"3aaa91ec_6a2f30a1","updated":"2016-06-25 12:44:34.000000000","message":"Actually I am starting to think that this is not needed at all, it will be always an instance of Envelope, so why even bother with checking if that\u0027s true ?","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"c1b20d707e4c1cd3ca7d361a16e26329fcf46367","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        :rtype: str"},{"line_number":167,"context_line":"        \"\"\""},{"line_number":168,"context_line":"        if not self._is_message_valid(message):"},{"line_number":169,"context_line":"            raise InvalidMessageException()"},{"line_number":170,"context_line":"        return self._truncate(message)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _truncate(self, envelope):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_6a2f30a1","line":169,"range":{"start_line":169,"start_character":18,"end_line":169,"end_character":41},"in_reply_to":"3aaa91ec_9177339f","updated":"2016-06-24 19:57:30.000000000","message":"I wanted to have single method to be overridden in BulkProcessor, that\u0027s why I made that like this.","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"5ea142048f22ca6a21b92f1b3f82cb4edc01f153","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        :param list messages: list of messages"},{"line_number":220,"context_line":"        \"\"\""},{"line_number":221,"context_line":"        to_sent \u003d len(messages)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        LOG.debug(\u0027Publishing %d messages\u0027, to_sent)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_51adcb86","line":221,"range":{"start_line":221,"start_character":8,"end_line":221,"end_character":15},"updated":"2016-06-24 19:00:03.000000000","message":"Was just wondering why call this variable \"to_sent\" instead of \"num_sent\"","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"c1b20d707e4c1cd3ca7d361a16e26329fcf46367","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        :param list messages: list of messages"},{"line_number":220,"context_line":"        \"\"\""},{"line_number":221,"context_line":"        to_sent \u003d len(messages)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        LOG.debug(\u0027Publishing %d messages\u0027, to_sent)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_4aa51445","line":221,"range":{"start_line":221,"start_character":8,"end_line":221,"end_character":15},"in_reply_to":"3aaa91ec_51adcb86","updated":"2016-06-24 19:57:30.000000000","message":"Well, actually that\u0027s the number of messages we would like to post, not that we\u0027ve already posted, so I will change that to num_to_sent. That\u0027s far better name.","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"5ea142048f22ca6a21b92f1b3f82cb4edc01f153","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        return message and isinstance(message, model.Envelope)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_1176a36f","line":244,"range":{"start_line":244,"start_character":16,"end_line":244,"end_character":39},"updated":"2016-06-24 19:00:03.000000000","message":"Actually, this method just returns true/false now and I don\u0027t think returns an exception. Although, changing the method name to \"validate_message\" and throwing InvalidMessageException directly, rather than returning a boolean, testing it, and then throwing an exception, might be the better approach and more consistent with some of the other validation methods in validation.py.","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"c1b20d707e4c1cd3ca7d361a16e26329fcf46367","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        return message and isinstance(message, model.Envelope)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_ea43206a","line":244,"range":{"start_line":244,"start_character":16,"end_line":244,"end_character":39},"in_reply_to":"3aaa91ec_1176a36f","updated":"2016-06-24 19:57:30.000000000","message":"Yes, that\u0027s kind of misleading looking at this your way.","commit_id":"573e1bbfcd7faf446763a6dffed79f1acd193235"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            messages \u003d [messages]"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        sent_counter \u003d 0"},{"line_number":129,"context_line":"        to_sent_counter \u003d len(messages)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        LOG.debug(\u0027About to publish %d messages to %s topics\u0027,"},{"line_number":132,"context_line":"                  to_sent_counter, self._topics)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_5bc8af74","line":129,"range":{"start_line":129,"start_character":8,"end_line":129,"end_character":23},"updated":"2016-07-15 12:24:13.000000000","message":"Please see my another comment on variable names.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":7874,"name":"Venkat Sundaram","email":"tsv@hp.com","username":"tsv"},"change_message_id":"48fa2b99bad4fb241640d908112bf0b670b99aca","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                     truncated_by)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            log_msg \u003d envelope[\u0027log\u0027][\u0027message\u0027]"},{"line_number":204,"context_line":"            truncated_log_msg \u003d log_msg[:-truncated_by]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            envelope[\u0027log\u0027][\u0027truncated\u0027] \u003d True"},{"line_number":207,"context_line":"            envelope[\u0027log\u0027][\u0027message\u0027] \u003d truncated_log_msg"}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_c603730c","line":204,"range":{"start_line":204,"start_character":32,"end_line":204,"end_character":39},"updated":"2016-07-18 06:05:12.000000000","message":"Could the truncate feature be made optional (configurable) ? Reason is, this is the only place where an assumption that the message field has to be a string is made. If the caller instead passes JSON entry for the message field, for example, this would fail. Even if the JSON value is stringified before the check, it doesn\u0027t make sense to truncate it.\nI even considered mapping a JSON log record such that the message string field is passed as the message field and other fields from the source log record inside \"dimensions\". However, the source log record has fields that doesn\u0027t confirm to the validation rules of dimensions. A good example is the Openstack audit logs that are formatted as CADF JSON (it has fields that are nested dictionaries).\n\nI don\u0027t expect this patch to address this comment, but just noting my observation to check if a separate patch could address this. In that case, I\u0027m not sure what should be the alternate action to truncating the message. Perhaps reject the message with a HTTP 413 (request too long) error if the message field is not a string ? The caller may not be able to take the corrective action other than logging the situation and moving on, but may be tuning the max_message_size in the server side might help ? Perhaps a separate discussion topic ?","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        :param list messages: list of messages"},{"line_number":220,"context_line":"        \"\"\""},{"line_number":221,"context_line":"        to_sent \u003d len(messages)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        LOG.debug(\u0027Publishing %d messages\u0027, to_sent)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_bbad539d","line":221,"range":{"start_line":221,"start_character":8,"end_line":221,"end_character":15},"updated":"2016-07-15 12:24:13.000000000","message":"Please see my another comment on variable names.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"9a6b8681b7b3549379db6e87a4d9b992d084ce5b","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        :param list messages: list of messages"},{"line_number":220,"context_line":"        \"\"\""},{"line_number":221,"context_line":"        to_sent \u003d len(messages)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        LOG.debug(\u0027Publishing %d messages\u0027, to_sent)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_cb5d3cee","line":221,"range":{"start_line":221,"start_character":8,"end_line":221,"end_character":15},"in_reply_to":"1aa78d24_bbad539d","updated":"2016-07-18 05:29:01.000000000","message":"Done","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        \"\"\"Validates message before sending."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        Methods checks if message is :py:class:`model.Envelope`."},{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_5b938ffa","line":241,"range":{"start_line":241,"start_character":40,"end_line":241,"end_character":50},"updated":"2016-07-15 12:24:13.000000000","message":"it is ensured","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"9a6b8681b7b3549379db6e87a4d9b992d084ce5b","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        \"\"\"Validates message before sending."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        Methods checks if message is :py:class:`model.Envelope`."},{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_4b966c95","line":241,"range":{"start_line":241,"start_character":40,"end_line":241,"end_character":50},"in_reply_to":"1aa78d24_5b938ffa","updated":"2016-07-18 05:29:01.000000000","message":"Done","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        return message and isinstance(message, model.Envelope)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_9b621715","line":244,"range":{"start_line":244,"start_character":8,"end_line":244,"end_character":77},"updated":"2016-07-15 12:24:13.000000000","message":"As Roland noticed, this line is not correct.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"9a6b8681b7b3549379db6e87a4d9b992d084ce5b","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        By being instance of this class it ensured that all required"},{"line_number":242,"context_line":"        keys are found and they will have their values."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :raises InvalidMessageException: if message does not comply to schema"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        return message and isinstance(message, model.Envelope)"}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_6b8d307b","line":244,"range":{"start_line":244,"start_character":8,"end_line":244,"end_character":77},"in_reply_to":"1aa78d24_9b621715","updated":"2016-07-18 05:29:01.000000000","message":"Done","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"}],"monasca_log_api/reference/v3/common/bulk_processor.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                sent_count \u003d len(data)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        except Exception as ex:"},{"line_number":81,"context_line":"            LOG.error((\u0027Failed to sent bulk package \u0027"},{"line_number":82,"context_line":"                       \u0027\u003clogs\u003d%d, dimensions\u003d%s\u0027),"},{"line_number":83,"context_line":"                      to_sent_count,"},{"line_number":84,"context_line":"                      global_dimensions)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_f3f29f99","line":81,"range":{"start_line":81,"start_character":34,"end_line":81,"end_character":38},"updated":"2016-06-20 20:19:53.000000000","message":"sent -\u003e send","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"0a6d56b1161f3523aa7b5330035887c0954af82e","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            return None"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def get_envelope(self, log_element, tenant_id, dimensions\u003dNone):"},{"line_number":118,"context_line":"        \"\"\"Create a log envelope."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        :param dict log_element: raw log element"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_ee6589e1","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":20},"updated":"2016-06-20 20:19:53.000000000","message":"This should probably be renamed to create_envelope(..)","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"678429fa2a51b9fad9eb8cb840e80dd1b5a1ed78","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            return None"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def get_envelope(self, log_element, tenant_id, dimensions\u003dNone):"},{"line_number":118,"context_line":"        \"\"\"Create a log envelope."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        :param dict log_element: raw log element"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a9d85d2_d42e52f9","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":20},"in_reply_to":"5a9d85d2_ee6589e1","updated":"2016-06-21 05:24:38.000000000","message":"Done","commit_id":"d3507a502435d4730d7f4bbc8287f3d0064139b9"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        :param str log_tenant_id: tenant who sent logs"},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        sent_count \u003d 0"},{"line_number":60,"context_line":"        to_sent_counter \u003d len(logs) if logs else 0"},{"line_number":61,"context_line":"        to_send_data \u003d []"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_9094b6e8","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":18},"updated":"2016-07-15 12:24:13.000000000","message":"In the parent class the variable is called \u0027sent_counter\u0027. Please synchronize the names.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"41e4bedb4286ecb9d6eb9a9e0fb0275eec833538","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        :param str log_tenant_id: tenant who sent logs"},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        sent_count \u003d 0"},{"line_number":60,"context_line":"        to_sent_counter \u003d len(logs) if logs else 0"},{"line_number":61,"context_line":"        to_send_data \u003d []"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_8b1d0469","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":18},"in_reply_to":"1aa78d24_9094b6e8","updated":"2016-07-18 05:06:47.000000000","message":"Class inheritance is hardly an indicator that local variables (bound to method scope) should be called the same - they\u0027re not inherited.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"410e8925a69c774603d2b1554024232aca242a14","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        :param str log_tenant_id: tenant who sent logs"},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        sent_count \u003d 0"},{"line_number":60,"context_line":"        to_sent_counter \u003d len(logs) if logs else 0"},{"line_number":61,"context_line":"        to_send_data \u003d []"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_7ec4825e","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":18},"in_reply_to":"dada55a8_8b1d0469","updated":"2016-07-19 13:23:09.000000000","message":"You\u0027re right it, it is not about inheritance. It is about consistent naming. It is a good practice to choose the same name for variables which logically have the same meaning.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"36634fdb437747cf03c698003dd8a90a12446652","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        sent_count \u003d 0"},{"line_number":60,"context_line":"        to_sent_counter \u003d len(logs) if logs else 0"},{"line_number":61,"context_line":"        to_send_data \u003d []"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        LOG.debug(\u0027Bulk package \u003clogs\u003d%d, dimensions\u003d%s, tenant_id\u003d%s\u003e\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_9b5df7ee","line":60,"range":{"start_line":60,"start_character":8,"end_line":60,"end_character":23},"updated":"2016-07-15 12:24:13.000000000","message":"I also don\u0027t like that one. \u0027sent\u0027 is past form, it does not fit here, and it is not really a \u0027counter\u0027. \u0027num_msg\u0027, \u0027num_logs\u0027 or \u0027to_send\u0027 would be better here. And also please update the parent class.","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"98609f0295d21b33a12c1c43a1005fc2ba9da4be","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        sent_count \u003d 0"},{"line_number":60,"context_line":"        to_sent_counter \u003d len(logs) if logs else 0"},{"line_number":61,"context_line":"        to_send_data \u003d []"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        LOG.debug(\u0027Bulk package \u003clogs\u003d%d, dimensions\u003d%s, tenant_id\u003d%s\u003e\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_c830a20a","line":60,"range":{"start_line":60,"start_character":8,"end_line":60,"end_character":23},"in_reply_to":"1aa78d24_9b5df7ee","updated":"2016-07-18 05:00:57.000000000","message":"I will update the names, they can be misleading.\n\nI just don\u0027t understand what parent class has to do with this one here ;-).","commit_id":"cdf9da560c8cd192c28a1b9e588c444cdf5ee209"}]}
