From c2f653cad3327f26aa26a789b783b604393722b6 Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Wed, 16 Nov 2022 10:45:43 -0500 Subject: [PATCH] bug 1763225: add throttle rule to raw crash metadata This adds the throttle rule that caused the crash to be accepted to the raw crash metadata. This lets us debug things down the road. --- antenna/breakpad_resource.py | 3 ++- tests/unittest/test_fs_crashstorage.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/antenna/breakpad_resource.py b/antenna/breakpad_resource.py index 73cbcb0b..28fba343 100644 --- a/antenna/breakpad_resource.py +++ b/antenna/breakpad_resource.py @@ -362,7 +362,7 @@ def on_post(self, req, resp): ) raw_crash["uuid"] = crash_id - # Log the throttle result + # Log throttle result and add to raw crash logger.info( "%s: matched by %s; returned %s", crash_id, @@ -373,6 +373,7 @@ def on_post(self, req, resp): mymetrics.incr( "throttle", tags=["result:%s" % RESULT_TO_TEXT[throttle_result].lower()] ) + raw_crash["metadata"]["throttle_rule"] = rule_name # If the result is REJECT, then discard it if throttle_result is REJECT: diff --git a/tests/unittest/test_fs_crashstorage.py b/tests/unittest/test_fs_crashstorage.py index 650b3e9e..b4df50c9 100644 --- a/tests/unittest/test_fs_crashstorage.py +++ b/tests/unittest/test_fs_crashstorage.py @@ -80,7 +80,8 @@ def nix_tmpdir(fn): + b'"dump_checksums": ' + b'{"upload_file_minidump": "e9cee71ab932fde863338d08be4de9dfe39ea049bdafb342ce659ec5450b69ae"}, ' + b'"payload": "multipart", ' - + b'"payload_compressed": "0"' + + b'"payload_compressed": "0", ' + + b'"throttle_rule": "accept_everything"' + b"}, " + b'"submitted_timestamp": "2011-09-06T00:00:00+00:00", ' + b'"uuid": "de1bb258-cbbf-4589-a673-34f800160918", '