@@ -207,20 +207,38 @@ impl Encode for () {
207
207
}
208
208
}
209
209
210
+ /// Warning: Using an IP address as a label is only useful when the number of
211
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
212
+ /// combine your metrics into a single metric instead. Especially bad examples
213
+ /// are: storing separate metrics for each client connecting to your public
214
+ /// service or having a large fleet of servers and storing individual binding
215
+ /// addresses.
210
216
impl Encode for Ipv4Addr {
211
217
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
212
218
writer. write_all ( self . to_string ( ) . as_bytes ( ) ) ?;
213
219
Ok ( ( ) )
214
220
}
215
221
}
216
222
223
+ /// Warning: Using an IP address as a label is only useful when the number of
224
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
225
+ /// combine your metrics into a single metric instead. Especially bad examples
226
+ /// are: storing separate metrics for each client connecting to your public
227
+ /// service or having a large fleet of servers and storing individual binding
228
+ /// addresses.
217
229
impl Encode for Ipv6Addr {
218
230
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
219
231
writer. write_all ( self . to_string ( ) . as_bytes ( ) ) ?;
220
232
Ok ( ( ) )
221
233
}
222
234
}
223
235
236
+ /// Warning: Using an IP address as a label is only useful when the number of
237
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
238
+ /// combine your metrics into a single metric instead. Especially bad examples
239
+ /// are: storing separate metrics for each client connecting to your public
240
+ /// service or having a large fleet of servers and storing individual binding
241
+ /// addresses.
224
242
impl Encode for IpAddr {
225
243
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
226
244
match self {
@@ -230,20 +248,38 @@ impl Encode for IpAddr {
230
248
}
231
249
}
232
250
251
+ /// Warning: Using a socket address as a label is only useful when the number of
252
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
253
+ /// combine your metrics into a single metric instead. Especially bad examples
254
+ /// are: storing separate metrics for each client connecting to your public
255
+ /// service or having a large fleet of servers and storing individual binding
256
+ /// addresses.
233
257
impl Encode for SocketAddrV4 {
234
258
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
235
259
writer. write_all ( self . to_string ( ) . as_bytes ( ) ) ?;
236
260
Ok ( ( ) )
237
261
}
238
262
}
239
263
264
+ /// Warning: Using a socket address as a label is only useful when the number of
265
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
266
+ /// combine your metrics into a single metric instead. Especially bad examples
267
+ /// are: storing separate metrics for each client connecting to your public
268
+ /// service or having a large fleet of servers and storing individual binding
269
+ /// addresses.
240
270
impl Encode for SocketAddrV6 {
241
271
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
242
272
writer. write_all ( self . to_string ( ) . as_bytes ( ) ) ?;
243
273
Ok ( ( ) )
244
274
}
245
275
}
246
276
277
+ /// Warning: Using a socket address as a label is only useful when the number of
278
+ /// distinct values is low (i.e. low cardinality). In all other cases you should
279
+ /// combine your metrics into a single metric instead. Especially bad examples
280
+ /// are: storing separate metrics for each client connecting to your public
281
+ /// service or having a large fleet of servers and storing individual binding
282
+ /// addresses.
247
283
impl Encode for SocketAddr {
248
284
fn encode ( & self , writer : & mut dyn Write ) -> Result < ( ) , std:: io:: Error > {
249
285
match self {
0 commit comments