@@ -142,9 +142,6 @@ pub enum Direction {
142142 Out ,
143143}
144144
145- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
146- struct Authority < ' a > ( & ' a http:: uri:: Authority ) ;
147-
148145pub fn prefix_labels < ' i , I > ( prefix : & str , mut labels_iter : I ) -> Option < String >
149146where
150147 I : Iterator < Item = ( & ' i String , & ' i String ) > ,
@@ -158,6 +155,23 @@ where
158155 Some ( out)
159156}
160157
158+ pub fn prefix_outbound_endpoint_labels < ' i , I > ( prefix : & str , mut labels_iter : I ) -> Option < String >
159+ where
160+ I : Iterator < Item = ( & ' i String , & ' i String ) > ,
161+ {
162+ let ( k0, v0) = labels_iter. next ( ) ?;
163+ let mut out = format ! ( "{}_{}=\" {}\" " , prefix, k0, v0) ;
164+
165+ for ( k, v) in labels_iter {
166+ if k == "pod" || k == "pod_template_hash" {
167+ continue ;
168+ }
169+
170+ write ! ( out, ",{}_{}=\" {}\" " , prefix, k, v) . expect ( "label concat must succeed" ) ;
171+ }
172+ Some ( out)
173+ }
174+
161175// === impl Metrics ===
162176
163177impl Metrics {
@@ -420,12 +434,6 @@ impl FmtLabels for Direction {
420434 }
421435}
422436
423- impl FmtLabels for Authority < ' _ > {
424- fn fmt_labels ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
425- write ! ( f, "authority=\" {}\" " , self . 0 )
426- }
427- }
428-
429437impl FmtLabels for Class {
430438 fn fmt_labels ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
431439 let class = |ok : bool | if ok { "success" } else { "failure" } ;
0 commit comments