WireMock Monitoring with Vigilmon
WireMock is a mock HTTP server used to simulate third-party APIs and microservices in testing and development. It lets you stub any HTTP endpoint, record real responses for playback, and test failure scenarios your real dependencies won't produce on demand. When a shared WireMock server goes down, integration tests fail with connection errors and development grinds to a halt.
This guide covers how to monitor WireMock with Vigilmon.
WireMock's Health and Admin Endpoints
WireMock exposes an admin API that doubles as a health check interface.
Default port: 8080 (configurable)
# Admin API root — returns WireMock version info
GET http://localhost:8080/__admin/
# Returns:
{
"version": "3.x.x",
"requestJournalDisabled": false
}
# List all stubs (confirms admin API is functional)
GET http://localhost:8080/__admin/mappings
# Request journal (recent requests received)
GET http://localhost:8080/__admin/requests
# Reset all stubs (useful after tests — don't monitor this)
POST http://localhost:8080/__admin/reset
The /__admin/ endpoint is the simplest health check — if it returns 200, WireMock is running and the admin API is accessible.
Monitoring a Shared WireMock Instance
Many teams run a shared WireMock server for local development or CI pre-warming. When this instance goes down, every developer's local setup or CI run that depends on it breaks.
Monitor 1: WireMock Admin Availability
- Log in to Vigilmon → Monitors → New Monitor
- Type: HTTP
- Method: GET
- URL:
http://wiremock.dev.internal:8080/__admin/ - Interval: 1 minute
- Expected status code: 200
- Keyword check:
"version" - Save
Monitor 2: Stub Count Sanity Check
If your WireMock instance should always have stubs loaded (e.g., auto-loaded from a mappings directory), monitor that the mappings endpoint returns expected stubs:
- Type: HTTP
- Method: GET
- URL:
http://wiremock.dev.internal:8080/__admin/mappings - Interval: 5 minutes
- Expected status code: 200
- Keyword check:
"mappings" - Save
A response with "total": 0 when stubs should exist indicates the mappings directory wasn't loaded correctly on startup.
Monitor 3: Specific Stub Reachability
If your application depends on a specific mocked endpoint being available, monitor it directly:
# Example: your application calls /api/payments when making payments
# and WireMock stubs this endpoint
curl http://wiremock.dev.internal:8080/api/payments \
-H "Content-Type: application/json" \
-d '{"amount": 100}'
Add an HTTP monitor for your specific stub URL and verify the expected response body.
WireMock Docker Configuration
For shared WireMock instances, Docker is common:
services:
wiremock:
image: wiremock/wiremock:latest
ports:
- "8080:8080"
volumes:
- ./wiremock/mappings:/home/wiremock/mappings
- ./wiremock/__files:/home/wiremock/__files
command: >
--verbose
--port 8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/__admin/"]
interval: 10s
timeout: 5s
retries: 3
The Docker health check ensures orchestrators (and Vigilmon) can detect when the container is unhealthy.
WireMock Standalone with HTTPS
For production-like environments where your application only trusts HTTPS, WireMock can serve HTTPS on port 8443:
java -jar wiremock-standalone.jar \
--port 8080 \
--https-port 8443 \
--verbose
Add an HTTPS monitor in Vigilmon:
- Type: HTTP
- URL:
https://wiremock.dev.internal:8443/__admin/ - Interval: 1 minute
- Expected status code: 200
- Save
Key Metrics to Watch
| Metric | What it means | Healthy threshold |
|--------|--------------|-------------------|
| /__admin/ response | WireMock is running | 200 OK always |
| Mapping count | Stubs are loaded | > 0 when expected |
| Request journal size | Receiving traffic | Grows during test runs |
| Response time | Admin API latency | < 100 ms |
| Unmatched requests | Requests hitting no stub | 0 during tests |
Detecting unmatched requests
Unmatched requests indicate your application is calling an endpoint WireMock doesn't have a stub for. Monitor this to catch configuration drift:
# List unmatched requests
GET http://wiremock.dev.internal:8080/__admin/requests/unmatched
# Returns:
{
"requests": [],
"requestJournalDisabled": false
}
Alerting Recommendations
Critical alerts (notify immediately):
/__admin/non-200 — WireMock is down; all tests using shared stubs will fail- TCP port 8080 not responding — container crashed
- HTTPS certificate expiry < 14 days (if using custom cert)
Warning alerts:
- Mapping count drops to 0 — stubs not loaded on restart
- Admin API response time > 500 ms — resource pressure on host
- High unmatched request count — stub configuration needs updating
Suggested Vigilmon alert settings:
- Confirmation: 1 failure (dev tooling should alert immediately)
- Recovery: 2 consecutive successes
- Channels: Slack to
#dev-infra
WireMock Cloud Monitoring
If you use WireMock Cloud (the managed SaaS version), monitor your mock API endpoint directly:
- Type: HTTP
- Method: GET
- URL:
https://YOUR_SUBDOMAIN.wiremockapi.cloud/__admin/ - Interval: 2 minutes
- Expected status code: 200
- Save
This confirms your cloud mock server is reachable from your CI environment.
TCP Port Monitor
Add a TCP monitor as a lightweight first-layer check before HTTP monitors:
- Type: TCP
- Host:
wiremock.dev.internal - Port:
8080 - Interval: 1 minute
- Save
TCP monitors catch crashes faster than HTTP monitors and consume minimal resources.
Testing Your Monitors
Stop WireMock and confirm alerts fire:
# Stop the WireMock container
docker stop wiremock
# Vigilmon should alert within 1–2 minutes
# Restart
docker start wiremock
# Confirm recovery notification
To test the stub count monitor, restart WireMock without mounting the mappings directory and verify the alert fires when the count is 0.
Summary
WireMock monitoring is straightforward — the /__admin/ endpoint is a reliable health probe, and monitoring the stub count catches misconfigured restarts. For shared WireMock instances used by a development team or CI pipeline, Vigilmon gives you immediate notification when the mock server goes down instead of leaving developers to debug phantom connection errors.
Set up your WireMock monitors at vigilmon.online.