3
3
// Grpc server metrics
4
4
5
5
use lazy_static:: lazy_static;
6
- use prometheus:: { exponential_buckets, register_histogram_vec, HistogramVec } ;
6
+ use prometheus:: {
7
+ exponential_buckets, register_histogram_vec, register_int_counter_vec, HistogramVec ,
8
+ IntCounterVec ,
9
+ } ;
7
10
use prometheus_static_metric:: { auto_flush_from, make_auto_flush_static_metric} ;
8
11
9
12
// Register auto flush static metrics.
@@ -32,6 +35,14 @@ make_auto_flush_static_metric! {
32
35
"type" => RemoteEngineTypeKind ,
33
36
}
34
37
38
+ pub label_enum RemoteEngineGrpcTypeKind {
39
+ write_failed,
40
+ }
41
+
42
+ pub struct RemoteEngineGrpcHandlerCounterVec : LocalIntCounter {
43
+ "type" => RemoteEngineGrpcTypeKind ,
44
+ }
45
+
35
46
pub label_enum MetaEventTypeKind {
36
47
open_shard,
37
48
close_shard,
@@ -64,6 +75,13 @@ lazy_static! {
64
75
exponential_buckets( 0.0005 , 2.0 , 20 ) . unwrap( )
65
76
)
66
77
. unwrap( ) ;
78
+ pub static ref REMOTE_ENGINE_GRPC_HANDLER_COUNTER_VEC_GLOBAL : IntCounterVec =
79
+ register_int_counter_vec!(
80
+ "remote_engine_grpc_handler_counter" ,
81
+ "Remote engine grpc handler counter" ,
82
+ & [ "type" ]
83
+ )
84
+ . unwrap( ) ;
67
85
pub static ref META_EVENT_GRPC_HANDLER_DURATION_HISTOGRAM_VEC_GLOBAL : HistogramVec =
68
86
register_histogram_vec!(
69
87
"meta_event_grpc_handler_duration" ,
@@ -84,6 +102,10 @@ lazy_static! {
84
102
REMOTE_ENGINE_GRPC_HANDLER_DURATION_HISTOGRAM_VEC_GLOBAL ,
85
103
RemoteEngineGrpcHandlerDurationHistogramVec
86
104
) ;
105
+ pub static ref REMOTE_ENGINE_GRPC_HANDLER_COUNTER_VEC : RemoteEngineGrpcHandlerCounterVec = auto_flush_from!(
106
+ REMOTE_ENGINE_GRPC_HANDLER_COUNTER_VEC_GLOBAL ,
107
+ RemoteEngineGrpcHandlerCounterVec
108
+ ) ;
87
109
pub static ref META_EVENT_GRPC_HANDLER_DURATION_HISTOGRAM_VEC : MetaEventGrpcHandlerDurationHistogramVec = auto_flush_from!(
88
110
META_EVENT_GRPC_HANDLER_DURATION_HISTOGRAM_VEC_GLOBAL ,
89
111
MetaEventGrpcHandlerDurationHistogramVec
0 commit comments