-
Notifications
You must be signed in to change notification settings - Fork 312
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 prometheus for monitor #368
Conversation
已修改的点下resolve标记一下 |
link_libraries()因为是全局的,会干扰其他project的链接,而且link_libraries()有比较奇怪的行为。 综上,这个pr和以后的CMake重构中都要完全避免用link_libraries()这个函数。 |
add perf_counter_enable_prometheus, prometheus_host,prometheus_port to config.ini
perf_counter_enable_prometheus : whether to use prometheus to report data
prometheus_host : the host that pushgateway running
prometheus_port : the port pushgateway use
add _enable_prometheus, _prometheus_host, _prometheus_port to pegasus_counter_reporter.h, receive the data from config.ini
pegasus_counter_reporter.cpp
s_split(): split metrics_names that look like ***:1_0_p999, add app_id, partition_count and percent to metrics_labels SO there can have more classification methods to monitor
update()
if(_enable_prometheus){
change_metrics_name()
prometheus don't accept the format cs.name use, so use the temporary variable metrics_name to hold the right name; change such as "[email protected]_p999" to "collector_app_pegasus_app_stat_multi_put_qps:1_0_p999"
line 245-260
split metrics_name like "collector_app_pegasus_app_stat_multi_put_qps:1_0_p999", then get "app_id = 1","partition_count = 0","percent = p999" as metrics_labels
line 262-270
create metrics that prometheus support to hold data, add data_labels and set data_value
line 274-275
push the metrics to pushgateway
pushgateway can push data to prometheus automatically
}
Configuration updates: