Operate

Alerts and scheduled reports

Threshold, change, and anomaly alerts plus scheduled CSV reports. Git-backed YAML, editable through the REST API.

Alerts fire when a metric crosses a line you draw. Scheduled reports run a metric on a cadence and drop a CSV per run into history. Both are authored either from the UI (Alerts and Reports in the left nav) or as YAML through the public REST API. Every save is versioned, so you can walk back any change.

You’ll learn:

  • How to create, run, mute, and delete an alert, and where its history lives
  • How to schedule a report and download the per-run CSV
  • How Slack, email, and generic webhook delivery are configured
  • How to page on data-quality test failures via alert channels (Slack, webhook, PagerDuty, Google Chat)

The two surfaces

You can drive both alerts and reports either way:

  • From the UI. The Alerts and Reports pages in the workspace let you fill in a form, pick a metric, choose a cadence, and add recipients. The UI writes to the same YAML store the API writes to.
  • From the API. The full YAML shape is PUT-able. Editing through the API is atomic: every save rewrites the definition under a lock and stores a versioned commit with the caller’s username as author, so the change trail is always intact.

The YAML shapes below are exactly what the UI produces, and exactly what the API accepts.

Alerts

An alert is a metric plus a firing rule plus a channel list. Three rule types are supported:

  • threshold compares the latest metric value against a constant with operator in > < >= <= == !=
  • change measures percent change vs. the previous time bucket at time_grain
  • anomaly computes a z-score of the latest value against a trailing window of window periods. window must be >= 3; a smaller value is rejected at save time. Fresh metrics need window + 1 buckets of history before anomaly detection can compute mean and stddev. The default window: 14 therefore requires 15 buckets - alerts on freshly-defined metrics silently stay at status=error until enough history accumulates.

A typical alerts.yml payload:

alerts:
  - id: arr-floor
    name: ARR fell below 8M
    type: threshold
    metric: active_arr
    operator: "<"
    threshold: 8000000
    frequency: 1m
    channels:
      - type: slack
        url: https://hooks.slack.com/services/T000/B000/XYZ

  - id: arr-week-change
    name: Week-over-week ARR change > 10%
    type: change
    metric: active_arr
    time_grain: week
    change_percent: 10
    # `window` is anomaly-only; do NOT set it on a change alert.
    frequency: 5m
    channels:
      - type: webhook
        url: https://hooks.acme.com/revops

  - id: arr-anomaly
    name: ARR anomaly detection (z > 3)
    type: anomaly
    metric: active_arr
    time_grain: day
    window: 14
    z_threshold: 3.0
    frequency: 1m
    channels:
      - type: webhook
        url: https://hooks.acme.com/goni

The metric name must resolve in the semantic layer. Every evaluation is recorded in the alert’s run history whether it triggered or not.

Selector, dimensions, filters

Three optional fields shape what value the alert compares against and what slice of the metric it runs over.

  • selector (threshold only) picks which value across the returned rows is compared to the threshold. One of latest (default), min, max, first, avg. Ignored for change and anomaly types, which always use the trailing time series.
  • dimensions: [col1, col2] groups the metric by those semantic-layer columns before evaluation. The alert fires when any grouped row crosses the rule. Omit for a single global value.
  • filters: {col: value, col2: [a, b]} narrows the metric to a subset of rows before evaluation. Values can be scalars or lists (OR-of-equals). Keys must be columns declared on the metric or its base model.
- id: eu-arr-floor
  name: EU ARR fell below 2M in any country
  type: threshold
  metric: active_arr
  operator: "<"
  threshold: 2000000
  selector: min
  dimensions: [country]
  filters:
    region: EU
  frequency: 15m
  channels:
    - type: slack
      url: https://hooks.slack.com/services/T000/B000/XYZ

Create, run on demand, mute, delete

All endpoints live under /api/alerts and require an authenticated caller. Write actions gate on the caller’s role.

# Create (expect_create=true returns 409 if the id exists)
curl -X PUT https://goni.example.com/api/alerts/arr-floor \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{"alert": {"id":"arr-floor","name":"ARR fell below 8M","type":"threshold",
                 "metric":"active_arr","operator":"<","threshold":8000000,
                 "frequency":"1m","channels":[]},
       "message":"first draft","expect_create":true}'

# Run once, right now (dispatches if the rule fires)
curl -X POST https://goni.example.com/api/alerts/arr-floor/run \
  -H "Authorization: Bearer $GONI_PAT"

# Mute for a relative duration OR to an absolute time
curl -X POST https://goni.example.com/api/alerts/arr-floor/mute \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{"duration":"1h"}'
curl -X POST https://goni.example.com/api/alerts/arr-floor/mute \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{"until":"2027-01-01T18:00:00Z"}'

# Unmute
curl -X POST https://goni.example.com/api/alerts/arr-floor/mute \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{"clear":true}'

# History (defaults to last 50 runs)
curl "https://goni.example.com/api/alerts/arr-floor/history?limit=100" \
  -H "Authorization: Bearer $GONI_PAT"

# Delete
curl -X DELETE https://goni.example.com/api/alerts/arr-floor \
  -H "Authorization: Bearer $GONI_PAT"

