SolvedUptime Monitoring
Monitor reports DOWN although the endpoint returns 200
Asked by John Carter8 days ago
Our health endpoint returns 200 with a small JSON body. I can curl it from anywhere and it is fine. MonoDuty keeps flipping the monitor to DOWN and opening incidents. The error text mentions something about expected body.
Accepted answer from MonoDuty Support
44
Deniz ArslanMonoDuty Support Engineer6 days ago
That is exactly it. The comparison is a plain case-sensitive substring match, not JSON parsing, so a single space breaks it. To fix:
1. Open the monitor and edit the expected body text so it matches the raw response byte for byte. For compact JSON that means no space after the colon.
2. Safer still, use a short distinctive fragment rather than a full key-value pair. Something like ok or healthy is much less brittle.
3. If you do not need body validation at all, clear the field. With it empty, the check passes on any 2xx response.
4. Save and wait one check interval, or shorten the interval temporarily to see the result faster.
While you are in there, one related setting worth knowing: if you leave expected status codes empty, any 2xx counts as up. If you fill it in, only the codes you list count. Those two validations run in order, status first, then body, then headers, and the first failure is what you see in the error message.
Was this helpful?44 of 46 found this helpful
3 replies
Deniz ArslanMonoDuty Support Engineer7 days ago
Hi John, that error text is the key. A monitor does not stop at the status code. If you filled in the expected body text field, the response body must contain that exact substring, and a mismatch marks the check as down even on a 200. Could you tell me what you put in that field and what your endpoint actually returns?
John Carter7 days ago
The field has status: ok with a space after the colon. The endpoint returns compact JSON, so no space.
John Carter6 days ago
Switched to just checking for ok and it has been green since.