Skip to content

fix: ResourceDeletedTotal metric registered but never incremented #50

@digiserg

Description

@digiserg

Summary

ResourceDeletedTotal counter metric is declared and registered in internal/metrics/metrics.go:48 but never incremented anywhere in the codebase. This is dead code that provides misleading observability — the metric exists in Prometheus but always reads zero.

Detailed Requirements

Either:

  1. Wire the metric into delete paths across all controllers (increment on successful resource deletion), OR
  2. Remove the metric entirely and deregister from the Prometheus collector

Option 1 is preferred if the metric provides operational value.

Location

  • internal/metrics/metrics.go:48

Acceptance Criteria

  1. Metric is either wired into all controller delete paths OR removed from registration
  2. If kept: incremented on successful resource deletion in each controller (AxonOpsServer, all alert controllers)
  3. If removed: deregistered from Prometheus collector, no dangling references

Testing Requirements

  • If kept: unit test verifies metric increments on successful deletion
  • If removed: verify no references remain in codebase
  • Grep for any other registered-but-unused metrics

Documentation Requirements

  • If kept: document the metric in operator metrics reference
  • If removed: no action needed

Dependencies

  • None

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt and code quality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions