-
Notifications
You must be signed in to change notification settings - Fork 386
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
feat: allow to discard pipeline events when flusher_http's queue is full #1220
feat: allow to discard pipeline events when flusher_http's queue is full #1220
Conversation
shunjiazhu
commented
Nov 6, 2023
•
edited
Loading
edited
- 当前的flusher http的queue满时,会导致flusher的Export函数阻塞住,如果配置的http上报过慢会导致反压,允许用户在这种情况丢弃数据。
- 添加4个自监控指标,用来追踪丢点,重试,和发送延迟。
| AsyncIntercept | Boolean | 否 | 异步过滤数据,默认为否 | ||
| QueueCapacity | Int | 否 | 内部channel的缓存大小,默认为1024 | | ||
| AsyncIntercept | Boolean | 否 | 异步过滤数据,默认为否 | | ||
| DropEventWhenQueueFull | Boolean | 否 | 当Channel满时是否丢弃数据,默认为是,防止影响整个流水线 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认可能得为否吧?保持版本间的兼容
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外,这个功能是不是应该往上放一层,就是放在flusher的queue那里?这个功能是不是通用的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,长期来看确实应该应该提供这样一个统一的功能组件。
plugins/flusher/http/flusher_http.go
Outdated
@@ -139,7 +141,7 @@ func (f *FlusherHTTP) Init(context pipeline.Context) error { | |||
|
|||
f.buildVarKeys() | |||
f.fillRequestContentType() | |||
|
|||
f.droppedEvents = helper.NewCounterMetricAndRegister("http_flusher_dropped_events", context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是统计 drop 的 events 还是 group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
拆了两个指标了,都统计一下。
plugins/flusher/http/flusher_http.go
Outdated
default: | ||
f.counter.Done() | ||
f.droppedEvents.Add(1) | ||
logger.Warningf(f.context.GetRuntimeContext(), "FLUSHER_FLUSH_ALARM", "http flusher dropped a event due to the queue is full") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里log
对应的是一个 group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,改了名字了。不过发现这边的metric和我们的预期差别挺大的,只有最后一个flusher_http的指标被注册了下来。