Skip to content

Metrics & usage

zPodFactory measures itself: how many zPods live and for how long, which profiles are used, how the engine performs, how full each endpoint's cluster is, and what each zPod's VMs consume. The figures come from three sources:

  • The database: zPods, profiles, users, components and every zPod's activity log.
  • Prefect: the engine's flow runs, their outcome and duration.
  • vCenter: a 5-minute sample of every endpoint's cluster, hosts, datastore and VMs, plus the appliance's own CPU, memory and library disk.

Everyone gets the plain instance counts. Breakdowns by owner and endpoint, endpoint usage and the engine's failures are for superadmins.

How it is collected

Two flows run on their own Prefect pool, zpodengine-metrics, served by the zpodenginemetrics container. They never take one of the 8 slots zPod deploys use.

Flow When What it does
usage_collect every 5 minutes One vCenter read per endpoint (cluster, hosts, datastore, VMs and their vApps), written as samples per endpoint, per host and per zPod, plus each zPod's current VMs. It also samples the appliance (CPU, load, memory, library free space) and checks the connection to each vCenter, and to NSX every 15 minutes.
metrics_rollup hourly, and at 00:20 UTC Rolls the 5-minute samples into hourly rows, and at midnight the hourly rows into daily ones; rolls Prefect's runs into daily engine figures; measures the component library; applies the retention settings.

Their runs are named after the time they were scheduled for (collection-run-15:05-UTC, rollup-run-15:07-UTC), so they are easy to find in Prefect.

A vCenter read is split in sections (hosts, datastore, vApp list, VM list). A failing section leaves only its own figures empty: the charts show a gap instead of a drop to zero, and the endpoint is flagged partly read. An unreachable vCenter fails in about 30 seconds, the run ends Failed naming it, and the other endpoints' figures are still written.

ff_usage_collect turns the vCenter reads off. The data is kept for 14 days at 5 minutes, 180 days hourly and 5 years daily by default; see Metrics and activity log settings.

Instance statistics in zcli

❯ zcli stats

zcli stats

--range picks 24h, 7d, 30d (the default), 90d, 12m or all; --tz sets the time zone of day and month edges; --json gives the raw answer. It also shows the library's free space and its largest component types.

A zPod's own figures are in zcli zpod usage and its history in zcli zpod events.

In zpodweb

Page Who What it shows
Dashboard everyone Me / Factory scope, an attention inbox, zPods by status and profile, capacity per endpoint, recent zPods with their footprint and age
Metrics › Overview everyone Active zPods, flow-run success, users and library components, zPods created and deleted, top profiles; the library's storage and free space over time, space per component type, and each component's size, use and profiles, with the reclaimable ones marked
Metrics › zPods everyone Concurrent zPods, how long deleted zPods lived, zPods by profile; heaviest zPods and footprint per profile for superadmins
Metrics › Endpoints superadmins Per endpoint, CPU, memory and datastore used against capacity over the range, with demand dashed and an 80% line
Metrics › Engine (Prefect) everyone Success rate, deploy and destroy times, runs per flow, how long each component takes to deploy, run its postscripts and its config scripts; for superadmins, the runs in flight, the workers, and the latest failures with Dismiss
Factory superadmins Instance statistics, the server's CPU, memory and library free space live every 5 seconds and over time, uptime and pending updates
Endpoint › Usage superadmins Cluster CPU, memory and datastore against capacity, overcommit ratios, memory saved by TPS and reclaimed, contention (CPU ready, latencies), a hosts table and the hosts over time
zPod › Usage anyone who sees the zPod The zPod's VMs as vCenter sees them, their CPU, memory and storage, and their history

zpodweb Metrics, Overview tab

zpodweb Metrics, Engine (Prefect) tab

zpodweb Metrics, Endpoints tab

zpodweb Metrics, zPods tab