The same actions are exposed as buttons on the alert detail page: Run now, Mute, Delete, and a paginated run-history table with the value at fire time and the dispatch outcome per channel.

Note: PUT requires the Save permission on Alerts; DELETE requires Delete. run and mute accept either. Viewers can list and read alerts + reports metadata, but CANNOT see report run history or download report CSVs (both require Save or Delete). Every channel URL (Slack, generic webhook, PagerDuty, Google Chat) is stripped from every read path, because possession of the URL is enough to post as your workspace. Report recipient email addresses are also blanked for viewers on read paths, so a Viewer role cannot harvest a distribution list. Editors re-enter the URL (or email) on save.

Workspace scoping. Alerts carry an optional workspace_id. Alerts without one are global (control-plane) and visible to every authenticated caller; alerts pinned to a workspace are visible only to members of that workspace (and to callers with an embed token bound to that workspace). GET /api/alerts filters the list, and GET, PUT, DELETE, mute, run, and history on a scoped id return an opaque 404 not found to non-members so alert ids cannot be enumerated across workspaces.

Notification channels

Channels are declared per alert or per report recipient. The accepted transports differ by surface:

TransportAlertsReports
slackyesyes
webhookyesyes
emailyesyes
pagerdutyyesnot accepted (validateReport rejects)
google_chatyesnot accepted (validateReport rejects)
  • Slack. Add type: slack and paste an incoming-webhook URL into url (must start with https://). The webhook target picks the channel.
  • Email. Add type: email and a single address in to (string, not a list). Attach one email channel per recipient if you want to fan out. Your workspace admin picks the sending provider during setup; end-users just list recipients.
  • Generic webhook. Add type: webhook and a url. Goni POSTs a JSON body with the alert’s identity, its rule and the evaluation result. See the payload contract below.
  • PagerDuty. Add type: pagerduty and set url to the PagerDuty Events API v2 endpoint with the 32-character routing_key embedded in the query string, i.e. url: https://events.pagerduty.com/v2/enqueue?routing_key=<your-32-char-key>. The routing key belongs in the query string; there is no separate integration_key field.
  • Google Chat. Add type: google_chat and a url for an incoming-webhook space.

Submitting an unsupported transport for the surface (PagerDuty or Google Chat on a report) is rejected by the API at save time.

Webhook payload contract

A type: webhook channel receives a POST with Content-Type: application/json when the alert triggers. The body looks like:

{
  "alert": {
    "id": "arr-floor",
    "name": "ARR fell below 8M",
    "type": "threshold",
    "metric": "active_arr",
    "operator": "<",
    "threshold": 8000000,
    "frequency": "1m"
  },
  "result": {
    "alert_id": "arr-floor",
    "triggered": true,
    "status": "triggered",
    "value": 7842000,
    "expected": "< 8000000",
    "detail": "active_arr=7842000 fell below 8000000",
    "started_at": "2026-08-21T12:34:55Z",
    "finished_at": "2026-08-21T12:34:56Z"
  }
}

alert also carries change_percent, z_threshold, window, time_grain and selector when the alert sets them. A pulse alert adds source_type and pulse_threshold with its dials (memory_percent, cpu_percent, query_memory_gb, long_query_min, parts_eta_min). The body never contains the alert’s channels (no Slack, Google Chat or webhook URLs, no PagerDuty keys, no email addresses), its filters, its connection id, or its tenant and workspace ids.

HMAC signing is available on the report dispatch path: set GONI_REPORT_WEBHOOK_SECRET in the API deployment and every type: webhook recipient POST for scheduled reports carries X-Goni-Signature (hex-encoded HMAC-SHA256 of the request body) and X-Goni-Timestamp (RFC3339). Receivers verify by recomputing the HMAC and rejecting requests older than five minutes to defeat replay.

Treat every unsigned webhook url as a bearer secret: possession lets any caller impersonate Goni to your receiver. Rotate on suspected leak, IP-allowlist the Goni egress on the receiver side where you can, and only send to receivers that terminate TLS.

Scheduled reports

A report is a metric plus dimensions plus a schedule plus a recipient list. Each run produces one CSV per recipient, filtered by the per-recipient row_filter when present. Example:

reports:
  - id: weekly-arr-by-country
    name: Weekly ARR by country
    metric: active_arr
    dimensions: [country]
    time_grain: week
    frequency: 1w
    recipients:
      - name: Founder
        email: founder@acme.com
        channel: none
      - name: Regional Manager (LT)
        email: regional-lt@acme.com
        channel: email
        row_filter: "country = 'LT'"
      - name: Regional Manager (DE)
        email: regional-de@acme.com
        channel: email
        row_filter: "country = 'DE'"

channel: none means “produce the CSV, keep it in history, but do not dispatch”. Set channel: email or channel: slack (with a url:) to fan out. row_filter accepts any WHERE-clause expression over the report’s dimensions.

Report endpoints

# Create or update (same envelope shape as alerts)
curl -X PUT https://goni.example.com/api/reports/weekly-arr-by-country \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "report": {
      "id": "weekly-arr-by-country",
      "name": "Weekly ARR by country",
      "metric": "active_arr",
      "dimensions": ["country"],
      "time_grain": "week",
      "frequency": "1w",
      "recipients": [
        {"name": "Founder", "email": "founder@acme.com", "channel": "none"}
      ]
    },
    "message": "first draft",
    "expect_create": true
  }'

