Sentry: 限制速率错误已发送以防止错误配额耗尽

huangapple go评论63阅读模式
英文:

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有很好的文档,涵盖了这个问题。我认为有两种解决方案适合你:

  1. 速率限制 - 这使您能够控制 Sentry 在一定时间内接收每个项目的事件数量,因此一些多余的事件不会计入配额。
  2. 尖峰保护 - 也许保护您的配额最好的方法是启用尖峰保护。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:

  1. 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.
  2. 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.

huangapple
  • 本文由 发表于 2023年2月16日 19:09:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75471388.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定