microsoft / microsoft/aspire

Aspire Yarp - Setup Proxy Ratelimiting with IDistributedCache support

Open
#16,520 0 comments 1 reaction 0 assignees View on GitHub
area-integrations yarp
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

The best spot to apply rate limiting is at the Proxy. Right now we can't apply rate limiting in Yarp in Aspire. Further, .NET doesn't have a distributed version of rate limiting so even if we could configure standard rate limiting in yarp with aspire, if you create a cluster, you'd immediately defeat the rate limiter without adding distributed rate limiting to it as well.

### Describe the solution you'd like

It would be nice if you could easily configure rate limiting from the aspire configuration of yarp, and either add RedisRateLimiting ability directly, or adopt it as a package in .net because it's so valuable and allow us to add that too.

I.e. the proxy can have many instances, and rate limiting doesn't work out of the box with .net without this package across instances. So to create a complete production ready multi-instance rate limiting.

### Additional context

Right now you have to create a custom service for the proxy, and that then defeats all of the tooling for deploys with yarp so then you're on your own for deploys to say kubernetes etc. as a reverse proxy, which is obviously a problem. There is another ticket for programatic YARP configuration that is now closed, but this would go nicely with whatever the ultimate solution is there.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.