Skip to content

Infer circuit breaker service name from class name

Patrick Bajao requested to merge 410694-infer-service-name-class-name into master

What does this MR do and why?

Before this change, we require classes that include the CircuitBreaker concern to define #service_name.

To remove that need, we are now getting the self.class.name as the service_name.

This changes the key that circuitbox creates to something like:

circuits:Gitlab::Llm::Anthropic::Client:stats:1683864900:success

instead of:

circuits:anthropic:stats:1683864720:success

This is behind the circuit_breaker feature flag.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #410694 (closed)

Merge request reports