-
Notifications
You must be signed in to change notification settings - Fork 389
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: refactor ReadMetrics and fix bug #1886
base: main
Are you sure you want to change the base?
Conversation
LOG_INFO(sLogger, ("self-monitor", "started")); | ||
int32_t lastMonitorTime = time(NULL); | ||
{ | ||
unique_lock<mutex> lock(mThreadRunningMux); |
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.
锁的使用。。。
string inputStr = R"( | ||
{ | ||
"Type": "input_self_monitor_metric", | ||
"Rules": { |
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.
去掉这一层
{ // input_self_monitor_metric | ||
Json::Value inputSelfMonitorMetric; | ||
string errMsg; | ||
string inputStr = R"( |
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.
inner代码
@@ -233,6 +234,9 @@ bool PipelineConfig::Parse() { | |||
} | |||
mInputs.push_back(&plugin); | |||
// TODO: remove these special restrictions | |||
if (pluginType == "input_self_monitor_metric") { |
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.
不需要加
} | ||
|
||
void LoongCollectorMonitor::UpdateMetricPipeline() { | ||
if (!mInnerPipelineStarted.load()) { |
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.
x
} | ||
|
||
std::set<std::string> SelfMonitorMetricEvent::GetTargets() { | ||
set<string> targets; |
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.
tagets都在flusher
return targets; | ||
} | ||
|
||
void SelfMonitorMetricEvent::ReadAsLogEvent(LogEvent* logEventPtr) { |
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.
数据流转
input -> metrievent --> flusher --> SLS Log / Prometheus /
void SelfMonitorServer::PushMetricEventIntoMetricEventMap(std::vector<SelfMonitorMetricEvent>& events) { | ||
lock_guard<mutex> lock(mMetricPipelineMux); | ||
|
||
for (auto pipelineRule = mMetricPipelines.begin(); pipelineRule != mMetricPipelines.end(); pipelineRule++) { |
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.
单pipeline
No description provided.