reverse-proxy
reverse-proxy copied to clipboard
IProbingRequestFactory.CreateRequest parameters are artificially limiting
https://github.com/dotnet/yarp/blob/4cce2187dc673690ad7f0e9b3715b62ebe97a637/src/ReverseProxy/Health/IProbingRequestFactory.cs#L20
These being ClusterModel and DestinationModel make it unnecessarily hard to retrieve certain information, like the current health state of the destination, or even its ID.
We should consider accepting ClusterState and DestinationState here instead.
I didn't see any discussion about this specific API shape in https://github.com/dotnet/yarp/pull/459.
Not sure it's worth a full breaking change, but we could do it by e.g. exposing a new overload with a DIM and optionally obsoleting the existing one.
ValueTask<HttpRequestMessage> CreateRequestAsync(ClusterState cluster, DestinationState destination) =>
ValueTask.FromResult(CreateRequest(cluster.Model, destination.Model));