Docs cipi.yml Web panel API MCP Ecosystem Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. Cipi metrics explained: server, application and uptime
Operations

Cipi metrics explained: server, application and uptime

Alerts tell you that something broke. Metrics tell you when it started, what else changed, and which app did it. Cipi keeps both on the server, in one small file.

By Updated 8 min read

Cipi watches a server at three levels. The server: is the machine healthy? Each application: is this app healthy, and is it the one causing trouble? Uptime: can its URL be reached, and how fast does it answer? On top sits a timeline of events: deploys, incidents, alerts. This article explains what each number means, how it's measured, and how to use them together.

Metrics
$ cipi metrics
$ cipi metrics uptime shop --range=30d

Three layers, one timeline#

LayerQuestionRecorded
ServerIs the machine healthy?CPU, load, memory, swap, disk, network
ApplicationIs this app healthy, and is it the noisy neighbour?CPU and memory of its processes, PHP-FPM pool usage, requests, 5xx, queue workers
UptimeCan it be reached, and how fast?Status code and response time of its health URL, every minute
EventsWhat changed, and when?Releases with their health verdict, monitor alerts and recoveries, incidents, heartbeat failures

Metrics and alerts are separate on purpose. The monitor and the health checks decide when to wake you up; metrics only record. Every state change of a monitor check is also written as an event, so the history explains the alert.

How it's collected#

  • Cron, every minute/etc/cron.d/cipi-metrics
  • Read/proc, one ps, new access-log lines, supervisorctl
  • Probeeach app's health URL
  • Writeone SQLite transaction
  • Store/var/lib/cipi-metrics/metrics.db (root, 0600)

About 0.2 seconds of CPU per minute. Nothing listens on a port, nothing leaves the server. Compared with a Prometheus server and exporters on every VPS, that's hundreds of megabytes of RAM saved on the small machines most Cipi servers are; if you already run Prometheus, scrape Cipi instead.

bash
sudo cipi metrics status        # collector, database size, retention
sudo cipi metrics               # now, last hour, uptime per app

Server metrics#

MetricWhat it meansWorry when
CPU %Share of all cores busySustained near 100%: requests queue behind each other
Load (1 min)Processes running or waiting for CPU or diskAbove the number of cores for long; the monitor alerts at 4× the cores for two runs in a row
Memory % and MBRAM in use, without cacheHigh and swap rising
Swap %Memory pushed to diskAny steady growth on a PHP server: too many FPM children or workers for the RAM
Disk % of /The root filesystemThe monitor warns at 80% and goes critical at 90%; cipi disk says who uses it
Network in / outBytes per secondSudden outbound spikes: a crawler, a big export, or something that shouldn't be there

Load and CPU together tell a story: high load with low CPU usually means processes are waiting for disk, not computing. On a database-heavy app, look at the slow queries before buying a bigger server.

Application metrics#

MetricHow it's measuredRead it as
CPUCPU time of the app user's processes between two minutes, as % of one core100% = one core fully busy. FPM masters run as root and aren't counted; Octane and Node processes are
MemorySum of the resident memory of its processesAn upper bound: pages PHP-FPM children share are counted once per child. Watch the trend
PHP-FPM children / pm.max_childrenWorkers of the app's pool, against its capClose to the cap at peak is fine; at the cap is not
Hit max_childrenHow many times the pool reached its cap in the minuteThe most useful number for "the site is slow": requests waited for a free worker
Requests / minNew lines in the app's Nginx access logTraffic, per minute
5xx / minResponses 500–599 in the same linesErrors your users saw
Queue workersPrograms running, against programs configuredRunning < configured: a worker crashed and isn't back
HealthcheckStatus, expected or not, and response timeSee uptime
bash
sudo cipi metrics show --app=shop --range=7d     # min / avg / max and trend
sudo cipi metrics show --app=shop --range=24h --json | jq .

The pool cap, in plain words#

Each app has a fixed number of PHP workers (pm.max_children). When all are busy, the next request waits. A few hits a day are normal; minutes in a row mean the app is too slow for its traffic or the cap is too low.

CPU of the appHits max_childrenLikely causeDo
HighYesCode is CPU-boundProfile the hot routes; more children won't help
LowYesWorkers are waiting: database, an external API, file locksFind slow queries and calls; raise the cap only if memory allows
LowNoThe pool isn't the problemLook at the database or the network
bash
sudo cipi app limits shop --fpm-max-children=20       # if RAM allows

