Test environment monitoring: endpoints and the certificate
In the morning, the app won’t load the catalog, testers file bugs against the build, and an hour later it turns out the test environment’s certificate expired overnight. Nobody checks the test environment until someone runs into it. Monitoring in Microkoi Bench checks the endpoints from your collection on a schedule and flags a certificate that’s about to expire well in advance.
Why a broken test environment costs a morning
A broken test environment looks like a bug in the app. The Android build says “No connection”, iOS shows an empty screen. Testers file bugs against the latest release, developers dig through logs. One request would reveal the cause, but nobody sent it.
The test environment’s certificate is often renewed by hand, whenever someone remembers. Its expiry date is known months ahead, yet people find out on the day it expires.
Monitors from a collection
The requests to the test environment are already in a collection. In the “Requests” section, hover over their folder and click “Check all requests in the folder in Monitoring”. A folder with the same name appears in “Monitoring”, with a monitor for each request: service health, catalog, cart, orders.
A monitor keeps its own copy of the request and fills in variables like {{baseUrl}} and {{token}} anew on every check. Change the address in the environment, and the monitors follow.
What counts as success
By default, a check succeeds on a status code from 200 to 299. That’s not enough for a test environment: a service can respond 200 and say in the body that the database is unavailable. Add conditions:
| Monitor | Condition |
|---|---|
| Health | “JSON value” status equals ok |
| Catalog | “JSON value” items[0].id exists |
| Orders | “Header” Content-Type contains json |
Conditions are checked in order, and the first one that fails becomes the reason: “status code 503, expected 200–299” or “status = degraded, expected ok”. You see what broke without opening the response.
A schedule without false alarms
- “Check every”: 1 minute. The interval is never shorter than 20 seconds, so monitoring doesn’t load the test environment.
- “Retries”: 2. Restarting the test environment causes one failed check, and it shouldn’t raise an alarm.
- “Retry after”: 20 seconds.
When the error repeats, the monitor goes “Down”, an incident opens and a system notification arrives with the reason. The first successful check closes the incident and sends “is back up” with the downtime duration. As long as the status doesn’t change, notifications don’t repeat.
The certificate, three weeks ahead
Set “Warn if the certificate expires within, days” to 21. Three weeks before the certificate expires, the monitor turns yellow, “Degraded”, and names the reason. It’s not an outage: no incident and no notification, but everyone who opens “Monitoring” sees the yellow mark.
Next to it is “Warn if the response takes longer than, ms”. A catalog that used to respond in 300 ms and now takes 2 seconds is a reason to write to the backend before people complain about lag.
Checks run while Bench is open
Monitoring works while the app and this workspace are open. If the laptop was asleep, there were no checks: the statistics show a gap, not downtime. This kind of monitoring doesn’t replace round-the-clock production monitoring.
For a test environment, that’s enough. In the morning, click “Check all” in the section’s top bar, and a few seconds later you get a summary like “3 of 4 up, 1 failing”. You see it before standup, not after three bugs are filed. During the day, the monitors check on their own.
What the server returned
Bench saves the full request and response of a failed check: on the first error, when the reason changes and on every manual check. The “Exchange” button in the list of checks or incidents opens them at the bottom, as on the traffic screen.
The “Create mock” button is there too. While the backend fixes the test environment, a mock response for the failed endpoint lets testers keep checking screens.
The certificate on older phones
A new test environment certificate may work everywhere except an old test phone: its root isn’t in the trust store of the older Android version. The “Certificates” tab in the same section checks this: it validates host chains against the root stores of the Android and iOS versions you choose. More in “API certificates on older Android and iOS: check before release”.
Monitors are project files
Monitor settings and certificate checks live in the workspace, one file per monitor:
bench/
└── monitors/
├── uptime/
│ └── Test environment/
│ ├── Health.monitor.json
│ ├── Catalog.monitor.json
│ ├── Cart.monitor.json
│ └── Orders.monitor.json
└── cert-checks/
└── App hosts.certs.jsonKeep them in git next to your collections: a new monitor reaches everyone else with git pull. Check history stays separate on each computer and doesn’t go into git.
Bench doesn’t trust a workspace from a repository at first: monitors can be checked by hand but don’t run on a schedule. Review what’s inside and click “Trust workspace”, and the schedule starts right away.
What monitoring doesn’t do
- Notifications are system notifications only: nothing goes to email or chat.
- Only HTTP requests are checked. There are no TCP port, DNS or ping checks.
- There are no maintenance windows during which outages don’t count.
Set up monitors for your test environment in the beta and write to beta@microkoi.com about what monitoring warned you of in time and what it missed. We read every email.