Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add rate limiting log #1040

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

luoyuLianga
Copy link
Contributor

增加触发限流的标识
如果缓存允许最大并发批次是1k,如下
image

但是实际处理过程中,如果有发现超过1k的并发,那么应该有标识,标识输出的内容是:“buffer full”
image

同时可以配合mtail发现关键字,进一步针对指标配置阈值、告警,一气呵成
image
image

需要注意的一点是:
如果采集的内容达到一次发送的上限,也会直接发送走,不会触发该标识。所以需要合理定义batch_max_size、batch_max_content_size大小

@@ -108,6 +108,10 @@ func (s *batchStrategy) processMessage(m *message.Message, outputChan chan *mess
}
added := s.buffer.AddMessage(m)
if !added || s.buffer.IsFull() {
if s.buffer.IsFull() {
log.Printf("I! buffer full len: %s, size: %s",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是%d %d

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

@kongfei605 kongfei605 changed the title feat: Add rate limiting flag. chore: Add rate limiting log Aug 30, 2024
@kongfei605
Copy link
Collaborator

Thank you @luoyuLianga

@kongfei605 kongfei605 merged commit 452a183 into flashcatcloud:main Aug 30, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants