P4Prometheus integrates Perforce Helix Core Server (p4d) with Prometheus and related monitoring tools. It collects real-time metrics from p4d logs, p4 monitor, and related sources, then exposes them for Prometheus collection and Grafana dashboards. The metrics can also drive system alerting.
The p4prometheus service continuously parses p4d logs and writes Prometheus textfile-collector metrics. Other project components interrogate p4d and associated logs for supplementary metrics.
P4Prometheus is part of a monitoring solution comprising these components:
-
Prometheus: time-series metrics management.
-
VictoriaMetrics: recommended, Prometheus-compatible long-term metrics storage.
-
Grafana: metrics dashboards and visualization.
-
node_exporter: Linux host metrics and textfile collection.
-
windows_exporter: Windows host metrics.
-
Alertmanager: alert routing, grouping, and de-duplication.
-
Pint: Prometheus alerting rules linter - fork of Cloudflare original.
In addition to these components you can create a monitoring solution tailored to your environment, with automation and alerting including:
-
Alerts being sent to Slack (or Teams/Email/PagerDuty)
-
Such alerts containing links to relevant Grafana dashboards, and a Runbook for incident response, help ensure timely and effective handling of incidents.
-
Options for alerting include notifications of blocked commands, and automated updates when blocks reduce
-
-
Monitoring of Memory usage, and optional OOM-kill events (Out-Of-Memory killer) on Linux hosts.
Project components:
-
p4prometheus: a binary that parses P4 Server logs.
-
p4metrics: supplementary P4 Server and SDP-compatible metrics.
-
monitor_locks.py and p4monitor_locks.sh: Linux lock monitoring using
lslocksandp4 monitor show. -
p4logtail and p4plogtail: completed-command log tails with JSON output (for use with third party log analysis tools such as Splunk, DataDog, ELK Stack etc.)
P4Prometheus uses go-libp4dlog for p4d log parsing.
The installation and upgrade scripts support standard installation, dedicated data volumes (-d /data), offline assets (--local-tarballs-dir), SDP-safe configuration in /p4/common/site/config/, hostname-specific HMS fleet configuration, and stateful non-destructive upgrades. See the installation guide for details.
Use the automated scripts for new installations and upgrades. The canonical guide is P4Prometheus Installation.
It covers monitoring-server, P4 Server, and node-exporter-only installations; upgrades; dedicated data volumes; air-gapped installations; state files; and manual component installation where scripts cannot be used.
When configured, Grafana dashboards provide command, replication, lock, and host-level views.
Grafana dashboards can define alerts; Alertmanager processes their notifications. The installation guide includes setup and validation guidance, and Runbook Alert Handling provides a customizable operational runbook.
All principal metrics carry serverid and, for SDP installations, sdpinst labels. The README remains the exhaustive metric-name reference: metrics available.
The primary log parser reports command throughput, active commands, resource use, synchronization activity, command error counts, command durations, and lock wait/held time.
| Metric family | Examples |
|---|---|
Parser health and throughput |
|
Command activity |
|
Resource use |
|
Command dimensions |
|
Lock timings |
|
p4metrics replaces the legacy monitor_metrics.sh metrics while retaining compatible names and labels. It reports active processes, memory, server identity and uptime, replication, journal/log rotation, license state, SDP job results, Swarm status, and optional memory-limit enforcement.
| Metric family | Examples |
|---|---|
Process monitoring |
|
Memory and limits |
|
Replication |
|
Server and license |
|
SDP jobs and logs |
|
Swarm |
|
Linux lock monitoring requires lslocks. p4monitor_locks.sh invokes monitor_locks.py, which relates operating-system locks to p4 monitor show results. It reports:
-
p4_locks_db_readandp4_locks_db_write -
p4_locks_cliententity_readandp4_locks_cliententity_write -
p4_locks_meta_readandp4_locks_meta_write -
p4_locks_cmds_blocked
The detailed lock-monitoring installation and troubleshooting information is in P4Prometheus Installation.




