@@ -30,40 +30,47 @@ pub const METRICS_NAMESPACE: &str = env!("CARGO_PKG_NAME");
30
30
31
31
pub static EVENTS_INGESTED : Lazy < IntGaugeVec > = Lazy :: new ( || {
32
32
IntGaugeVec :: new (
33
- Opts :: new ( "events_ingested" , "Events ingested" ) . namespace ( METRICS_NAMESPACE ) ,
33
+ Opts :: new ( "events_ingested" , "Events ingested for a stream " ) . namespace ( METRICS_NAMESPACE ) ,
34
34
& [ "stream" , "format" ] ,
35
35
)
36
36
. expect ( "metric can be created" )
37
37
} ) ;
38
38
39
39
pub static EVENTS_INGESTED_SIZE : Lazy < IntGaugeVec > = Lazy :: new ( || {
40
40
IntGaugeVec :: new (
41
- Opts :: new ( "events_ingested_size" , "Events ingested size bytes" )
42
- . namespace ( METRICS_NAMESPACE ) ,
41
+ Opts :: new (
42
+ "events_ingested_size" ,
43
+ "Events ingested size bytes for a stream" ,
44
+ )
45
+ . namespace ( METRICS_NAMESPACE ) ,
43
46
& [ "stream" , "format" ] ,
44
47
)
45
48
. expect ( "metric can be created" )
46
49
} ) ;
47
50
48
51
pub static STORAGE_SIZE : Lazy < IntGaugeVec > = Lazy :: new ( || {
49
52
IntGaugeVec :: new (
50
- Opts :: new ( "storage_size" , "Storage size bytes" ) . namespace ( METRICS_NAMESPACE ) ,
53
+ Opts :: new ( "storage_size" , "Storage size bytes for a stream " ) . namespace ( METRICS_NAMESPACE ) ,
51
54
& [ "type" , "stream" , "format" ] ,
52
55
)
53
56
. expect ( "metric can be created" )
54
57
} ) ;
55
58
56
59
pub static EVENTS_DELETED : Lazy < IntGaugeVec > = Lazy :: new ( || {
57
60
IntGaugeVec :: new (
58
- Opts :: new ( "events_deleted" , "Events deleted" ) . namespace ( METRICS_NAMESPACE ) ,
61
+ Opts :: new ( "events_deleted" , "Events deleted for a stream " ) . namespace ( METRICS_NAMESPACE ) ,
59
62
& [ "stream" , "format" ] ,
60
63
)
61
64
. expect ( "metric can be created" )
62
65
} ) ;
63
66
64
67
pub static EVENTS_DELETED_SIZE : Lazy < IntGaugeVec > = Lazy :: new ( || {
65
68
IntGaugeVec :: new (
66
- Opts :: new ( "events_deleted_size" , "Events deleted size bytes" ) . namespace ( METRICS_NAMESPACE ) ,
69
+ Opts :: new (
70
+ "events_deleted_size" ,
71
+ "Events deleted size bytes for a stream" ,
72
+ )
73
+ . namespace ( METRICS_NAMESPACE ) ,
67
74
& [ "stream" , "format" ] ,
68
75
)
69
76
. expect ( "metric can be created" )
@@ -73,7 +80,7 @@ pub static DELETED_EVENTS_STORAGE_SIZE: Lazy<IntGaugeVec> = Lazy::new(|| {
73
80
IntGaugeVec :: new (
74
81
Opts :: new (
75
82
"deleted_events_storage_size" ,
76
- "Deleted events storage size bytes" ,
83
+ "Deleted events storage size bytes for a stream " ,
77
84
)
78
85
. namespace ( METRICS_NAMESPACE ) ,
79
86
& [ "type" , "stream" , "format" ] ,
@@ -83,8 +90,11 @@ pub static DELETED_EVENTS_STORAGE_SIZE: Lazy<IntGaugeVec> = Lazy::new(|| {
83
90
84
91
pub static LIFETIME_EVENTS_INGESTED : Lazy < IntGaugeVec > = Lazy :: new ( || {
85
92
IntGaugeVec :: new (
86
- Opts :: new ( "lifetime_events_ingested" , "Lifetime events ingested" )
87
- . namespace ( METRICS_NAMESPACE ) ,
93
+ Opts :: new (
94
+ "lifetime_events_ingested" ,
95
+ "Lifetime events ingested for a stream" ,
96
+ )
97
+ . namespace ( METRICS_NAMESPACE ) ,
88
98
& [ "stream" , "format" ] ,
89
99
)
90
100
. expect ( "metric can be created" )
@@ -94,7 +104,7 @@ pub static LIFETIME_EVENTS_INGESTED_SIZE: Lazy<IntGaugeVec> = Lazy::new(|| {
94
104
IntGaugeVec :: new (
95
105
Opts :: new (
96
106
"lifetime_events_ingested_size" ,
97
- "Lifetime events ingested size bytes" ,
107
+ "Lifetime events ingested size bytes for a stream " ,
98
108
)
99
109
. namespace ( METRICS_NAMESPACE ) ,
100
110
& [ "stream" , "format" ] ,
@@ -106,50 +116,86 @@ pub static LIFETIME_EVENTS_STORAGE_SIZE: Lazy<IntGaugeVec> = Lazy::new(|| {
106
116
IntGaugeVec :: new (
107
117
Opts :: new (
108
118
"lifetime_events_storage_size" ,
109
- "Lifetime events storage size bytes" ,
119
+ "Lifetime events storage size bytes for a stream " ,
110
120
)
111
121
. namespace ( METRICS_NAMESPACE ) ,
112
122
& [ "type" , "stream" , "format" ] ,
113
123
)
114
124
. expect ( "metric can be created" )
115
125
} ) ;
116
126
117
- pub static EVENTS_INGESTED_DATE : Lazy < IntGaugeVec > = Lazy :: new ( || {
118
- IntGaugeVec :: new (
127
+ pub static EVENTS_INGESTED_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
128
+ IntCounterVec :: new (
119
129
Opts :: new (
120
130
"events_ingested_date" ,
121
- "Events ingested on a particular date" ,
131
+ "Events ingested for a stream on a particular date" ,
122
132
)
123
133
. namespace ( METRICS_NAMESPACE ) ,
124
134
& [ "stream" , "format" , "date" ] ,
125
135
)
126
136
. expect ( "metric can be created" )
127
137
} ) ;
128
138
129
- pub static EVENTS_INGESTED_SIZE_DATE : Lazy < IntGaugeVec > = Lazy :: new ( || {
130
- IntGaugeVec :: new (
139
+ pub static EVENTS_INGESTED_SIZE_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
140
+ IntCounterVec :: new (
131
141
Opts :: new (
132
142
"events_ingested_size_date" ,
133
- "Events ingested size in bytes on a particular date" ,
143
+ "Events ingested size in bytes for a stream on a particular date" ,
134
144
)
135
145
. namespace ( METRICS_NAMESPACE ) ,
136
146
& [ "stream" , "format" , "date" ] ,
137
147
)
138
148
. expect ( "metric can be created" )
139
149
} ) ;
140
150
141
- pub static EVENTS_STORAGE_SIZE_DATE : Lazy < IntGaugeVec > = Lazy :: new ( || {
142
- IntGaugeVec :: new (
151
+ pub static EVENTS_STORAGE_SIZE_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
152
+ IntCounterVec :: new (
143
153
Opts :: new (
144
154
"events_storage_size_date" ,
145
- "Events storage size in bytes on a particular date" ,
155
+ "Events storage size in bytes for a stream on a particular date" ,
146
156
)
147
157
. namespace ( METRICS_NAMESPACE ) ,
148
158
& [ "type" , "stream" , "format" , "date" ] ,
149
159
)
150
160
. expect ( "metric can be created" )
151
161
} ) ;
152
162
163
+ pub static TOTAL_EVENTS_INGESTED_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
164
+ IntCounterVec :: new (
165
+ Opts :: new (
166
+ "total_events_ingested_date" ,
167
+ "total events ingested on a particular date" ,
168
+ )
169
+ . namespace ( METRICS_NAMESPACE ) ,
170
+ & [ "format" , "date" ] ,
171
+ )
172
+ . expect ( "metric can be created" )
173
+ } ) ;
174
+
175
+ pub static TOTAL_EVENTS_INGESTED_SIZE_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
176
+ IntCounterVec :: new (
177
+ Opts :: new (
178
+ "total_events_ingested_size_date" ,
179
+ "Total events ingested size in bytes on a particular date" ,
180
+ )
181
+ . namespace ( METRICS_NAMESPACE ) ,
182
+ & [ "format" , "date" ] ,
183
+ )
184
+ . expect ( "metric can be created" )
185
+ } ) ;
186
+
187
+ pub static TOTAL_EVENTS_STORAGE_SIZE_DATE : Lazy < IntCounterVec > = Lazy :: new ( || {
188
+ IntCounterVec :: new (
189
+ Opts :: new (
190
+ "total_events_storage_size_date" ,
191
+ "Total events storage size in bytes on a particular date" ,
192
+ )
193
+ . namespace ( METRICS_NAMESPACE ) ,
194
+ & [ "format" , "date" ] ,
195
+ )
196
+ . expect ( "metric can be created" )
197
+ } ) ;
198
+
153
199
pub static STAGING_FILES : Lazy < IntGaugeVec > = Lazy :: new ( || {
154
200
IntGaugeVec :: new (
155
201
Opts :: new ( "staging_files" , "Active Staging files" ) . namespace ( METRICS_NAMESPACE ) ,
@@ -219,6 +265,15 @@ fn custom_metrics(registry: &Registry) {
219
265
registry
220
266
. register ( Box :: new ( EVENTS_STORAGE_SIZE_DATE . clone ( ) ) )
221
267
. expect ( "metric can be registered" ) ;
268
+ registry
269
+ . register ( Box :: new ( TOTAL_EVENTS_INGESTED_DATE . clone ( ) ) )
270
+ . expect ( "metric can be registered" ) ;
271
+ registry
272
+ . register ( Box :: new ( TOTAL_EVENTS_INGESTED_SIZE_DATE . clone ( ) ) )
273
+ . expect ( "metric can be registered" ) ;
274
+ registry
275
+ . register ( Box :: new ( TOTAL_EVENTS_STORAGE_SIZE_DATE . clone ( ) ) )
276
+ . expect ( "metric can be registered" ) ;
222
277
registry
223
278
. register ( Box :: new ( STAGING_FILES . clone ( ) ) )
224
279
. expect ( "metric can be registered" ) ;
0 commit comments