Guides · Shipping & operations
Production monitoring
Check the project after each deploy, then read slow queries, failed jobs, webhook deliveries and the org’s activity each day.
- API
- —
- In the schema
- —
What you’ll build#
This page turns the commands in Watch the project after launch into a routine for a live project. A short check follows each deploy, and a daily pass reads the project’s queries, jobs, webhooks and activity. Every number comes from the CLI or the console.
| When | Command | Problem |
|---|---|---|
| After each deploy | napalm status notes | ProblemA layer on with a required piece missing |
| An hour after a deploy | napalm insights notes | ProblemA statement slower since the last schema change |
| Each day | napalm insights notes --days 7 | ProblemA heavy statement or an index that would help |
| Each day | napalm queue ls notes --status failed | ProblemA failed job |
| Each day | napalm webhooks ls notes | ProblemA webhook in the Retrying, Failing or Paused state |
| Each day | napalm activity | ProblemA key, a setting or a webhook change nobody planned |
For a specific error or refusal, start from Troubleshooting & auditing instead.
Before you start#
You need the first app’s project on main with the settings from Lock down the setup for launch. The job steps apply once the project queues jobs. The webhook steps use the webhook from A backend service.
Every read on this page needs only read access. Retrying a job, resuming or testing a webhook, adding an index and running napalm changes need manage access. Read and manage roles compares the two.
Check the project after each deploy#
Run napalm status notes after each deploy. Each layer of the project reports as on, off or on with a required piece missing (gap in --json output), such as address confirmation turned on with no mail server. Add a post-push check in your deploy workflow to fail immediately on any gap.
steps: # … checkout and install, as before - run: napalm schema push notes --yes # Fails the run when a layer is on with a required piece missing - run: napalm status notes --json | jq -e 'all(.checks[]; .state != "gap")'The push also shows at the top of napalm activity as project schema migrated. An hour after the push, napalm insights notes compares each statement’s time per call before and after the change. Under Since the last schema change, insights lists each statement that now takes at least 1.5 times as long per call. A deploy with no slower statement reads Nothing got slower. Before the hour is up, the section gives the time of the comparison.
Speed up the heaviest queries#
napalm insights lists the statements that take the most time in total. Each row shows the calls, the time per call, the total time, the share run on replicas and the access rule with the largest share of the time. --by mean sorts by time per call instead. Below the statements, a table gives each deployed query’s median and 95th percentile time by caller. --days 7 widens that table to a week, and the most is 30 days.
Statement latency, policy share & index advisor
napalm insights breaks down replica read ratios, slowest access rules and napalm schema index recommendations, along with 1.5× latency regressions one hour after every schema push.
# The heaviest statements, the indexes that would help and a week of deployed query timesnapalm insights notes --days 7 # The slowest statements per call insteadnapalm insights notes --by mean # The command insights printed under "Indexes that would help". The migration shows before anything applies.napalm schema index notes Note titleThe advice under Indexes that would help reports each index’s expected saving and prints the command that adds the index to main. napalm schema index previews the migration and asks before applying. Writes to the type wait while Postgres builds the index, and adding the matching line to your local schema ensures the next push keeps the index.
module default { type Note { # … as before, and: index on (.title); }}Troubleshooting & auditing explains an access rule that takes most of a statement’s time.
Retry failed jobs#
After a failed attempt, Napalm runs the job again on the schedule in Retries. After the final attempt, the job stays failed until a manager retries it, and its row remains in your database until you delete it.
napalm queue ls counts the waiting, running and failed jobs and lists each failed job’s query, attempts and last failure. Fix the cause in the query or the handler before a retry. A retry takes the job’s whole id from the JSON output. The retried job is due at once and has one day to run.
Exhausted job inspection & immediate retry
napalm queue ls --status failed exposes attempt counts and failure reasons without leaking job variables, and napalm queue retry <job-id> schedules an immediate 24-hour window.
# Failed jobs, newest first, with each job's attempts and last failurenapalm queue ls notes --status failed # The same jobs with whole ids, for a retrynapalm queue ls notes --status failed --json # Due again now, with one day to runnapalm queue retry notes <job-id>Each retry shows in the org’s activity. Job variables stay in your database and never appear in either command’s output.
Keep webhooks delivering#
napalm webhooks ls notes reports one of five delivery states for each webhook.
- Delivering
- Every recent delivery succeeded.
- Retrying
- The newest delivery failed and is queued for automatic retry.
- Failing
- Deliveries exhausted retries since the last success.
- Paused
- A manager paused the webhook, or Napalm paused a ping webhook after a day of failures. Deliveries wait until resumed.
- No recent deliveries
- No matching event has fired recently.
Each webhook’s newest failure prints below the list. napalm webhooks deliveries lists recent pings to one webhook with the receiver’s HTTP status or failure reason. Delivered pings are kept for an hour and failed pings for two days. Rows webhooks report whether the receiver has caught up with the change log directly in napalm webhooks ls.
Delivery states & paused queue resume
napalm webhooks ls tracks Delivering, Retrying, Failing and Paused endpoints alongside commit-log lag, and holds queued deliveries until napalm webhooks resume.
# Each webhook's state, then each webhook's newest failurenapalm webhooks ls notes # One webhook's recent pings, with the receiver's answernapalm webhooks deliveries notes --url https://api.example.com/hooks/napalm # After a pause, once the receiver answers again: send the waiting deliveriesnapalm webhooks resume notes https://api.example.com/hooks/napalmNotifications & webhooks gives the retry schedule and the receiver’s side of each delivery.
Review the org’s activity and changes#
napalm activity lists the org’s newest changes along with the actor and timestamp for each event. The list shows 25 events by default and 100 with --limit 100. Scan the list for any key, setting or webhook change nobody planned.
napalm changes reads a branch’s change log, printing each commit’s timestamp, caller kind and ID, and per-type counts of added, updated and deleted rows without exposing row values. Any gap row reports a missing stretch of the log and its cause. After a failover, a lost gap marks writes that did not survive, and passing --lost with that gap’s bookmark lists the affected types. Gaps in the change log explains each gap kind.
The cluster retains a dropped branch’s change log and bills for its storage until the scheduled deletion date. Run napalm branches forget to remove the log early.
# The org's newest changes, who made each change and whennapalm activity --limit 100 # Writes on main over the last day, by type and caller. Needs manage access.napalm changes notes --since 1d # Change logs kept for dropped branches, with each log's size and deletion datenapalm branches dropped notesWatch the project in the console#
The console reads the same numbers as the CLI.
- Overview
- The Needs you list flags a cluster or project that needs attention, a failed or timed-out operation and charges past the spend alert. Failed jobs and failing webhooks appear only on the project’s Queries tab.
- Queries tab
- A project’s Queries tab holds the reports from
napalm insights: Statements, Indexes that would help, Since the last schema change and Deployed queries by caller. Add index beside an advised index runs the same migration asnapalm schema index. - Jobs and webhooks
- The same tab lists the Jobs, the Changes and the Webhooks, with Deliveries under the webhooks. Retry a failed or cancelled job from the Jobs list.
- Activity
- The same events as
napalm activity. - Members and engines
- A cluster’s page links each PostgreSQL member and engine to the machine’s live readings.
Web console covers the overview, the Queries tab, webhooks, activity and member and engine metrics in full.
Check the routine#
Push a schema change
The deploy run passes the status step.
napalm activityshows project schema migrated at the top.Read insights an hour later
napalm insights notesshows Since the last schema change with the push’s time. Under that heading, insights lists the slower statements or reads Nothing got slower.Send the webhook a test
napalm webhooks test notes https:/sends a signed test ping./ api.example.com/ hooks/ napalm napalm webhooks deliveries noteslists the test asnote_changed (test)in the Delivered state with the answerHTTP 204.