-
Notifications
You must be signed in to change notification settings - Fork 386
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: support prometheus self monitor, add 9 metrics for prom input plugin #1760
base: main
Are you sure you want to change the base?
Conversation
catdogpandas
commented
Sep 13, 2024
指标 | 描述 | labels | 类型 |
---|---|---|---|
prom_register_state | 注册状态 | pod_name,operator_host,operator_port | IntGauge |
prom_register_retry_total | 注册重试 | status,pod_name,... | Counter |
prom_job_num | 输入插件(Job)数量 | pod_name,... | IntGauge |
prom_subsricbe_targets | 订阅的 Targets 数量 | job,pod_name,... | IntGauge |
prom_subsricbe_total | 订阅次数总量 | status,job,pod_name,... | Counter |
prom_subsricbe_time_ms | 订阅耗时(分布) | status,job,pod_name,... | IntGauge |
prom_scrape_total | 采集次数总量 | status,target,job,pod_name,... | Counter |
prom_scrape_bytes_total | 采集总字节数 | status,target,job,pod_name,... | Counter |
prom_scrape_time_ms | 采集耗时(分布) | status,target,job,pod_name,... | IntGauge |
if (!mMetricsCounterMap.count(metricName) || !mMetricsCounterMap[metricName].count(status)) { | ||
mMetricsCounterMap[metricName][status] = GetOrCreateReentrantMetricsRecordRef(status)->GetCounter(metricName); | ||
} | ||
mMetricsCounterMap[metricName][status]->Add(val); |
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.
这里不要用map存储查找,具体原则可以再找玄飏对齐一下
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.
就算用map,不用加锁吗
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.
status 3XX,4XX,5XX这样是不是就好了?不需要具体的code吧