)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15178,"name":"Kamil Choroba","email":"kamil.choroba@est.fujitsu.com","username":"kchoroba"},"change_message_id":"8dec62d532d72f53aa1aa8748f321eb3d392d90b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add support for global dimensions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If global dimensions are specified at top level, then do not"},{"line_number":10,"context_line":"require per log entry level dimensions. If both global and"},{"line_number":11,"context_line":"per log level dimensions are provided, then the per log level"},{"line_number":12,"context_line":"dimensions will override the global one."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I4576383e4182916953d18dce55a65737116e1f74"},{"line_number":15,"context_line":"implements: https://review.openstack.org/#/c/273058"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9aed3d3a_5c0e678c","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":40},"updated":"2016-03-01 08:47:12.000000000","message":"I would prefer to have the global-dimensions required. log-specific dimensions are optional. If global-dimensions are missing, then abandon the request. If both are provided, then append global-dimensions to log-specific dimensions.","commit_id":"ef35cef3dfdf8ed69dee4550d10ad1d8e228ef92"}],"monasca_log_api/reference/v3/logs.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"375aff06f8ebd12118fe0ebd12d71185a5a39c33","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        \"\"\"Get the dimensions in the log element.\"\"\""},{"line_number":72,"context_line":"        dimensions \u003d None"},{"line_number":73,"context_line":"        if \u0027dimensions\u0027 in log_element:"},{"line_number":74,"context_line":"            local_dims \u003d log_element[\u0027dimensions\u0027]"},{"line_number":75,"context_line":"            if global_dims:"},{"line_number":76,"context_line":"                dimensions \u003d global_dims.copy()"},{"line_number":77,"context_line":"                dimensions.update(local_dims)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_a9495d62","line":74,"range":{"start_line":74,"start_character":25,"end_line":74,"end_character":36},"updated":"2016-03-17 22:10:46.000000000","message":"Check comment below.","commit_id":"150262f57dc9e5da7fafdc016ae64c264781d6c1"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"e21cba0e06401ba4643829c1e274dc0f02fccbf9","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        \"\"\"Get the dimensions in the log element.\"\"\""},{"line_number":72,"context_line":"        dimensions \u003d None"},{"line_number":73,"context_line":"        if \u0027dimensions\u0027 in log_element:"},{"line_number":74,"context_line":"            local_dims \u003d log_element[\u0027dimensions\u0027]"},{"line_number":75,"context_line":"            if global_dims:"},{"line_number":76,"context_line":"                dimensions \u003d global_dims.copy()"},{"line_number":77,"context_line":"                dimensions.update(local_dims)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_c0d3b7d3","line":74,"range":{"start_line":74,"start_character":25,"end_line":74,"end_character":36},"in_reply_to":"1af94dfe_a9495d62","updated":"2016-03-18 15:19:24.000000000","message":"Done","commit_id":"150262f57dc9e5da7fafdc016ae64c264781d6c1"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"375aff06f8ebd12118fe0ebd12d71185a5a39c33","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        \"\"\"Get the top level dimensions in the HTTP request body.\"\"\""},{"line_number":95,"context_line":"        if \u0027dimensions\u0027 not in request_body:"},{"line_number":96,"context_line":"            return None"},{"line_number":97,"context_line":"        global_dims \u003d request_body[\u0027dimensions\u0027]"},{"line_number":98,"context_line":"        service.Validations.validate_dimensions(global_dims)"},{"line_number":99,"context_line":"        return global_dims"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_49409934","line":97,"range":{"start_line":97,"start_character":22,"end_line":97,"end_character":34},"updated":"2016-03-17 22:10:46.000000000","message":"If not set that will throw an error.\nUse get function here with default option.\n\n request_body.get(\u0027dimensions\u0027, {})","commit_id":"150262f57dc9e5da7fafdc016ae64c264781d6c1"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"e21cba0e06401ba4643829c1e274dc0f02fccbf9","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        \"\"\"Get the top level dimensions in the HTTP request body.\"\"\""},{"line_number":95,"context_line":"        if \u0027dimensions\u0027 not in request_body:"},{"line_number":96,"context_line":"            return None"},{"line_number":97,"context_line":"        global_dims \u003d request_body[\u0027dimensions\u0027]"},{"line_number":98,"context_line":"        service.Validations.validate_dimensions(global_dims)"},{"line_number":99,"context_line":"        return global_dims"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_a015cb9c","line":97,"range":{"start_line":97,"start_character":22,"end_line":97,"end_character":34},"in_reply_to":"1af94dfe_49409934","updated":"2016-03-18 15:19:24.000000000","message":"The existence of the key is checked two lines above.","commit_id":"150262f57dc9e5da7fafdc016ae64c264781d6c1"},{"author":{"_account_id":15178,"name":"Kamil Choroba","email":"kamil.choroba@est.fujitsu.com","username":"kchoroba"},"change_message_id":"02cda4aaa20d9a2e56ad3abb4a146703372621ff","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                dimensions.update(local_dims)"},{"line_number":78,"context_line":"            else:"},{"line_number":79,"context_line":"                dimensions \u003d local_dims"},{"line_number":80,"context_line":"            service.Validations.validate_dimensions(dimensions)"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            dimensions \u003d global_dims"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_bddbf51a","line":80,"range":{"start_line":80,"start_character":12,"end_line":80,"end_character":63},"updated":"2016-03-21 11:02:05.000000000","message":"i think we could get better performance, if we would check only the local_dims here. Because the global_dims are already checked before.\n\u0027service.Validations.validate_dimensions(local_dims)\u0027","commit_id":"190e3725dd19772c1119db9c84b8180022de56e7"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"7f52602409a674f296be62ba11388f25f1ddfdb1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                dimensions.update(local_dims)"},{"line_number":78,"context_line":"            else:"},{"line_number":79,"context_line":"                dimensions \u003d local_dims"},{"line_number":80,"context_line":"            service.Validations.validate_dimensions(dimensions)"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            dimensions \u003d global_dims"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_bd813592","line":80,"range":{"start_line":80,"start_character":12,"end_line":80,"end_character":63},"in_reply_to":"fa0719c6_bddbf51a","updated":"2016-03-21 11:07:37.000000000","message":"Done","commit_id":"190e3725dd19772c1119db9c84b8180022de56e7"}],"monasca_log_api/v3/reference/logs.py":[{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"526eebae2b1bb900a4096f0f49946d1b1936d295","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        request_body \u003d helpers.read_json_msg_body(req)"},{"line_number":47,"context_line":"        log_list \u003d self._get_logs(request_body)"},{"line_number":48,"context_line":"        global_dimensions \u003d self._get_global_dimensions(request_body)"},{"line_number":49,"context_line":"        if global_dimensions:"},{"line_number":50,"context_line":"            dimensions_expected \u003d False"},{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            dimensions_expected \u003d True"},{"line_number":53,"context_line":"        envelopes \u003d []"},{"line_number":54,"context_line":"        for log_element in log_list:"},{"line_number":55,"context_line":"            # if global dimensions are specified, then it is optional to"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_cdfe1505","line":52,"range":{"start_line":49,"start_character":8,"end_line":52,"end_character":38},"updated":"2016-03-01 15:29:19.000000000","message":"Wouldn\u0027t it be better to pass global_dimensions to _get_dimensions function and move the logic there?","commit_id":"ef35cef3dfdf8ed69dee4550d10ad1d8e228ef92"},{"author":{"_account_id":15178,"name":"Kamil Choroba","email":"kamil.choroba@est.fujitsu.com","username":"kchoroba"},"change_message_id":"8dec62d532d72f53aa1aa8748f321eb3d392d90b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            # specify it per log element. If both are specified, it overrides"},{"line_number":57,"context_line":"            # the global dimensions"},{"line_number":58,"context_line":"            dimensions \u003d self._get_dimensions(log_element, dimensions_expected)"},{"line_number":59,"context_line":"            if not dimensions:"},{"line_number":60,"context_line":"                # use the common dimensions instead"},{"line_number":61,"context_line":"                dimensions \u003d global_dimensions"},{"line_number":62,"context_line":"            service.Validations.validate_dimensions(dimensions)"},{"line_number":63,"context_line":"            log_message \u003d self._get_log_message(log_element)"},{"line_number":64,"context_line":"            envelope \u003d self._create_log_envelope(tenant_id, cross_tenant_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aed3d3a_fc193b23","line":61,"range":{"start_line":59,"start_character":12,"end_line":61,"end_character":46},"updated":"2016-03-01 08:47:12.000000000","message":"shouldn\u0027t we append the dimensions? And not override? I mean, global-dimensions are for example hostname, ip. And i want to have these dimensions in each log-entry additionally to the log-entry specific dimensions (service-name, path, etc.)","commit_id":"ef35cef3dfdf8ed69dee4550d10ad1d8e228ef92"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"526eebae2b1bb900a4096f0f49946d1b1936d295","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            if not dimensions:"},{"line_number":60,"context_line":"                # use the common dimensions instead"},{"line_number":61,"context_line":"                dimensions \u003d global_dimensions"},{"line_number":62,"context_line":"            service.Validations.validate_dimensions(dimensions)"},{"line_number":63,"context_line":"            log_message \u003d self._get_log_message(log_element)"},{"line_number":64,"context_line":"            envelope \u003d self._create_log_envelope(tenant_id, cross_tenant_id,"},{"line_number":65,"context_line":"                                                 self._service_config.region,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_a0e2a09d","line":62,"range":{"start_line":62,"start_character":12,"end_line":62,"end_character":63},"updated":"2016-03-01 15:29:19.000000000","message":"For global_dimensions we don\u0027t need that here. I would move validation to _get_dimensions and _get_global_dimensions functions.","commit_id":"ef35cef3dfdf8ed69dee4550d10ad1d8e228ef92"},{"author":{"_account_id":15178,"name":"Kamil Choroba","email":"kamil.choroba@est.fujitsu.com","username":"kchoroba"},"change_message_id":"8dec62d532d72f53aa1aa8748f321eb3d392d90b","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _get_dimensions(self, log_element, dimensions_expected\u003dTrue):"},{"line_number":82,"context_line":"        \"\"\"Get the dimensions in the log element.\"\"\""},{"line_number":83,"context_line":"        dimensions \u003d None"},{"line_number":84,"context_line":"        if \u0027dimensions\u0027 in log_element:"},{"line_number":85,"context_line":"            dimensions \u003d log_element[\u0027dimensions\u0027]"},{"line_number":86,"context_line":"        elif dimensions_expected:"},{"line_number":87,"context_line":"            raise exceptions.HTTPUnprocessableEntity("},{"line_number":88,"context_line":"                \u0027Unprocessable Entity Dimensions not found\u0027)"},{"line_number":89,"context_line":"        return dimensions"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _get_log_message(self, log_element):"},{"line_number":92,"context_line":"        \"\"\"Get the message in the log element.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9aed3d3a_fc75bb31","line":89,"range":{"start_line":83,"start_character":8,"end_line":89,"end_character":25},"updated":"2016-03-01 08:47:12.000000000","message":"Maybe we should only check if the global dimensions are set. Otherwise raise an exception. In this solution it can be possible that 99 of 100 send logs are okay, but only one has missing dimensions. Then we would abandon 100 logs because of 1 failure","commit_id":"ef35cef3dfdf8ed69dee4550d10ad1d8e228ef92"}]}
