diff --git a/monitoring/monitorlib/fetch/__init__.py b/monitoring/monitorlib/fetch/__init__.py index a9ced61b54..5a71144fe5 100644 --- a/monitoring/monitorlib/fetch/__init__.py +++ b/monitoring/monitorlib/fetch/__init__.py @@ -315,7 +315,7 @@ def query_and_describe( req_kwargs["timeout"] = TIMEOUTS # Attach a request_id field to the JSON body of any outgoing request with a JSON body that doesn't already have one - if "json" in req_kwargs and "request_id" not in req_kwargs["json"]: + if "json" in req_kwargs and isinstance(req_kwargs["json"], dict) and "request_id" not in req_kwargs["json"]: json_body = json.loads(json.dumps(req_kwargs["json"])) json_body["request_id"] = str(uuid.uuid4()) req_kwargs["json"] = json_body