-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: supplement RocksDB Metrics. #1560
feat: supplement RocksDB Metrics. #1560
Conversation
006975c
to
71aabab
Compare
At present, 15 properties of rocksdb are temporarily selected as metrics. Because it is not sure whether there are only 15 indicators, in order to avoid repeated adjustments, only string and hash type metrics are displayed in grafana for the time being. It is also necessary to discuss whether to increase metrics and the rationality of the display order. Tomorrow I will supplement the document, including which indicators are counted and the guidelines for the operation process. |
"zset": "zsets_", | ||
} | ||
|
||
func createPrefixedMetrics(prefixMap map[string]string, metrics map[string]MetricConfig) map[string]MetricConfig { |
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.
PROPERTY_TYPE_ROCKSDB_BACKGROUND_ERRORS 指标以及GetRocksDBInfo获取的指标,是否使用partition_name或data_type作为指标label 会更合适?
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.
@pourer Thanks for your review.
partition 概念之后要删除掉了,data_type请问是指什么?
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.
@pourer Thanks for your review. partition 概念之后要删除掉了,data_type请问是指什么?
是指strings、hashes、lists、sets、zsets这些,现在是把data_type作为前缀拼接成单独的metrics name,查询时相当于是不同的指标。把data_type作为label是否会便于在grafana上进行组织和查看
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.
您的意思是可以不拼接前缀而通过data_type作为label来区分吗?但是那样的话,pika_exporter暴露的指标的key是否会重复?我不知道这样是否可以。我对grafana的使用并不是很熟悉,望指导。
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.
您的意思是可以不拼接前缀而通过data_type作为label来区分吗?但是那样的话,pika_exporter暴露的指标的key是否会重复?我不知道这样是否可以。我对grafana的使用并不是很熟悉,望指导。
pika_exporter解析时,从对应的info信息中提取出data_type。比如block_cache_pinned_usage指标,在info中显示为:hashs_block_cache_pinned_usage: XXX
,按照目前pika_exporter中的处理方式,可以通过正则捕获组的方式对文本进行提取,提取出data_type=hashs
具体可以参考:tools/pika_exporter/exporter/metrics/keyspace.go#L9
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.
您的意思是可以不拼接前缀而通过data_type作为label来区分吗?但是那样的话,pika_exporter暴露的指标的key是否会重复?我不知道这样是否可以。我对grafana的使用并不是很熟悉,望指导。
data_type不作为指标名称的前缀而是作为label的话,对于pika_exporter来说,就是相同的指标(指标名称和labels相同)采集了多条数据(labels value不同),grafana上展示的时候无论是统计total还是统计各data_type的指标,都会方便很多
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.
嗯嗯,这样确实会更方便,我还在修改。
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.
这里目前看只会涉及到pika_exporter的调整,pika部分的代码不影响。也可以先merge,后面交流清楚之后再完善
我还需要学习一下如何在grafana中处理label。我还有其他事项需要处理,我感觉目前先留一个issue后续再处理比较好,这个问题这也不影响这个PR的merge。并且现在也能够查看rocksdb metrics了,只是扩展性没那么优雅。(:
@pourer 您感觉这样处理是否合适?
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.
已经按照这种方式处理了。请帮我再review下。
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.
已经按照这种方式处理了。请帮我再review下。
lgtm @AlexStocks
9abfdee
to
da5edc9
Compare
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.
lgtm
Supplement RocksDB Metrics on pika info command. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Parser RocksDB Metrics on pika exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Add RocksDB metrics in grafana. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Support darwin for pika_exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Add RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Unified data_type. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Capture to err of convertTimeToUnix. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
Add test for RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
da5edc9
to
78fce37
Compare
src/pika_admin.cc
Outdated
void InfoCmd::InfoRocksDB(std::string &info) { | ||
std::stringstream tmp_stream; | ||
|
||
tmp_stream << "# RocksDB" |
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.
这么短的代码没必要拆成两行
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.
fixed
Fix fmt. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
a30abef
to
a41cbc4
Compare
Add the Metrics document link in README, and update the Doc link to wiki. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]>
a41cbc4
to
90da970
Compare
* feat: supplement RocksDB Metrics on pika info command. Supplement RocksDB Metrics on pika info command. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: parser RocksDB Metrics on pika exporter. Parser RocksDB Metrics on pika exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: add RocksDB metrics in grafana. Add RocksDB metrics in grafana. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: support darwin for pika_exporter. Support darwin for pika_exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * docs: add RocksDB metrics. Add RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: unified data_type. Unified data_type. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: capture to err of convertTimeToUnix. Capture to err of convertTimeToUnix. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: add test for RocksDB metrics. Add test for RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: fix fmt. Fix fmt. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * docs: update readme. Add the Metrics document link in README, and update the Doc link to wiki. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> --------- Signed-off-by: yaoyinnan <[email protected]>
* feat: supplement RocksDB Metrics on pika info command. Supplement RocksDB Metrics on pika info command. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: parser RocksDB Metrics on pika exporter. Parser RocksDB Metrics on pika exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: add RocksDB metrics in grafana. Add RocksDB metrics in grafana. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: support darwin for pika_exporter. Support darwin for pika_exporter. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * docs: add RocksDB metrics. Add RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: unified data_type. Unified data_type. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: capture to err of convertTimeToUnix. Capture to err of convertTimeToUnix. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * feat: add test for RocksDB metrics. Add test for RocksDB metrics. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * fix: fix fmt. Fix fmt. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> * docs: update readme. Add the Metrics document link in README, and update the Doc link to wiki. Fixes: OpenAtomFoundation#1559 Signed-off-by: yaoyinnan <[email protected]> --------- Signed-off-by: yaoyinnan <[email protected]>
Supplement RocksDB Metrics.
Fixes: #1559
Fixes:#1386
RocksDB Metrics
note: The order of Number refers to the Properties of RocksDB.
ref: #1549