Uptime#

When an app has a health URL (cipi health set), the collector calls it every minute and keeps the status code and response time.

bash
sudo cipi health set shop --url=https://shop.example.com/up --expect=200
sudo cipi metrics uptime --range=30d
sudo cipi metrics uptime shop --range=30d
NumberDefinition
Uptime %Share of successful per-minute probes over the range
Minutes downProbes that failed
IncidentOpens at the 3rd failure in a row, closes at the first success: a single blip doesn't count
Response timeTime for the health URL to answer, from the server itself
Day barsGreen: all passed. Yellow: a few failed. Red: an incident. Grey: no data yet
30-day uptimeDown per month (about)
99%7 h 12 min
99.9%43 min
99.95%22 min
99.99%4 min

Choose the URL with care. Laravel's /up says the framework boots; the Cipi Agent's /cipi/health also checks the database, cache, queue and storage. An app behind basic auth answers 401 to the probe, like to any visitor: use a URL outside the protected area.

The probe runs on the server. It sees a broken release, a dead database or an expired certificate, but not a DNS mistake or a network outage between your users and the server. For that, the heartbeat and an external monitor complete the picture.

Events#

EventSource
Release live, with its post-deploy health verdictEvery deploy, from the CLI, the panel, a webhook or CI
Monitor state changeok → warn/critical, escalations, recoveries
Healthcheck incidentOpened and closed
Heartbeat failureA call to your heartbeat URL that didn't go through
bash
sudo cipi metrics events --range=7d
sudo cipi metrics events --source=deploy

In the panel, events are the dotted vertical lines on every chart: blue for releases, red for incidents, green for recoveries. Most investigations start by asking "what was the last marker before the line went up?".

Read them together: a playbook#

SymptomLook atLikely causeNext step
5xx jump right after a release markerApp 5xx, eventsThe releasesudo cipi deploy shop --rollback, then read cipi app logs shop --type=laravel
Site slow, app CPU high, pool at the capApp CPU, max_children hitsCPU-bound code or a traffic spikeCompare requests/min with last week; profile; resize if it's real traffic
Site slow, app CPU low, pool at the capmax_children hits, server loadWorkers waiting on the database or an APISlow query log, timeouts on outgoing calls
Memory climbs for days, swap growsApp memory, server swapToo many workers for the RAM, or a leaking workerFewer workers (cipi app limits --worker-procs); let leaking workers restart (maxJobs / maxTime in Horizon, --max-jobs / --max-time on queue:work)
Queue workers below configuredQueue workersA worker crashing on startcipi app logs shop --type=worker
Uptime red, server and app metrics normalHealthcheck status codeA dependency the health URL checks, or the certificateOpen the URL; cipi health check shop
One app's CPU high, others slowEvery app's CPU on the server tabA noisy neighbourLimits: cipi app limits (docs), or move it with cipi sync
Gap in every chartNothing recordedThe server was down or rebootingCheck the heartbeat service's history and uptime
Disk % climbing steadilyServer diskLogs, local backups, uploadssudo cipi disk, then exclude big folders from local backups

Retention and size#

DataDefaultRange
Every minute7 days--raw=1d … 90d
Average and peak per 15 minutes30 days--rollup= up to 400d (never shorter than raw), --resolution=5m … 60m
Events90 days--events=7d … 730d
bash
sudo cipi metrics retention
sudo cipi metrics retention --raw=14d --rollup=180d --resolution=30m

About 2 MB per app per week of minutes, and a third of that per month of rollups: 20–30 MB for ten apps on the defaults. Charts always ask for about 240 points, whatever the range: minutes inside the raw window, rollups beyond it. That's why a 30-day chart shows averages and peaks: a one-minute spike stays visible.

Outside the server#

Heartbeat: for the day the server goes quiet#

A server that's down can't send an alert. The heartbeat calls a URL of yours every N minutes; when the calls stop, the service on the other end alerts you.

bash
sudo cipi metrics heartbeat set https://hc-ping.com/<uuid> --every=1
sudo cipi metrics heartbeat test

Works with Healthchecks.io, Uptime Kuma (push monitor), Better Stack heartbeats, Cronitor or your own endpoint. Set the receiver's period to the interval plus a few minutes of grace.

Prometheus and Grafana#

If you already run Prometheus, turn on OpenMetrics: the latest values on their own port, behind an IP allowlist and a bearer token.

