英文:
Sentry: rate limit errors sent to prevent depletion of error quota
问题
当基础设施事故发生时,应用程序将开始生成数千个相同错误的发生。是否可以在Sentry客户端(或服务器)上配置某种速率限制或类似的内容,以避免用尽错误配额?
我主要使用Python、Django和Celery。
英文:
When an infrastructure incident happens, the application will start to generate thousands of occurrences of the same error. Is it possible to configure some kind of rate limiting or anything like that on the sentry client (or server) to avoid depleting the error quota?
I'm using Python, Django and Celery mostly.
答案1
得分: 3
是的,有多种解决这个常见问题的方法。Sentry是一个很棒的工具,但当出现烦人的 bug 时,可能会引发一些问题。
Sentry有很好的文档,涵盖了这个问题。我认为有两种解决方案适合你:
- 速率限制 - 这使您能够控制 Sentry 在一定时间内接收每个项目的事件数量,因此一些多余的事件不会计入配额。
- 尖峰保护 - 也许保护您的配额最好的方法是启用尖峰保护。Sentry会测量您的平均使用情况,如果在短时间内出现异常数量的事件,它们将被忽略。
速率限制是一种不错的保护系统,但有点硬编码。尖峰保护是动态的,更能根据您的个人需求进行调整。两者的结合可以提供一种很好的方法,以保留您的配额直到月底。
英文:
Yes, there are multiple solutions to this common problem. Sentry is an amazing tool, but when there's that annoying bug it can cause quite the issue.
Sentry has great documentation that covers this problem. There are two solutions I see as a good use case for you:
- Rate limiting - This enables you to control the number of incidents Sentry receives per project over a given period of time, thus some redundant events won't be measured and counted against quota.
- Spike protection - Maybe the best way to protect your quota is by enabling the spike protection. Sentry measures your average usage and if there's a abnormal number of events coming in a short period of time they will get ignored.
Rate limiting is a good protection system, but kinda hardcoded. Spike protection is dynamic and adjusts more to your personal needs. Combination of both could provide a great way to preserve your quota until the end of the month.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论