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

Feat: refactor ReadMetrics and fix bug #1886

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

Conversation

Takuka0311
Copy link
Collaborator

No description provided.

@Takuka0311 Takuka0311 changed the title Feat: refactor ReadMetrics and fix Feat: refactor ReadMetrics and fix bug Nov 14, 2024
core/monitor/SelfMonitorServer.cpp Show resolved Hide resolved
core/monitor/PluginMetricManager.cpp Show resolved Hide resolved
LOG_INFO(sLogger, ("self-monitor", "started"));
int32_t lastMonitorTime = time(NULL);
{
unique_lock<mutex> lock(mThreadRunningMux);
Copy link
Collaborator

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": {
Copy link
Collaborator

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"(
Copy link
Collaborator

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") {
Copy link
Collaborator

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()) {
Copy link
Collaborator

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;
Copy link
Collaborator

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) {
Copy link
Collaborator

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++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

单pipeline

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