bash
sudo cipi metrics openmetrics on --allow=203.0.113.50 --port=9273
sudo cipi metrics openmetrics token --show
yaml
# prometheus.yml
- job_name: cipi-production
  scrape_interval: 60s
  authorization: { credentials: <token> }
  static_configs: [{ targets: ['203.0.113.10:9273'] }]
ServerEach app ({app="shop"})
cipi_host_cpu_percent, cipi_host_load1cipi_app_cpu_percent, cipi_app_memory_rss_megabytes, cipi_app_processes
cipi_host_memory_percent, cipi_host_memory_used_megabytes, cipi_host_swap_percentcipi_app_fpm_children, cipi_app_fpm_max_children, cipi_app_fpm_max_children_reached
cipi_host_disk_percentcipi_app_requests_per_minute, cipi_app_http_5xx_per_minute
cipi_host_network_receive_bytes_per_second, cipi_host_network_transmit_bytes_per_secondcipi_app_healthcheck_up, cipi_app_healthcheck_status_code, cipi_app_healthcheck_duration_milliseconds
cipi_metrics_collected_timestamp_secondscipi_app_workers_up, cipi_app_workers_total

Example alert rules built on them:

yaml
groups:
  - name: cipi
    rules:
      - alert: AppDown
        expr: cipi_app_healthcheck_up == 0
        for: 3m
      - alert: PoolSaturated
        expr: cipi_app_fpm_max_children_reached > 0
        for: 10m
      - alert: Many5xx
        expr: cipi_app_http_5xx_per_minute > 20
        for: 5m
      - alert: WorkerMissing
        expr: cipi_app_workers_up < cipi_app_workers_total
        for: 5m
      - alert: CollectorStale
        expr: time() - cipi_metrics_collected_timestamp_seconds > 300

The endpoint is plain HTTP: keep it on a private network or a tunnel (WireGuard, Tailscale). 0.0.0.0/0 is refused, and the panel API can't turn it on, because it opens a port.

The panel, the API, the SDK and AI assistants#

InterfaceWhat
Web panel 4.3+A Metrics tab per server and per app: charts from 1 hour to 30 days with markers, hover details, 30-day uptime bars, the events timeline, retention and heartbeat settings. Refreshes every 30 seconds while open
REST APIGET /api/metrics, /api/metrics/series, /api/apps/{name}/metrics, /api/metrics/uptime, /api/metrics/events; abilities metrics-view, metrics-manage
PHP SDK$cipi->metrics()->series('shop', ['req', 'http_5xx'], '7d')
cipi-clicipi-cli metrics, metrics show --app shop, metrics uptime
MCPAsk your assistant "when did the 5xx on shop start, and what was deployed just before?"

What metrics don't do#

NeedUse
AlertsThe monitor, health checks and notifications
Slow routes, queries and jobs inside the appLaravel Pulse or Telescope
Exceptions with stack tracesAn error tracker such as Boogle
Uptime seen from the internetAn external monitor, plus the heartbeat
Long-term history across a fleetPrometheus or Grafana, scraping OpenMetrics
bash
sudo cipi metrics probe off     # stop the per-minute probe (the 5-minute check stays)
sudo cipi metrics disable       # stop collecting, keep the history

Questions

Which version do I need?

Cipi 5.11.0 or later for metrics, uptime and the heartbeat; panel 4.3.0 for the Metrics tab. sudo cipi self-update.

Does it slow the server down?

One cron job a minute, about 0.2 seconds of CPU, and a database of 20–30 MB for ten apps on the default retention. Nothing listens on a port unless you turn OpenMetrics on.

Does any data leave the server?

No. The heartbeat calls a URL of yours, and OpenMetrics is served only if you enable it, behind an IP allowlist and a token.

Is the uptime the same as an external monitor's?

Not exactly: the probe runs on the server itself, so it can't see a network or DNS problem between your users and the server. Pair it with the heartbeat and, for public services, an external monitor.

Why is there a gap in the chart?

The collector didn't run in those minutes: the server was off or rebooting, or metrics were disabled. If you didn't expect it, the heartbeat should have told you.

Can I keep data longer?

Yes: up to 90 days of minutes, 400 days of rollups and 730 days of events (cipi metrics retention). Or scrape it into your Prometheus.

Does it replace an APM or an error tracker?

No. Metrics see the app from the outside (CPU, memory, requests, 5xx, pool usage). For slow routes and queries use Laravel Pulse or Telescope; for exceptions, Boogle or a similar tracker.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart