Chaos engineering is the practice of deliberately injecting failures into your systems to discover weaknesses before they cause real outages. Gremlin is the leading managed platform for chaos engineering — it gives you a library of attacks (CPU, memory, network latency, disk, process kills) and a controlled way to run them against your infrastructure. But chaos experiments are only as useful as your ability to observe their impact. If you run a network latency attack and your monitoring doesn't catch the resulting service degradation, you've learned nothing.
This tutorial shows you how to pair Gremlin chaos experiments with Vigilmon external uptime monitoring so that every experiment has a measurable, observable outcome. You'll know exactly when your service degraded, by how much, and whether it recovered correctly when the attack ended.
Why monitoring is inseparable from chaos engineering
A chaos experiment without observation is just deliberately breaking things. The scientific value comes from measuring the system's behavior under stress:
- Did the service degrade gracefully or crash completely? Vigilmon's response time history shows the shape of the degradation.
- Did alerts fire in time? If a 100ms latency injection took 4 minutes to trigger an alert, your alerting has a gap.
- Did the system recover automatically? Vigilmon's incident timeline shows when recovery happened relative to when the attack ended.
- What's the real blast radius? Uptime checks on dependent services reveal cascading failures you didn't anticipate.
Gremlin provides a halt mechanism and experiment scoping; Vigilmon provides the independent observer that confirms what your users actually experienced.
What you'll need
- A Gremlin account (free trial available at gremlin.com)
- Gremlin agents installed on your target hosts
- A free Vigilmon account
- At least one service with a public or VPN-accessible HTTP endpoint
Step 1: Install the Gremlin agent
The Gremlin agent runs on each host you want to target with attacks. Install it on Ubuntu/Debian:
# Add Gremlin repo
echo "deb https://deb.gremlin.com/ release non-free" | \
sudo tee /etc/apt/sources.list.d/gremlin.list
curl -fsSL https://deb.gremlin.com/gpg.key | sudo apt-key add -
sudo apt update
sudo apt install gremlin gremlind
On RHEL/CentOS:
cat > /etc/yum.repos.d/gremlin.repo << 'EOF'
[gremlin]
name=Gremlin
baseurl=https://rpm.gremlin.com
enabled=1
gpgcheck=1
gpgkey=https://rpm.gremlin.com/gpg.key
EOF
yum install gremlin gremlind
Authenticate the agent with your Gremlin team credentials:
gremlin init
# Enter your Team ID and certificate/key from the Gremlin dashboard
Start the daemon:
systemctl enable gremlind
systemctl start gremlind
Verify the host appears in the Gremlin dashboard under Hosts.
Step 2: Set up Vigilmon monitors before running any experiments
This is the most important step: establish your baseline before touching anything. Create monitors for every service you intend to stress.
HTTP health check
- Log in to vigilmon.online → Monitors → New Monitor
- Type: HTTP / HTTPS
- URL:
https://your-app.example.com/health - Expected status:
200 - Check interval: 30 seconds (use the smallest interval available so you can see the onset of degradation clearly)
- Enable response time tracking
- Save
TCP port check
Type: TCP Port
Host: your-app.example.com
Port: 443
Interval: 1 minute
This catches network-level failures that might not surface as HTTP errors.
Create a second monitor for a dependent service
If your app depends on a database or cache, add a monitor for that service too. Cascading failure visibility is one of the most valuable things chaos engineering reveals.
Step 3: Define a chaos experiment in Gremlin
Example: CPU resource attack
A CPU attack simulates CPU saturation — useful for testing autoscaling behavior and understanding how your app degrades under compute pressure.
In the Gremlin dashboard:
- Go to Attacks → New Attack
- Choose Resource → CPU
- Set CPU %: 80 (simulates 80% CPU load)
- Length: 120 seconds
- Targets: select your host(s)
- Review the blast radius and confirm
Example: Network latency attack
Network latency is one of the most revealing attacks for distributed systems. Even a 200ms increase in internal service latency can cascade into multi-second user-facing delays:
- Infrastructure → Network → Latency
- Delay: 200ms
- Jitter: 50ms (randomizes delay to simulate real network behavior)
- Affected hosts: your app servers
- Protocol: TCP (affects all TCP traffic, or specify egress ports)
- Length: 60 seconds
Example: Process kill attack
Simulate a process crash to test your restart policy and supervision:
- State → Process Kill
- Process name:
node(or whatever your app process is named) - Signal: SIGKILL (unrecoverable, forces restart)
- Interval: 30s (kills the process twice during the experiment)
- Length: 60s
Step 4: Run the experiment and observe Vigilmon in parallel
The workflow for a useful chaos experiment:
- Confirm Vigilmon monitors are green — run experiments only from a clean baseline
- Note the exact start time — you'll correlate this with Vigilmon's incident timeline
- Start the Gremlin attack
- Watch Vigilmon's response time graph in real time
- When the attack ends, watch for recovery
- Compare the Vigilmon incident timeline with the Gremlin experiment timeline
What good looks like
A well-architected system under a 200ms latency attack:
- Response times increase proportionally but stay below SLA thresholds
- No incidents triggered (service remains "up" even if slower)
- Full recovery within 30 seconds of attack ending
What bad looks like
A fragile system under the same attack:
- Response times spike to 5-10 seconds (downstream timeouts cascading)
- HTTP 500s appear as timeouts propagate
- Vigilmon triggers an incident
- Recovery takes 2-3 minutes after the attack ends (thread pools, connection pools exhausted)
Both outcomes are valuable — the second outcome just tells you more work is needed.
Step 5: Use Vigilmon's API to annotate experiment timelines
Correlating Vigilmon data with Gremlin experiments is much cleaner if you annotate Vigilmon events programmatically when attacks start and stop. Use the Vigilmon API with Gremlin webhooks:
# gremlin_vigilmon_bridge.py
# Receives Gremlin webhooks and posts annotations to Vigilmon
from flask import Flask, request, jsonify
import requests
app = Flask(__name__)
VIGILMON_API_KEY = "your-vigilmon-api-key"
VIGILMON_BASE = "https://vigilmon.online/api/v1"
def post_vigilmon_event(title, description, monitor_ids):
requests.post(
f"{VIGILMON_BASE}/events",
headers={"Authorization": f"Bearer {VIGILMON_API_KEY}"},
json={
"title": title,
"description": description,
"monitor_ids": monitor_ids,
"type": "maintenance"
}
)
@app.route("/gremlin-webhook", methods=["POST"])
def gremlin_webhook():
payload = request.json
attack_type = payload.get("attack_type", "unknown")
status = payload.get("status")
monitor_ids = ["mon_your_app_id"] # Replace with your monitor IDs
if status == "running":
post_vigilmon_event(
title=f"Gremlin experiment started: {attack_type}",
description=f"Chaos experiment running on {payload.get('targets', 'unknown')}",
monitor_ids=monitor_ids
)
elif status in ("completed", "halted"):
post_vigilmon_event(
title=f"Gremlin experiment ended: {attack_type} ({status})",
description="Chaos experiment complete — monitoring for recovery",
monitor_ids=monitor_ids
)
return jsonify({"ok": True})
if __name__ == "__main__":
app.run(port=8080)
Configure this URL as a webhook in Gremlin under Settings → Webhooks.
Step 6: Configure Gremlin Halt conditions using Vigilmon status
Gremlin supports halt conditions: rules that automatically stop an attack if a defined threshold is crossed. You can bridge Vigilmon's status into Gremlin's halt API:
# halt_if_vigilmon_down.py
# Run as a sidecar during experiments — halts Gremlin attack if Vigilmon reports DOWN
import requests
import time
import os
VIGILMON_API_KEY = os.environ["VIGILMON_API_KEY"]
GREMLIN_API_KEY = os.environ["GREMLIN_API_KEY"]
MONITOR_ID = os.environ["VIGILMON_MONITOR_ID"]
ATTACK_ID = os.environ["GREMLIN_ATTACK_ID"]
def get_monitor_status():
r = requests.get(
f"https://vigilmon.online/api/v1/monitors/{MONITOR_ID}",
headers={"Authorization": f"Bearer {VIGILMON_API_KEY}"}
)
return r.json()["data"]["status"]
def halt_attack():
requests.post(
f"https://api.gremlin.com/v1/attacks/{ATTACK_ID}/halt",
headers={"Authorization": f"Key {GREMLIN_API_KEY}"}
)
print(f"Halted attack {ATTACK_ID} — service is DOWN")
while True:
status = get_monitor_status()
if status == "down":
halt_attack()
break
time.sleep(15) # Check every 15 seconds
This turns Vigilmon into a live abort signal: if your service goes fully down (not just slow), the experiment auto-halts before it causes extended user impact.
Step 7: Build experiment runbooks with Vigilmon links
For each Gremlin experiment, document the expected Vigilmon behavior in a runbook:
## Runbook: CPU Saturation (80%, 2 minutes)
**Steady state hypothesis:**
- Vigilmon shows green (HTTP 200, response < 500ms) before attack
**Experiment:**
- Gremlin CPU attack: 80%, 120 seconds, all app servers
**Expected behavior:**
- Response times increase to 800-1200ms but stay below 2000ms (SLA)
- No incidents triggered in Vigilmon
**Abort conditions:**
- Vigilmon incident triggered (service DOWN)
- Response times exceed 3000ms for > 30 seconds
**Recovery definition:**
- Vigilmon response time returns to baseline (< 500ms) within 60 seconds of attack end
**Vigilmon monitor links:**
- https://vigilmon.online/monitors/mon_app_health
- https://vigilmon.online/monitors/mon_app_tcp
Good runbooks mean your chaos experiments accumulate institutional knowledge over time rather than being one-off events.
Step 8: Public status page during experiments
If you're running chaos experiments during business hours (sometimes necessary for realistic load patterns), use Vigilmon's status page to communicate proactively:
- Status Pages → New Status Page
- Name it "Internal Engineering — Planned Experiments"
- Add your service monitors
- Before each experiment: manually create a maintenance window in Vigilmon to suppress false-positive alerts
- After recovery: close the maintenance window
This prevents on-call engineers from being paged during a planned experiment.
Common issues
Gremlin agent not appearing in dashboard:
- Check network connectivity: the agent needs outbound HTTPS to api.gremlin.com
- Verify certificate authentication:
gremlin check - Review agent logs:
journalctl -u gremlind -f
Vigilmon not catching degradation fast enough:
- Use 30-second check intervals (or the minimum your plan supports)
- Add multi-location checks so a regional failure doesn't mask global degradation
- Enable response time alerting, not just up/down alerting
Experiments not representing production traffic:
- Run experiments during your actual peak traffic window when possible
- Use Gremlin's container and Kubernetes targeting to match your prod topology exactly
Summary
You've set up Gremlin for chaos experiments, configured Vigilmon monitors as your independent observation layer, built a webhook bridge to annotate experiment timelines, and scripted automatic halt conditions. The result is a chaos engineering practice where every experiment produces a measurable, documented outcome.
Chaos engineering without monitoring is just breaking things. With Vigilmon as your ground truth — measuring what users actually experience — every Gremlin experiment teaches you something concrete about your system's resilience.
Get started with a free Vigilmon account and run your first monitored chaos experiment today.