File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
opentelemetry-appender-tracing/src Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ impl<LR: LogRecord> tracing::field::Visit for EventVisitor<'_, LR> {
115115 }
116116
117117 fn record_u64 ( & mut self , field : & tracing:: field:: Field , value : u64 ) {
118+ #[ cfg( feature = "experimental_metadata_attributes" ) ]
119+ if is_duplicated_metadata ( field. name ( ) ) {
120+ return ;
121+ }
118122 match i64:: try_from ( value) {
119123 Ok ( signed) => {
120124 self . log_record
@@ -790,6 +794,10 @@ mod tests {
790794 TraceFlags :: SAMPLED
791795 ) ;
792796
797+ for attribute in log. record . attributes_iter ( ) {
798+ println ! ( "key: {:?}, value: {:?}" , attribute. 0 , attribute. 1 ) ;
799+ }
800+
793801 // Attributes can be polluted when we don't use this feature.
794802 #[ cfg( feature = "experimental_metadata_attributes" ) ]
795803 assert_eq ! ( log. record. attributes_iter( ) . count( ) , 4 ) ;
You can’t perform that action at this time.
0 commit comments