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

插件目录结构调整 #62

Closed
andrewshan opened this issue Jun 7, 2022 · 0 comments · Fixed by #122
Closed

插件目录结构调整 #62

andrewshan opened this issue Jun 7, 2022 · 0 comments · Fixed by #122
Assignees
Labels
enhancement New feature or request

Comments

@andrewshan
Copy link
Member

andrewshan commented Jun 7, 2022

什么是插件,插件需要满足3个原则:

  1. 实现某一个独立的功能的子模块,同一类型的所有插件要完成的事情是一致的
  2. 插件类型的名字,与插件所完成的事情存在关联

从上述2个原则来审视,以下插件需要进行调整:

  • alarmreporter:告警插件,用于上报告警信息,当前实现为空
    需去掉,不满足原则1,因为告警一般和监控相关,且一般不由SDK直接告警,一般是监控平台进行触发

  • subscribe:订阅插件,用于承载用户的订阅及通知的能力
    去掉,不满足原则1,SDK订阅能力通过缓存或者服务端直接驱动,并非独立功能的子模块,需挪入到主流程

  • cmdb:地域信息获取插件,用于提供多种获取SDK自身所在地域信息的能力
    需改名,插件类型名不符合所做的事情,不满足原则2,改名为location。
    同时需要增加通过服务端返回的ReportClientResponse信息解析获取地域信息的插件。
    插件名需要改成:polaris_server(服务端获取),environment(环境变量获取),rest(通过调用REST接口来获取)

  • reporthandler:report client的请求前置处理及后置处理逻辑
    需去掉,不满意原则1,插件并不是完成一个独立的功能,属于report client的一个辅助能力。
    插件去掉后,相关逻辑以这种方式实现:

    1. report client上报的数据统一从context中获取,context将需要带给服务端的数据都打入一个标记(代表是否需要上报),report client不关心上报的数据具体是啥。
    2. 监控插件启动时,将自身的端口等信息,写入到context中,设置标记
    3. clientid在SDK初始化的时候,也写入context中,设置标记
  • statreporter:完成统计监控上报的事情,当前实现为对接prometheus
    需改名,插件类型名不容易懂,与业界主流概念不相符,不满足原则2,改名为metric。

@andrewshan andrewshan added the enhancement New feature or request label Jun 7, 2022
@chuntaojun chuntaojun linked a pull request Feb 1, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants