Skip to content

[LOW] AI service circuit breaker has no metrics export #134

Description

@kilodesodiq-arch

Engineering Gap

app/ai-service/services/circuit_breaker.py implements circuit breaker pattern but does not export Prometheus metrics for breaker state transitions, failure counts, or recovery events.

Codebase Evidence

  • app/ai-service/services/circuit_breaker.py: Circuit breaker implementation
  • app/ai-service/metrics.py: Prometheus metrics exist but no circuit breaker metrics

Risk Profile

Circuit breaker tripping undetected until service degradation noticed by users.

Remediation Strategy

Add Prometheus gauge for circuit state (CLOSED/OPEN/HALF_OPEN). Add counter for failure count. Add histogram for recovery time.

Success Conditions

  • Circuit state gauge exported
  • Failure counter exported
  • Recovery time histogram exported

Change Surface

Files: circuit_breaker.py, metrics.py

Security Review

No security impact.

Completion Checklist

  • Implementation completed
  • Peer reviewed
  • Tests passing
  • Ready for merge

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions