Skip to content

Commit e7eb7d1

Browse files
committed
fix experimental stuff
1 parent 34413ce commit e7eb7d1

File tree

1 file changed

+8
-0
lines changed
  • opentelemetry-appender-tracing/src

1 file changed

+8
-0
lines changed

opentelemetry-appender-tracing/src/layer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)