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

Update Plugin System Docs #2114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Takuka0311
Copy link
Collaborator

No description provided.


#### Metadata

metadata 的定位是存储 events 的元信息,一般由 input 生成,不会进行修改,但可能增加。
Copy link
Collaborator

Choose a reason for hiding this comment

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

存储 events 的元信息
输出的 events 元信息
-- 这两个描述应该都不怎么理解是啥意思


用途包括:

* 在程序打印日志中使用。如打印日志被丢弃时,打印文件名、 inode 。
Copy link
Collaborator

Choose a reason for hiding this comment

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

打印日志被丢弃时,打印文件名、 inode -- 看不太懂


输入包括:

* 在 processor 中生成(包括 SPL )。例如使用 metadata 中的 `host.ip` 信息生成 `__source__` tag 。
Copy link
Collaborator

Choose a reason for hiding this comment

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

整篇文档 SPL 就不要特殊提了,spl也是插件的一部分。

@@ -2,96 +2,185 @@

## 背景

作为日志服务的采集 AgentiLogtail 目前已运行于 100W+ 机器上,为万级别的应用提供服务,为了能够更好地实现与开源生态的融合并满足用户不断丰富的接入需求,我们为 iLogtail 引入了插件系统,目前,我们已通过插件系统支持了若干数据源,包括 HTTP、MySQL Query、MySQL Binlog 等。
作为阿里云日志服务的采集 Agent , LoongCollector (原 iLogtail 目前已运行于 100W+ 机器上,为万级别的应用提供服务,为了能够更好地实现与开源生态的融合并满足用户不断丰富的接入需求,我们为当时的 iLogtail 引入了插件系统,支持了若干数据源,包括 HTTP、MySQL Query、MySQL Binlog 等。
Copy link
Collaborator

Choose a reason for hiding this comment

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

作为阿里云日志服务的采集 Agent -- 开源就不合适了


下面我们将简单地介绍插件系统中的几点关键设计,这其中包含了一些我们在设计之初时的目标:
LoongCollector 使用总线模式作为线程模型,所谓总线模式,就是每个功能模块一个线程。根据流水线各个组件的功能划分,一般可以将流水线划分为三大模块:输入模块、处理模块和发送模块,各个模块之间通过缓冲队列进行连接。由于功能模块的数量是恒定的,因此能够保证整个采集器所需要使用的线程数是恒定的。LoongCollector 继承了 iLogtail 的线程模型,并在此基础上进一步演进。
Copy link
Collaborator

Choose a reason for hiding this comment

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

由于功能模块的数量是恒定的,因此能够保证整个采集器所需要使用的线程数是恒定的。
-- 比较晦涩


为了达到易扩展、易开发的目标,我们最终选择 Go 作为插件系统的实现语言,具体考虑的因素有以下几点
可以看到,在总线模式下,有如下几个固定的工作线程
Copy link
Collaborator

Choose a reason for hiding this comment

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

以下内容太细了,也比较难理解,大概介绍下就行了


目前,日志服务支持通过控制台进行采集配置,然后自动下发到 iLogtail 进行应用执行,当配置发生变化时,iLogtail 也会及时地获取这些配置并进行动态更新。插件系统作为配置内容的一部分,同样要具有这种动态更新配置的能力。
![Input Runner](https://ilogtail-community-edition.oss-cn-shanghai.aliyuncs.com/images/principle/input_runner.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个图去掉

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