Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Microsoft.Extensions.Http.Resilience] Circuit-breakers and SelectPipelineByAuthority confusion #5540

Open
natwallbank opened this issue Oct 18, 2024 · 0 comments

Comments

@natwallbank
Copy link

Hey there,

I recently raised an issue relating to the mechanism of being able to monitor circuit-breaker state and manual control, as I felt (and still feel) that the API doesn't really lend itself to being able to do this for a number of discrete dependencies that you want to monitor separately.

I worked around this by following the guidance and defining separate pipelines for each dependency, which allowed me to configure distinct instances of CircuitBreakerStateProvider and CircuitBreakerManualControl. That all works fine.

However, I've just hit another edge case, in that one of our dependencies has a dynamic base URL that we only resolve at runtime. It looks something like this:

https://some.downstreamservice.{cell}.com/

We query another service on behalf of the client, which tells us which cell value to use for a subsequent request.

This all works fine from an HttpClient point of view, but I wanted to be sure that the circuit breaker isn't shared across all instances, i.e. if the circuit is opened for https://some.downstreamservice.A.com/ then it should not also open for https://some.downstreamservice.B.com/.

I gather from the documentation that the answer to this is using SelectPipelineByAuthority.

Where I'm confused is: how can I query circuit-breaker state for each "instance"? I feel like there's a missing API to be able to inspect pipeline state, rather than supplying these instances as part of configuration?

Once again though, there's also a high chance that I'm missing the real answer - but I've struggled to find anything relevant in the docs.

Thanks, again, in advance!

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

No branches or pull requests

1 participant