# Backup export collector final metric cleanup

## Analysis

| Area | Current behavior | Change |
| --- | --- | --- |
| Shared metrics collector | Re-reads objects that left the unfinished set and calls the update callback, which recreates terminal gauges. | Add a delete callback and use it for objects in `finishedSet`. |
| Backup export metrics | Failed, successful, and canceled exports can be reintroduced after the status hook deletes them. | Delete the object labels from the collector path. |
| Other shared collector users | Backup, compact backup, and CRRF use the same shared collector. | Wire their existing metric families to explicit delete callbacks. |

## Execution

1. Add `DeleteStatusMetrics` to the shared collector target and invoke it for objects leaving the unfinished set.
2. Add metric-family deletion helpers and wire backup, backup export, compact backup, and CRRF collectors.
3. Add regression coverage proving finished objects are deleted rather than updated, including failed, success, and canceled backup-export statuses.
4. Run `gofmt` and `go test ./app/metrics/...`.
5. Run `make app-unit-test-local` if dependencies and the local environment permit it.

## Verification

- The collector test must show no update callback for finished objects.
- The collector test must invoke the delete callback for failed, success, and canceled objects.
- The metrics packages must compile and their tests must pass.

## Risk assessment

This changes only in-process Prometheus gauge cleanup for objects that have left the active set. Database state and workflow behavior are unchanged. A process restart still clears any pre-existing stale gauges.