# Run once now
curl -X POST https://goni.example.com/api/reports/weekly-arr-by-country/run \
  -H "Authorization: Bearer $GONI_PAT"

# History
curl "https://goni.example.com/api/reports/weekly-arr-by-country/history?limit=50" \
  -H "Authorization: Bearer $GONI_PAT"

# Download a specific run's CSV
curl -O -H "Authorization: Bearer $GONI_PAT" \
  https://goni.example.com/api/reports/weekly-arr-by-country/runs/RUN_ID/output.csv

# Delete (requires the Delete permission on Reports)
curl -X DELETE https://goni.example.com/api/reports/weekly-arr-by-country \
  -H "Authorization: Bearer $GONI_PAT"

CSV download is gated on Save or Delete, matching the run endpoint, so historic CSVs are not viewer-accessible. Recipient emails and Slack URLs are redacted from list and get responses for viewers.

Delivery format, row limit, and truncation

  • Format. Scheduled report deliveries are CSV attachments.
  • Row limit. Reports run with an implicit LIMIT 10000 on the underlying query. For larger row counts, split by dimension into multiple reports or use scheduled queries.
  • Attachment size. Reports over 1 MB of CSV body are truncated at the last complete row and marked ... (truncated at N bytes) in the delivered attachment. For larger extracts, use scheduled queries or the connectors API.
  • Recipients. Reports are capped at 100 recipients per report. Contact support if you need higher fan-out.

Delivery limits

Every delivery a workspace makes (scheduled reports, report test-sends, alerts, pipeline notifications and scheduled AI answers) is checked just before it leaves:

  • Trial workspaces email only their own members. A member is someone who has accepted an invitation and signed in. To send a report or an alert to a colleague during a trial, invite them to the workspace first. Paid workspaces can email any address.

  • Daily limits per workspace. Counted per UTC day, separately for email and for hooks (Slack, generic webhooks, Google Chat and PagerDuty):

    PlanEmails a dayHook posts a day
    Trial50500
    Paid1,00020,000
  • Test-send. One test-send per recipient every 30 seconds, and at most 20 per workspace every 10 minutes. A throttled test-send answers 429.

  • Names and addresses. Report and alert names are at most 120 characters, with no line breaks, because the name is the email subject line. An alert’s email channel takes exactly one address.

A delivery refused by any of these shows as an error on that run in the history, with the reason. It is not retried.

Retention

Alert and report run history, including each report run’s CSV output, is kept for 90 days in Goni’s control-plane database. Runs older than 90 days are deleted automatically.

Preview a schedule

Alerts and reports both use a simple interval grammar for frequency: a positive integer followed by a unit letter. Accepted units are s (seconds), m (minutes), h (hours), d (days), and w (weeks); examples: 30s, 5m, 1h, 24h, 7d, 1w. Cron expressions, @hourly/@daily descriptors, per-alert time zones, and Quartz-style specifiers are NOT supported today.

The GET /api/schedule/preview endpoint returns the next N fire times for a given frequency so the UI can show them live under the frequency picker.

The in-app notification bell

The bell in the workspace header reads from /api/notifications. Every authenticated user can list their own notifications, filter to unread, and mark one or all read:

curl "https://goni.example.com/api/notifications?unread=true&limit=50" \
  -H "Authorization: Bearer $GONI_PAT"
curl -X POST https://goni.example.com/api/notifications/{id}/read \
  -H "Authorization: Bearer $GONI_PAT"
curl -X POST https://goni.example.com/api/notifications/read-all \
  -H "Authorization: Bearer $GONI_PAT"

The server does not accept client-side creates. The only producer that writes to this inbox is comment @mentions on artifacts you authored. Alert and scheduled-report dispatches surface in the alert or report history endpoints and in the delivery channels you configure, not in the bell.

Paging on a failing data-quality test

Semantic-layer tests and freshness checks (see Tests, freshness, and data quality) publish their pass and fail counts as metrics you can alert on. To page on a failing test, define a metric that counts failed test rows for the relevant model and add a threshold alert with operator: ">" and threshold: 0. The alert fires whenever the failing-row count goes above zero and dispatches to every channel you list (Slack, generic webhook, PagerDuty, Google Chat). The in-app notification bell only receives @mention comments, so wire at least one out-of-band channel on any DQ alert you actually need to react to.

alerts:
  - id: orders-not-null-id-failing
    name: orders.id not_null test is failing
    type: threshold
    metric: dq_orders_not_null_id_failures
    operator: ">"
    threshold: 0
    frequency: 5m
    channels:
      - type: slack
        url: https://hooks.slack.com/services/T000/B000/XYZ
      - type: pagerduty
        url: https://events.pagerduty.com/v2/enqueue?routing_key=REPLACE_WITH_32_CHAR_ROUTING_KEY

Last updated