getsentry / getsentry/sentry-python

cron interval "too short" warning is spammy

未關閉
#4,116 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Checks Improvement Python Quality Improvement
主要語言
Python
星號
2.2k
分支
669
平均合併
1 天 40 分鐘
30 天內合併 PR
212

描述

### How do you use Sentry?

Sentry Saas (sentry.io)

### Version

mainline

### Steps to Reproduce

sentry has a few celerybeat tasks which are configured with very short intervals -- the sdk emits this warning log line every time they run which produces a lot of logspam:

> Intervals shorter than one minute are not supported by Sentry Crons. Monitor 'getsentry-billing-usage-scan-usage-buffer' has an interval of 10 seconds. Use the exclude_beat_tasks option in the celery integration to exclude it.

### Expected Result

it should ideally only warn once per process

perhaps either by (ab)using the python `warnings` system or by wrapping the warning log line in an lru_cache

something like

```python
@functools.cache
def _warn_interval_too_short(monitor_name: str) -> None:
logger.warning(...)
```

### Actual Result

see above

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。