A Sentry API mock for investigating application errors.

Your agent reads seeded Orders API issues and stack traces, then records a release. Check the release request and retrieve its version, projects and deploy history.

Connect your agent
The test
  • release_created

    Calls POST /api/0/organizations/*/releases/

Starting records

  • releases

    version
    orders@4.11.0
  • members

    ref
    ancha
    name
    Ancha assistant
    email
    ancha@acme.example

Connect your agent to the Sentry mock

When ancha runs your agent, it sets:

  • SENTRY_API_URL
  • SENTRY_AUTH_TOKEN

Point the client you already use at them.

const sentry = (path: string) => fetch(`${process.env.SENTRY_API_URL}/api/0/${path}`, { headers: { Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}` } });
const [org] = await (await sentry('organizations/')).json();
const res = await sentry(`organizations/${org.slug}/issues/?query=${encodeURIComponent('is:unresolved')}&statsPeriod=24h`);
const issues = await res.json();
// res.headers.get('link') carries the next page's cursor (rel="next"; results="true"; cursor="...").

Locally, ancha runs your agent as an ordinary process, so keep real Sentry credentials out of its environment.

See all 32 endpoints

0

GET/api/0/
GET/api/0/organizations/
GET/api/0/organizations/:org/
GET/api/0/organizations/:org/eventids/:event/
GET/api/0/organizations/:org/events/
GET/api/0/organizations/:org/issues/
PUT/api/0/organizations/:org/issues/
GET/api/0/organizations/:org/issues/:issue/
PUT/api/0/organizations/:org/issues/:issue/
DELETE/api/0/organizations/:org/issues/:issue/
GET/api/0/organizations/:org/issues/:issue/comments/
POST/api/0/organizations/:org/issues/:issue/comments/
GET/api/0/organizations/:org/issues/:issue/events/
GET/api/0/organizations/:org/issues/:issue/events/:event/
GET/api/0/organizations/:org/issues/:issue/tags/:key/
GET/api/0/organizations/:org/issues/:issue/tags/:key/values/
GET/api/0/organizations/:org/members/
GET/api/0/organizations/:org/projects/
GET/api/0/organizations/:org/releases/
POST/api/0/organizations/:org/releases/
GET/api/0/organizations/:org/releases/:version/
PUT/api/0/organizations/:org/releases/:version/
GET/api/0/organizations/:org/releases/:version/deploys/
POST/api/0/organizations/:org/releases/:version/deploys/
GET/api/0/organizations/:org/shortids/:short/
GET/api/0/organizations/:org/teams/
GET/api/0/projects/:org/:project/
GET/api/0/projects/:org/:project/events/
GET/api/0/projects/:org/:project/events/:event/
GET/api/0/projects/:org/:project/issues/
GET/api/0/projects/:org/:project/keys/
GET/api/0/projects/:org/:project/releases/

Seed your own data

The data the Sentry mock starts with on every run, cut to a few records. ancha twins seed sentry prints every field.

Full seed YAML
twins:
  - sentry
seed:
  sentry:
    organization:
      slug: acme
      name: Acme
      created: -17520h
    me: ancha
    members:
      - ref: ancha
        name: Ancha assistant
        email: ancha@acme.example
        teams:
          - backend
        joined: -700h
      - ref: rachel
        name: Rachel Moore
        email: rachel@acme.example
        role: admin
        teams:
          - backend
        joined: -12000h
    teams:
      - slug: backend
        name: Backend
        created: -17000h
    projects:
      - slug: orders-api
        name: Orders API
        teams:
          - backend
        created: -16000h
        issue_counter: 139
    releases:
      - version: orders@4.11.0
        projects:
          - orders-api
        created: -300h
        deploys:
          - environment: production
            at: -299h
    issues:
      - ref: orders_pool
        project: orders-api
        type: KnexTimeoutError
        value: "Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?"
        culprit: POST /orders
        request:
          method: POST
          url: https://api.acme.example/orders
        stacktrace:
          - filename: node_modules/knex/lib/client.js
            function: Client.acquireConnection
            line: 312
            code: const connection = await this.pool.acquire().promise;
            in_app: false
        events:
          - at: -2h51m
            count: 38
            every: 30s
            users:
              - ridgeway-robotics
            tags:
              server_name: orders-api-7d9f8
        changes:
          - at: -3h
            by: rachel
            assign: rachel
        comments:
          - author: rachel
            at: -2h44m
            text: Worker concurrency in 4.12.1 exhausted the database pool. Rolled back to 4.12.0; resolving.

Check what your agent did

Checks YAML
checks:
  - id: release_created
    trace:
      called: POST /api/0/organizations/*/releases/

More on-call tools

All 43 tools

Sentry API mock FAQ

How can I check that an incident agent resolved a Sentry issue?

Send PUT /api/0/organizations/:org/issues/:issue/ with status: resolved to Ancha’s Sentry mock. The mock saves the resolved status and a set_resolved activity entry, which appears when the issue is retrieved.

Where can an agent read the latest Sentry error’s stack trace?

Request /api/0/organizations/:org/issues/:issue/events/latest/ from the mock. For an event seeded with exception frames, the response contains an exception entry whose data.values includes stacktrace.frames.

Can a Sentry triage agent assign an issue to a team by its slug?

Set assignedTo to #<team-slug> on the mock’s issue update request. The mock resolves the seeded team, saves the assignment and records an assigned activity when the assignee changes.

Install the CLI and run your agent against the Sentry mock.

Book a demo

Ancha is not affiliated with Sentry.