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 metric for queue #1756

Merged
merged 14 commits into from
Sep 14, 2024
Merged

add metric for queue #1756

merged 14 commits into from
Sep 14, 2024

Conversation

henryzhx8
Copy link
Collaborator

@henryzhx8 henryzhx8 commented Sep 12, 2024

  • 指标框架改动:
  1. IntGauge新增Add和Sub接口,以支持非绝对型指标(比如队列元素的size和)
  2. 将准备metricrecordref和将metricrecordref加入到链表的操作分开,以支持增加metricrecordref的label
  • 新增队列公共指标(除exactly once发送队列)
    进入的数量、进入的size、出去的数量、总时延、队列长度、size

  • 队列指标公共label
    config_name、project、component_name、queue_type

@henryzhx8 henryzhx8 added the core Core feature label Sep 12, 2024
@henryzhx8 henryzhx8 added this to the v2.2 milestone Sep 12, 2024
core/monitor/MetricConstants.cpp Outdated Show resolved Hide resolved
core/monitor/LogtailMetric.h Show resolved Hide resolved
core/monitor/LogtailMetric.cpp Show resolved Hide resolved
core/plugin/flusher/sls/FlusherSLS.cpp Show resolved Hide resolved
@@ -58,14 +83,26 @@ bool SenderQueue::Remove(SenderQueueItem* item) {
++mRead;
}
--mSize;

mOutItemsCnt->Add(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里为啥没有对称的mOutItemDataSizeBytes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

因为没啥用,统计个数也只是为了计算平均延时,这个指标本身没有实际价值

core/pipeline/queue/SenderQueue.cpp Show resolved Hide resolved
@@ -220,6 +235,20 @@ void WriteMetrics::PrepareMetricsRecordRef(MetricsRecordRef& ref,
mHead = cur;
}

void WriteMetrics::CreateMetricsRecordRef(MetricsRecordRef& ref,
Copy link
Collaborator

Choose a reason for hiding this comment

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

这一对能在PrepareMetricsRecordRef中复用吗?让他们建立点联系,一看就知道API选用哪个

@henryzhx8 henryzhx8 merged commit 67a0121 into main Sep 14, 2024
14 of 15 checks passed
@henryzhx8 henryzhx8 deleted the metric/queue branch September 14, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants