-
Notifications
You must be signed in to change notification settings - Fork 394
(Bugfix):Add mIntervals to adjust the collection interval when more collector is needed #2206
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9e1a281
to
0825d23
Compare
Abingcbc
requested changes
May 9, 2025
9728e53
to
b98f1d1
Compare
Abingcbc
approved these changes
May 13, 2025
mContext->GetRegion()); | ||
uint32_t cpuInterval = mInterval; | ||
if (config.isMember("CPU")) { | ||
const Json::Value cpuConfig = config.get("CPU", Json::Value(Json::objectValue)); |
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.
用这个方法来提取吧 GetOptionalMapParam
messixukejia
requested changes
May 14, 2025
mContext->GetRegion()); | ||
uint32_t cpuInterval = mInterval; | ||
if (config.isMember("CPU")) { | ||
const Json::Value cpuConfig = config.get("CPU", Json::Value(Json::objectValue)); |
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.
每个场景单独控制的必要性需要综合评估下 @Abingcbc
1、太复杂了
2、对基础云监控的影响
b98f1d1
to
b19e683
Compare
…interval when more collector is needed When a new collector is registerd, missing interval will make loongcollector stuck. Adding a new vector to store the mInterval of each collector, to make sure each collector have its own interval instead of 0, making loongcollector stuck.
b19e683
to
958e8cd
Compare
messixukejia
approved these changes
May 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
背景
在尝试对host_monitor进行新collector增加的时候,会发现新collector注册以后,运行collector以后会出现程序运行卡住,cpu占用较高的情况
原因
原始函数在进行UpdateCollector的时候,只传入了一个mInterval,导致了在多个collector的时候,只有一个mInterval传入,其他mInterval默认为0,无法运行
解决方案
为了适配可以灵活添加使能Collector,修改配置的层级结构,不同的Collector下面分别有其自身的采样间隔以及使能开关。
然后新增mIntervals vector,用于给对应的sName Collector的采样间隔,使其正常运行