Docs/Observe/Metrics and alerts

Metrics and alerts

3 min read
On this page

Dokwe collects resource usage for each app and server and shows it in the dashboard. Notifications go to Slack, email, webhooks or mobile push. Which channels you can use depends on the kind of event.

App metrics#

Open a project's Observability tab to see its live usage. For container apps, Dokwe reads the container's stats every 30 seconds:

  • CPU usage (percent)
  • memory used and memory limit
  • network received and sent
  • disk space the container has written
  • container status, restart count and uptime

The tab shows the latest reading and a short history. Dokwe keeps 24 hours of samples.

For native (non-container) apps on your own server, the tab shows the server's own metrics instead, without network figures. See container or native.

From the CLI#

bash
dokwe ps

dokwe ps prints the current CPU and memory for the project. See the CLI reference.

Server metrics#

Each server you connect with bring your own server reports these every 30 seconds:

  • CPU
  • memory
  • disk
  • load average
  • the number of running containers

You'll find them on the server's page under Servers.

Errors from your logs#

Dokwe also scans your container output for error patterns such as ERROR, FATAL, Exception, out-of-memory messages, panic and Python tracebacks. For Laravel and Rails apps, it also reads their standard log files.

It groups matching lines into errors, which you can review in the project's Errors tab. Each error can also go to AI triage.

To send errors straight from your code instead, see error ingest.

Notifications#

Slack#

The Slack Notifications skill posts a message when a deploy finishes as live, failed, cancelled or rolled back.

  1. Create a Slack incoming webhook#

    In Slack, create an incoming webhook for the channel you want and copy its URL. It starts with https://.

  2. Install the skill#

    In Dokwe, go to Skills and open Slack Notifications. Paste the webhook URL and, if you like, a channel name.

  3. Send a test#

    Click Send test message to make sure it arrives.

Push notifications#

Turn on notifications for a browser in Settings → Notifications. Dokwe then tells you when a deploy starts ("keverna (production) is deploying"), and replaces that with the result when it finishes: live, failed, rolled back or cancelled.

Each browser or phone chooses which deploys: Mine, and any that fail (the default in browsers), Every deploy (the default on phones) or Only failures. A deploy is yours when you started it from the dashboard or the CLI, or when you pushed it to GitHub and the pusher's or commit's email is your Dokwe account's email. GitHub's private …@users.noreply.github.com addresses can't be matched, so those pushes only notify browsers set to every deploy.

Fleet alerts#

For server-level alerting, use Fleet. Fleet alert rules fire in two cases:

  • A metric crosses a threshold. This covers CPU, memory or disk percentage, with an operator (>, >=, <, <=) and a threshold.
  • A health check keeps failing. You set how many failures in a row trigger the alert.

Each rule has a severity (info, warning or critical) and a cooldown, which defaults to 15 minutes. Rules can watch a host, a cluster or the whole workspace. Alerts are muted during maintenance windows.

Fleet sends alerts to these channels:

ChannelSetup
SlackAn incoming webhook URL
WebhookA URL that receives a JSON POST. Optionally signed.
EmailSMTP

If you set a signing secret on a webhook channel, each request includes this header:

text
X-Dokwe-Signature: sha256=<hex HMAC-SHA256 of the request body>

Use it to confirm the request came from Dokwe:

js
import crypto from 'node:crypto';

function isValid(rawBody, header, secret) {
  const expected = 'sha256=' +
    crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(header), Buffer.from(expected));
}

Per-project alert rules aren't available yet. To be alerted on resource usage, set up Fleet alert rules on the servers your apps run on.