1use lazy_static::lazy_static;
16use prometheus::*;
17
18lazy_static! {
19 pub static ref DIST_CREATE_TABLE: Histogram = register_histogram!(
20 "greptime_table_operator_create_table",
21 "table operator create table"
22 )
23 .unwrap();
24 pub static ref DIST_CREATE_TABLES: Histogram = register_histogram!(
25 "greptime_table_operator_create_tables",
26 "table operator create table"
27 )
28 .unwrap();
29 pub static ref DIST_ALTER_TABLES: Histogram = register_histogram!(
30 "greptime_table_operator_alter_tables",
31 "table operator alter table"
32 )
33 .unwrap();
34 pub static ref DIST_INGEST_ROW_COUNT: IntCounterVec = register_int_counter_vec!(
35 "greptime_table_operator_ingest_rows",
36 "table operator ingest rows",
37 &["db"]
38 )
39 .unwrap();
40 pub static ref DIST_MIRROR_ROW_COUNT: IntCounter = register_int_counter!(
41 "greptime_table_operator_mirror_rows",
42 "table operator mirror rows"
43 )
44 .unwrap();
45 pub static ref DIST_MIRROR_PENDING_ROW_COUNT: IntGauge = register_int_gauge!(
46 "greptime_table_operator_mirror_pending_rows",
47 "table operator mirror pending rows"
48 )
49 .unwrap();
50 pub static ref DIST_MIRROR_DROPPED_ROW_COUNT: IntCounter = register_int_counter!(
51 "greptime_operator_dist_mirror_dropped_rows",
52 "table operator mirror rows dropped because the pending mirror row limit was exceeded"
53 )
54 .unwrap();
55 pub static ref DIST_DELETE_ROW_COUNT: IntCounterVec = register_int_counter_vec!(
56 "greptime_table_operator_delete_rows",
57 "table operator delete rows",
58 &["db"]
59 )
60 .unwrap();
61 pub static ref DIST_CREATE_VIEW: Histogram = register_histogram!(
62 "greptime_ddl_operator_create_view",
63 "DDL operator create view"
64 )
65 .unwrap();
66 pub static ref CREATE_ALTER_ON_DEMAND: HistogramVec = register_histogram_vec!(
67 "greptime_table_operator_create_alter_on_demand",
68 "table operator duration to create or alter tables on demand",
69 &["table_type"]
70 )
71 .unwrap();
72 pub static ref HANDLE_BULK_INSERT_ELAPSED: HistogramVec = register_histogram_vec!(
73 "greptime_table_operator_handle_bulk_insert",
74 "table operator duration to handle bulk inserts",
75 &["stage"],
76 vec![
77 0.001, 0.005, 0.01, 0.02, 0.03, 0.04, 0.05, 0.10, 0.15, 0.2, 0.3, 0.4, 0.5, 1.0, 1.5,
78 2.0, 2.5, 3.0, 4.0, 5.0
79 ]
80 )
81 .unwrap();
82 pub static ref BULK_REQUEST_MESSAGE_SIZE: Histogram = register_histogram!(
83 "greptime_table_operator_bulk_insert_message_size",
84 "table operator bulk inserts message encoded size",
85 vec![
86 32768.0,
87 65536.0,
88 131072.0,
89 262144.0,
90 524288.0,
91 1048576.0,
92 2097152.0,
93 4194304.0,
94 8388608.0,
95 16777216.0,
96 33554432.0,
97 67108864.0,
98 134217728.0,
99 268435456.0
100 ]
101 )
102 .unwrap();
103 pub static ref BULK_REQUEST_ROWS: HistogramVec = register_histogram_vec!(
104 "greptime_table_operator_bulk_insert_message_rows",
105 "table operator bulk inserts message rows",
106 &["type"],
107 exponential_buckets(10.0, 10.0, 5).unwrap()
109 )
110 .unwrap();
111}