Background
Raised during review of PR #75 (refresh stale Cargo lockfiles before publish preflight).
Problem
lading/commands/lockfile.py uses LOGGER calls to record decisions at key points, but provides no structured metrics (counters, histograms, timers) for:
- Lockfile discovery count (number of tracked lockfiles found)
- Lockfile refresh duration and error rate
- Lockfile freshness validation latency and failure rate
Without these, operators cannot diagnose throughput problems, track error trends, or alert on regressions in lockfile handling.
Suggested resolution
- Choose and integrate a lightweight Python metrics framework (e.g.,
prometheus_client or a project-standard library) at the lading/commands/lockfile.py boundary.
- Emit a counter on each successful and failed
refresh_lockfile invocation.
- Emit a histogram or timer around
refresh_lockfile and validate_lockfile_freshness call duration.
- Emit a gauge or counter for the number of lockfiles discovered by
discover_tracked_lockfiles.
- Document the metric names and labels in
docs/developers-guide.md.
References
Background
Raised during review of PR
#75(refresh stale Cargo lockfiles before publish preflight).Problem
lading/commands/lockfile.pyusesLOGGERcalls to record decisions at key points, but provides no structured metrics (counters, histograms, timers) for:Without these, operators cannot diagnose throughput problems, track error trends, or alert on regressions in lockfile handling.
Suggested resolution
prometheus_clientor a project-standard library) at thelading/commands/lockfile.pyboundary.refresh_lockfileinvocation.refresh_lockfileandvalidate_lockfile_freshnesscall duration.discover_tracked_lockfiles.docs/developers-guide.md.References
@leynos