Ranges are 24h, 7d, 30d and 12m. Test zPods (the zpodfactory_stats_exclude_prefixes prefixes, e2e- by default) are left out, and the Metrics page names them, with a switch to count them too.

Factory

The Factory page (superadmins) shows the instance statistics, the server's CPU, memory and library free space live every 5 seconds and their history, and the appliance's uptime, pending reboot, releases and upgradable packages from its host status.

zpodweb Factory page

Engine failures

A failed or crashed run stays in Latest failures until a superadmin dismisses it. Dismiss tags the Prefect run dismissed; its other tags and its logs are kept. A flow with 5 or more open failures in the range shows as one line, for example an unreachable vCenter failing usage_collect every 5 minutes ("288× since 16:15", Dismiss 288), so it doesn't bury the deploy failures. Dismiss all clears every open failure in the range.

A failed component download is dismissed by disabling the component.

Reclaiming library space

Metrics › Overview lists each downloaded component with its size, its deploys in the range, the zPods holding it and the profiles that name it. A component in no profile, in no zPod and idle for 30, 90 or 180 days is marked reclaimable, and a superadmin can select those and disable them in one go, which deletes their files. A component a profile or a live zPod uses can't be disabled without Force: see Libraries & components.

Attention inbox

The Dashboard's inbox, from /stats/attention, lists what needs a superadmin: failed deploys, failed downloads, profiles not ready (a component missing), endpoints down or partly read, a pending reboot of the appliance, and old zPods once zpodfactory_zpod_old_days is set.

Appliance host status

The Factory and About pages show the appliance's uptime, running and installed kernel, pending reboot, upgradable Debian and third-party packages and unattended-upgrades. A small reporter writes them to /var/lib/zpodfactory/host-status.json at boot and every hour; the API only reads that file.

New appliances install it. On an existing appliance, install it once, from the zpodcore directory:

❯ sudo zsh appliance/bootstrap/zpodfactory-stack.sh --host-status

just zpod-update reminds you when it is missing. It reports only: it never installs updates or reboots.

API

Every /stats route takes range (24h, 7d, 30d, 90d, 12m, all), and most take bucket and tz. Answers are cached for 60 seconds and list the excluded prefixes in excluded_prefixes; include_excluded=true counts everything.

Route Who What
/stats/overview, /stats/zpods, /stats/users, /stats/profiles everyone (breakdowns for superadmins) Instance counts, lifetimes, profiles' use and success
/stats/library, /stats/library/storage, /stats/libraries everyone Downloads, storage, component usage and reclaimable space, each library's git state
/stats/engine, /stats/engine/components everyone (failures for superadmins) Runs per flow, durations, success, per-component deploy times
/stats/engine/live superadmins Runs in flight and workers
POST /stats/engine/failures/{run_id}/dismiss, POST /stats/engine/failures/dismiss superadmins Dismiss one failure (same_flow=true for its whole group) or every open one in the range
/stats/endpoints/summary, /stats/endpoints/{id}, /stats/endpoints/{id}/live, /stats/endpoints/{id}/hosts, /stats/endpoints/{id}/hosts/history superadmins Endpoint load, usage series, hosts, DRS balance, contention
/stats/zpods/usage superadmins Heaviest zPods, footprint per profile
/stats/host, /stats/host/history superadmins The appliance's CPU, memory, library disk and host status
/stats/users/activity, /stats/access, /stats/attention superadmins User activity, every grant, the attention inbox
/stats/about everyone Versions running, latest GitHub releases, the running version's changelog, the Prefect UI URL
/zpods/{id}/usage, /zpods/{id}/usage/history, /zpods/footprint anyone who sees the zPod A zPod's VMs and their history; the footprint of each visible zPod

The SDK has the matching calls (stats_overview, stats_engine, zpods_usage_get, …). The full schema is in the API's OpenAPI page, http://<appliance-ip>:8000/docs.

Endpoint usage, per host, is on each endpoint's Usage tab: see Endpoints.