circuit-breaker

Apply configurable circuit-breaker patterns to .NET HTTP client calls.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill circuit-breaker-faysilalshareef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circuit-breaker
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/resilience/circuit-breaker
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill circuit-breaker-faysilalshareef

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects downstream calls from cascading failures by applying a circuit-breaker pattern to outbound requests, preventing widespread outages and preserving system stability.

Core Features & Use Cases

  • Circuit states: Closed, Open, and Half-Open with configurable thresholds and BreakDuration to control when to retry.
  • HTTP client resilience: integrates with .NET HttpClient pipelines and supports both built-in and custom circuit-breaker configurations.
  • Observability and guidance: provides clear state transitions, health checks, and error handling guidance for graceful degradation.

Quick Start

Enable a circuit breaker on your HTTP client and tune FailureRatio, SamplingDuration, MinimumThroughput, and BreakDuration to match your traffic.

Frequently Asked Questions about circuit-breaker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent cascading failures in .NET HttpClient calls?

You can configure circuit-breaker resilience in .NET by tuning FailureRatio, SamplingDuration, MinimumThroughput, and BreakDuration. These parameters control when the circuit opens and how long it waits before transitioning to Half-Open to test downstream recovery.

What is the circuit-breaker pattern and when should I use it for HTTP client resilience?

The circuit-breaker pattern protects downstream services from cascading outages by tripping a circuit open after repeated failures. Use it for HTTP client resilience when dependent endpoints are unstable and continuous retries would overwhelm the failing system.

How do I handle BrokenCircuitException when a circuit breaker opens?

To handle BrokenCircuitException when a circuit breaker opens, implement error handling guidance in your calling code for graceful degradation. Catch the exception to provide fallback responses, ensuring your application remains functional while the downstream service recovers.

Does this circuit breaker support custom configurations for high-throughput .NET applications?

Yes, the circuit breaker supports custom configurations for high-throughput .NET applications. You can adjust SamplingDuration and MinimumThroughput to ensure the circuit only opens when sufficient traffic volume experiences failures, preventing false trips during low-traffic periods.

What is the best way to monitor circuit breaker state transitions in .NET?

The best way to monitor circuit breaker state transitions is using built-in observability and health checks. These features provide clear visibility into Closed, Open, and Half-Open state changes, allowing you to track system health and downstream recovery status.