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

Add tracer autoconfigure. (#847) #875

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

it-linnan
Copy link
Contributor

@it-linnan it-linnan commented Sep 5, 2021

为 SOFATracer 中的 plugin 增加 SOFABoot auto-configuration

fix #847

以下plugin的autoconfigure,是从SOFATracer 3.1.0版本的starter中抽取了相关代码,同步过来的。

  • KafkaMQ
  • RabbitMQ
  • SpringMessage
  • Redis

MongoDB plugin 的autoconfigure

前提:SOFATracer基于MongoDB 3.8.2版本的驱动实现,而当前版本SOFABoot依赖MongoDB 4.0.5版本驱动。因此,需基于当前版本驱动的MongoClientMongoAutoConfiguration实现自动配置。

实现思路:注册自定义MongoClientSettingsBuilderCustomizerbean,向MongoDB client的配置类中增加SofaTracerCommandListener。

RocketMQ plugin 的autoconfigure

  1. 添加了可选依赖rocketmq-spring-boot-starter
  2. 注册BeanPostProcessor,在producer和consumer初始化后,添加MessageHook

@codecov
Copy link

codecov bot commented Sep 5, 2021

Codecov Report

Merging #875 (d26c33e) into master (d7f4dc1) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master     #875      +/-   ##
============================================
- Coverage     11.38%   11.25%   -0.13%     
  Complexity       41       41              
============================================
  Files           312      325      +13     
  Lines          9207     9310     +103     
  Branches       1270     1275       +5     
============================================
  Hits           1048     1048              
- Misses         8001     8104     +103     
  Partials        158      158              
Impacted Files Coverage Δ
...igure/tracer/SofaTracerKafkaAutoConfiguration.java 0.00% <0.00%> (ø)
...igure/tracer/SofaTracerMongoAutoConfiguration.java 0.00% <0.00%> (ø)
...re/tracer/SofaTracerRabbitMqAutoConfiguration.java 0.00% <0.00%> (ø)
...igure/tracer/SofaTracerRedisAutoConfiguration.java 0.00% <0.00%> (ø)
...re/tracer/SofaTracerRocketMqAutoConfiguration.java 0.00% <0.00%> (ø)
...nfigure/tracer/SpringMessageAutoConfiguration.java 0.00% <0.00%> (ø)
...a/processor/KafkaConsumerFactoryPostProcessor.java 0.00% <0.00%> (ø)
...a/processor/KafkaProducerFactoryPostProcessor.java 0.00% <0.00%> (ø)
...ocessor/StreamRocketMQTracerBeanPostProcessor.java 0.00% <0.00%> (ø)
...ofaTracerMongoClientSettingsBuilderCustomizer.java 0.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@it-linnan it-linnan mentioned this pull request Sep 5, 2021
Copy link
Contributor

@alaneuler alaneuler left a comment

Choose a reason for hiding this comment

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

mongodb 和 rocketmq 的基础 processor 可以提供一下测试用例吗?

@alaneuler
Copy link
Contributor

@it-linnan 还有一个问题,原先 tracer 代码中的 @author 标签不对(后边没有冒号的),也辛苦改一下。

review 有点慢,还请见谅~

@alaneuler
Copy link
Contributor

@it-linnan 感谢贡献代码~ mongodb 和 rocketmq 的基础 processor 可以提供一下测试用例吗?

@it-linnan
Copy link
Contributor Author

@it-linnan 感谢贡献代码~ mongodb 和 rocketmq 的基础 processor 可以提供一下测试用例吗?

好的,我写一下测试用例

@it-linnan
Copy link
Contributor Author

@alaneuler 测试用例已提交,麻烦review下,辛苦~

@sofastack-bot sofastack-bot bot added size/XXL and removed size/XL labels Dec 13, 2022
Copy link
Contributor

@HzjNeverStop HzjNeverStop left a comment

Choose a reason for hiding this comment

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

LGTM

@HzjNeverStop HzjNeverStop dismissed alaneuler’s stale review December 13, 2022 09:26

已添加测试用例

@HzjNeverStop HzjNeverStop merged commit d7e6a1d into sofastack:master Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

增加sofaTracer插件
3 participants