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.

Connect your agent
The test
  • monitor_created

    Calls POST /api/v2/monitors

Starting records

  • monitors

    name
    Orders API
    url
    https://api.acme.example/orders/health
    checkFrequency
    30
  • users

    email
    rachel@acme.example

Connect your agent to the Better Stack mock

When ancha runs your agent, it sets:

  • BETTER_STACK_API_URL
  • BETTER_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

GET/api/v1/heartbeat/{token}
POST/api/v1/heartbeat/{token}

heartbeats

GET/api/v2/heartbeats
POST/api/v2/heartbeats
GET/api/v2/heartbeats/{id}
PATCH/api/v2/heartbeats/{id}
DELETE/api/v2/heartbeats/{id}

incidents

GET/api/v3/incidents
POST/api/v3/incidents
GET/api/v3/incidents/{id}
DELETE/api/v3/incidents/{id}
POST/api/v3/incidents/{id}/acknowledge
POST/api/v3/incidents/{id}/resolve

monitors

GET/api/v2/monitors
POST/api/v2/monitors
GET/api/v2/monitors/{id}
PATCH/api/v2/monitors/{id}
DELETE/api/v2/monitors/{id}
GET/api/v2/monitors/{id}/response-times
GET/api/v2/monitors/{id}/sla

on-calls

GET/api/v2/on-calls
GET/api/v2/on-calls/{id}

status-pages

GET/api/v2/status-pages
GET/api/v2/status-pages/{id}
GET/api/v2/status-pages/{id}/resources
GET/api/v2/status-pages/{id}/status-reports
POST/api/v2/status-pages/{id}/status-reports
GET/api/v2/status-pages/{id}/status-reports/{report_id}
POST/api/v2/status-pages/{id}/status-reports/{report_id}/status-updates

Seed 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/monitors

More on-call tools

All 43 tools

Better Stack API mock FAQ

How does the Better Stack mock handle incident acknowledgement and resolution?

POST /api/v3/incidents/{id}/acknowledge records acknowledged_at and acknowledged_by; /api/v3/incidents/{id}/resolve 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 /api/v1/heartbeat/{token} 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 /api/v2/status-pages/{id}/status-reports/{report_id}/status-updates 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.

Book a demo

Ancha is not affiliated with Better Stack.