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

feat: allow to discard pipeline events when flusher_http's queue is full #1220

Closed
wants to merge 16 commits into from
Closed

feat: allow to discard pipeline events when flusher_http's queue is full #1220

wants to merge 16 commits into from

Conversation

shunjiazhu
Copy link
Contributor

@shunjiazhu shunjiazhu commented Nov 6, 2023

  1. 当前的flusher http的queue满时,会导致flusher的Export函数阻塞住,如果配置的http上报过慢会导致反压,允许用户在这种情况丢弃数据。
  2. 添加4个自监控指标,用来追踪丢点,重试,和发送延迟。

| AsyncIntercept | Boolean | 否 | 异步过滤数据,默认为否
| QueueCapacity | Int | 否 | 内部channel的缓存大小,默认为1024 |
| AsyncIntercept | Boolean | 否 | 异步过滤数据,默认为否 |
| DropEventWhenQueueFull | Boolean | 否 | 当Channel满时是否丢弃数据,默认为是,防止影响整个流水线 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

默认可能得为否吧?保持版本间的兼容

Copy link
Collaborator

Choose a reason for hiding this comment

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

另外,这个功能是不是应该往上放一层,就是放在flusher的queue那里?这个功能是不是通用的?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯,长期来看确实应该应该提供这样一个统一的功能组件。

@@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个是统计 drop 的 events 还是 group

Copy link
Contributor Author

Choose a reason for hiding this comment

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

拆了两个指标了,都统计一下。

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")
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里log 对应的是一个 group

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯,改了名字了。不过发现这边的metric和我们的预期差别挺大的,只有最后一个flusher_http的指标被注册了下来。

@shunjiazhu shunjiazhu closed this by deleting the head repository Mar 6, 2024
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.

3 participants