When upgrading from the deprecated monitor_metrics.sh/systemd timer setup to
the p4metrics daemon, both end up running simultaneously and writing to the
same p4_monitor-<instance>-<serverid>.prom file.
This causes intermittent stale/missing metrics — most noticeably
p4_monitor_max_cmd_time disappearing and p4_process_count showing 0 —
because whichever process writes last wins.
The monitor_metrics.sh script header says it's deprecated in favour of
p4metrics, but the install/update scripts don't disable the old timer.
Fix: install_p4prom.sh and update_p4prom.sh should detect and
systemctl disable --now monitor_metrics.timer monitor_metrics.service
as part of the migration when p4metrics is being installed/enabled.
When upgrading from the deprecated
monitor_metrics.sh/systemd timer setup tothe
p4metricsdaemon, both end up running simultaneously and writing to thesame
p4_monitor-<instance>-<serverid>.promfile.This causes intermittent stale/missing metrics — most noticeably
p4_monitor_max_cmd_timedisappearing andp4_process_countshowing 0 —because whichever process writes last wins.
The
monitor_metrics.shscript header says it's deprecated in favour ofp4metrics, but the install/update scripts don't disable the old timer.Fix:
install_p4prom.shandupdate_p4prom.shshould detect andsystemctl disable --now monitor_metrics.timer monitor_metrics.serviceas part of the migration when
p4metricsis being installed/enabled.