A Better Stack API mock for testing uptime monitors.
Seed the Orders API monitor and its incident history. Your agent can create a monitor; check the creation call and retrieve its URL and check frequency afterwards.
monitor_createdCalls POST /api/v2/monitors
Starting records
monitors
- name
Orders API- url
https://api.acme.example/orders/health- checkFrequency
30
users
rachel@acme.example
Connect your agent to the Better Stack mock
When ancha runs your agent, it sets:
BETTER_STACK_API_URLBETTER_STACK_API_TOKEN
Point the client you already use at them.
const response = await fetch(process.env.BETTER_STACK_API_URL + '/api/v2/monitors', { headers: { Authorization: 'Bearer ' + process.env.BETTER_STACK_API_TOKEN } });
const monitors = await response.json();Locally, ancha runs your agent as an ordinary process, so keep real Better Stack credentials out of its environment.
See all 29 endpoints
heartbeat
/api/v1/heartbeat/{token}/api/v1/heartbeat/{token}heartbeats
/api/v2/heartbeats/api/v2/heartbeats/api/v2/heartbeats/{id}/api/v2/heartbeats/{id}/api/v2/heartbeats/{id}incidents
/api/v3/incidents/api/v3/incidents/api/v3/incidents/{id}/api/v3/incidents/{id}/api/v3/incidents/{id}/acknowledge/api/v3/incidents/{id}/resolvemonitors
/api/v2/monitors/api/v2/monitors/api/v2/monitors/{id}/api/v2/monitors/{id}/api/v2/monitors/{id}/api/v2/monitors/{id}/response-times/api/v2/monitors/{id}/slaon-calls
/api/v2/on-calls/api/v2/on-calls/{id}status-pages
/api/v2/status-pages/api/v2/status-pages/{id}/api/v2/status-pages/{id}/resources/api/v2/status-pages/{id}/status-reports/api/v2/status-pages/{id}/status-reports/api/v2/status-pages/{id}/status-reports/{report_id}/api/v2/status-pages/{id}/status-reports/{report_id}/status-updatesSeed your own data
The data the Better Stack mock starts with on every run, cut to a few records. ancha twins seed better-stack prints every field.
Full seed YAML
twins:
- better-stack
seed:
better-stack:
team:
name: Acme
users:
- email: rachel@acme.example
firstName: Rachel
lastName: Moore
phone: +1 415 555 0123
monitors:
- name: Orders API
url: https://api.acme.example/orders/health
checkFrequency: 30
group: Production
responseTime: 0.12
heartbeats:
- name: "Warehouse sync: Ridgeway Robotics"
period: 900
lastPing: -38m
created: -60h
incidents:
- source: Orders API
cause: Timeout (no headers received)
started: -3h8m
acknowledged:
at: -3h5m
by: rachel@acme.example
resolved:
at: -2h35m
by: rachel@acme.example
onCall:
- name: Orders on-call
default: true
users:
- rachel@acme.example
statusPages:
- name: Acme
subdomain: acme-status
customDomain: status.acme.example
created: -5000h
resources:
- publicName: Orders API
source: Orders API
reports:
- title: Slow order processing
starts: -3h5m
ends: -2h35m
updates:
- at: -3h
message: Orders are processing slowly. We have identified a bad deploy and are rolling it back.
affected:
Orders API: degraded
Check what your agent did
Checks YAML
checks:
- id: monitor_created
trace:
called: POST /api/v2/monitorsMore on-call tools
All 43 toolsBetter Stack API mock FAQ
How does the Better Stack mock handle incident acknowledgement and resolution?
POST / records acknowledged_at and acknowledged_by; / records resolved_at and resolved_by. Acknowledging an already acknowledged or resolved incident, or resolving an already resolved incident, returns 409.
Can a heartbeat ping resolve an incident during an Ancha run?
A GET or POST to / records the heartbeat's latest ping. If that heartbeat has an open incident and is not paused, the mock resolves it with resolved_by set to Heartbeat recovered.
When does a simulated Better Stack status report become resolved?
Post an update to / with message and affected_resources. When every entry in that update is resolved or not_affected, Ancha sets the report's end time to the update's published_at. If published_at is omitted, it uses the simulation's current time.
Install the CLI and run your agent against the Better Stack mock.
Ancha is not affiliated with Better Stack.