use lazy_static::lazy_static;
use prometheus::*;
lazy_static! {
pub static ref METRIC_META_KV_REQUEST_ELAPSED: HistogramVec = register_histogram_vec!(
"greptime_meta_kv_request_elapsed",
"meta kv request",
&["target", "op"]
)
.unwrap();
pub static ref METRIC_META_HEARTBEAT_CONNECTION_NUM: IntGauge = register_int_gauge!(
"greptime_meta_heartbeat_connection_num",
"meta heartbeat connection num"
)
.unwrap();
pub static ref METRIC_META_HANDLER_EXECUTE: HistogramVec =
register_histogram_vec!("greptime_meta_handler_execute", "meta handler execute", &["name"]).unwrap();
pub static ref METRIC_META_INACTIVE_REGIONS: IntGauge =
register_int_gauge!("greptime_meta_inactive_regions", "meta inactive regions").unwrap();
pub static ref METRIC_META_LEADER_CACHED_KV_LOAD_ELAPSED: HistogramVec =
register_histogram_vec!("greptime_meta_leader_cache_kv_load", "meta load cache", &["prefix"])
.unwrap();
pub static ref METRIC_META_KV_CACHE_HIT: IntCounterVec =
register_int_counter_vec!("greptime_meta_kv_cache_hit", "meta kv cache hit", &["op"]).unwrap();
pub static ref METRIC_META_KV_CACHE_MISS: IntCounterVec =
register_int_counter_vec!("greptime_meta_kv_cache_miss", "meta kv cache miss", &["op"]).unwrap();
pub static ref METRIC_META_HEARTBEAT_RECV: IntCounterVec =
register_int_counter_vec!("greptime_meta_heartbeat_recv", "heartbeats received by metasrv", &["pusher_key"]).unwrap();
pub static ref METRIC_META_REGION_MIGRATION_EXECUTE: HistogramVec =
register_histogram_vec!("greptime_meta_region_migration_execute", "meta region migration execute", &["state"]).unwrap();
pub static ref METRIC_META_REGION_MIGRATION_ERROR: IntCounterVec =
register_int_counter_vec!("greptime_meta_region_migration_error", "meta region migration abort", &["state", "error_type"]).unwrap();
pub static ref METRIC_META_REGION_MIGRATION_DATANODES: IntCounterVec =
register_int_counter_vec!("greptime_meta_region_migration_stat", "meta region migration stat", &["datanode_type", "datanode_id"]).unwrap();
pub static ref METRIC_META_REGION_MIGRATION_FAIL: IntCounter =
register_int_counter!("greptime_meta_region_migration_fail", "meta region migration fail").unwrap();
pub static ref METRIC_META_ADD_REGION_FOLLOWER_EXECUTE: HistogramVec =
register_histogram_vec!("greptime_meta_add_region_follower_execute", "meta add region follower execute", &["state"]).unwrap();
pub static ref METRIC_META_REMOVE_REGION_FOLLOWER_EXECUTE: HistogramVec =
register_histogram_vec!("greptime_meta_remove_region_follower_execute", "meta remove region follower execute", &["state"]).unwrap();
}