Monitoring v2 — Error Metrics Refactoring
Version: 3.1.0 Date: 2026-06-12
Goal: Replace the always-increasing error gauge with semantically correct metrics that enable reliable New Relic alerting on new errors, and allow the gauge to decrease when errors are archived.
Solution: Introduced iptower.tasks.errors.open (gauge, decrements on archive) and iptower.tasks.errors.archived (counter). taskArchive now removes the task from errorTasks in memory. Added iptower.monitoring.version: '2' resource attribute to distinguish towers running v2 metrics from older deployments.
Features:
iptower.tasks.errors.open(gauge) — active (non-archived) error count; up on new error, down on archive. Replacesiptower.tasks.erroriptower.tasks.errors.archived(counter) — increments each time an error is archivediptower.monitoring.version: '2'resource attribute on all metrics — filter in New Relic to target this version- Archiving an error removes it from
errorTasksin memory and persists state in a single atomicarchiveErrorcall - Deprecated
SEMRESATTRS_SERVICE_NAME/SEMRESATTRS_SERVICE_VERSIONreplaced with stableATTR_SERVICE_NAME/ATTR_SERVICE_VERSION monitoring-params.jsonloading is now resilient: missing file logs a warning instead of crashing- New npm script
dk:otel:startfor local OTEL testing (port 9089) FtpTaskDetailsloader has the samegetTaskfallback asGitTaskDetailsfor archived tasks
Implementation Details:
archiveError(uuid)inDataServiceis the single entry point: setserror.archived, removes fromerrorTasks, increments counter, persiststaskArchiveinTaskServicedelegates entirely todataService.archiveError(uuid)
Files Modified:
src/monitoring.ts- resilient params loading,ATTR_*stable conventions,iptower.monitoring.versionresource attributesrc/core/data/data.service.ts- new metrics (errors.open,errors.archived),archiveErrormethodsrc/core/task/task.service.ts-taskArchivedelegates todataService.archiveErrorsrc/core/task/task.service.spec.ts- mockarchiveErrorintaskRetrytestui/src/pages/dashboard/taskDetails/FtpTaskDetails.tsx- fallback togetTaskfor archived taskspackage.json-dk:otel:startscriptREADME.md- OTEL section documenting metrics, local setup, alerting query