1use lazy_static::lazy_static;
18use prometheus::*;
19
20lazy_static! {
21 pub static ref METRIC_FLOW_TASK_COUNT: IntGauge =
22 register_int_gauge!("greptime_flow_task_count", "flow task count").unwrap();
23 pub static ref METRIC_FLOW_INPUT_BUF_SIZE: IntGauge =
24 register_int_gauge!("greptime_flow_input_buf_size", "flow input buf size").unwrap();
25 pub static ref METRIC_FLOW_INSERT_ELAPSED: HistogramVec = register_histogram_vec!(
26 "greptime_flow_insert_elapsed",
27 "flow insert elapsed",
28 &["table_id"]
29 )
30 .unwrap();
31 pub static ref METRIC_FLOW_BATCHING_ENGINE_QUERY_TIME: HistogramVec = register_histogram_vec!(
32 "greptime_flow_batching_engine_query_time_secs",
33 "flow batching engine query time(seconds)",
34 &["flow_id"],
35 vec![0.0, 5., 10., 20., 40., 80., 160., 320., 640.,]
36 )
37 .unwrap();
38 pub static ref METRIC_FLOW_BATCHING_ENGINE_SLOW_QUERY: HistogramVec = register_histogram_vec!(
39 "greptime_flow_batching_engine_slow_query_secs",
40 "flow batching engine slow query(seconds)",
41 &["flow_id", "sql", "peer"],
42 vec![60., 2. * 60., 3. * 60., 5. * 60., 10. * 60.]
43 )
44 .unwrap();
45 pub static ref METRIC_FLOW_RUN_INTERVAL_MS: IntGauge =
46 register_int_gauge!("greptime_flow_run_interval_ms", "flow run interval in ms").unwrap();
47 pub static ref METRIC_FLOW_ROWS: IntCounterVec = register_int_counter_vec!(
48 "greptime_flow_processed_rows",
49 "Count of rows flowing through the system",
50 &["direction"]
51 )
52 .unwrap();
53 pub static ref METRIC_FLOW_PROCESSING_TIME: HistogramVec = register_histogram_vec!(
54 "greptime_flow_processing_time",
55 "Time spent processing requests",
56 &["type"]
57 )
58 .unwrap();
59 pub static ref METRIC_FLOW_ERRORS: IntCounterVec = register_int_counter_vec!(
60 "greptime_flow_errors",
61 "Count of errors in flow processing",
62 &["code"]
63 )
64 .unwrap();
65}