@@ -169,7 +169,6 @@ where
169
169
log_record. set_event_name ( meta. name ( ) ) ;
170
170
log_record. set_severity_number ( severity_of_level ( meta. level ( ) ) ) ;
171
171
log_record. set_severity_text ( meta. level ( ) . to_string ( ) . into ( ) ) ;
172
- #[ cfg( feature = "experimental_metadata_attributes" ) ]
173
172
let mut visitor = EventVisitor :: new ( & mut log_record) ;
174
173
#[ cfg( feature = "experimental_metadata_attributes" ) ]
175
174
visitor. visit_experimental_metadata ( meta) ;
@@ -259,10 +258,9 @@ mod tests {
259
258
. clone ( )
260
259
. expect ( "Attributes are expected" ) ;
261
260
#[ cfg( not( feature = "experimental_metadata_attributes" ) ) ]
262
- assert_eq ! ( attributes. len( ) , 4 ) ;
261
+ assert_eq ! ( attributes. len( ) , 3 ) ;
263
262
#[ cfg( feature = "experimental_metadata_attributes" ) ]
264
- assert_eq ! ( attributes. len( ) , 9 ) ;
265
- assert ! ( attributes. contains( & ( Key :: new( "name" ) , "my-event-name" . into( ) ) ) ) ;
263
+ assert_eq ! ( attributes. len( ) , 8 ) ;
266
264
assert ! ( attributes. contains( & ( Key :: new( "event_id" ) , 20 . into( ) ) ) ) ;
267
265
assert ! ( attributes. contains( & ( Key :: new( "user_name" ) , "otel" . into( ) ) ) ) ;
268
266
assert ! ( attributes. contains( & ( Key :: new( "user_email" ) , "otel@opentelemetry.io" . into( ) ) ) ) ;
@@ -356,10 +354,9 @@ mod tests {
356
354
. clone ( )
357
355
. expect ( "Attributes are expected" ) ;
358
356
#[ cfg( not( feature = "experimental_metadata_attributes" ) ) ]
359
- assert_eq ! ( attributes. len( ) , 4 ) ;
357
+ assert_eq ! ( attributes. len( ) , 3 ) ;
360
358
#[ cfg( feature = "experimental_metadata_attributes" ) ]
361
- assert_eq ! ( attributes. len( ) , 9 ) ;
362
- assert ! ( attributes. contains( & ( Key :: new( "name" ) , "my-event-name" . into( ) ) ) ) ;
359
+ assert_eq ! ( attributes. len( ) , 8 ) ;
363
360
assert ! ( attributes. contains( & ( Key :: new( "event_id" ) , 20 . into( ) ) ) ) ;
364
361
assert ! ( attributes. contains( & ( Key :: new( "user_name" ) , "otel" . into( ) ) ) ) ;
365
362
assert ! ( attributes. contains( & ( Key :: new( "user_email" ) , "otel@opentelemetry.io" . into( ) ) ) ) ;
@@ -417,6 +414,7 @@ mod tests {
417
414
assert ! ( log. record. trace_context. is_none( ) ) ;
418
415
419
416
// Validate attributes
417
+ #[ cfg( feature = "experimental_metadata_attributes" ) ]
420
418
let attributes: Vec < ( Key , AnyValue ) > = log
421
419
. record
422
420
. attributes
@@ -425,9 +423,7 @@ mod tests {
425
423
426
424
// Attributes can be polluted when we don't use this feature.
427
425
#[ cfg( feature = "experimental_metadata_attributes" ) ]
428
- assert_eq ! ( attributes. len( ) , 6 ) ;
429
-
430
- assert ! ( attributes. contains( & ( Key :: new( "name" ) , "log event" . into( ) ) ) ) ;
426
+ assert_eq ! ( attributes. len( ) , 5 ) ;
431
427
432
428
#[ cfg( feature = "experimental_metadata_attributes" ) ]
433
429
{
@@ -514,6 +510,7 @@ mod tests {
514
510
) ;
515
511
516
512
// validate attributes.
513
+ #[ cfg( feature = "experimental_metadata_attributes" ) ]
517
514
let attributes: Vec < ( Key , AnyValue ) > = log
518
515
. record
519
516
. attributes
@@ -522,9 +519,7 @@ mod tests {
522
519
523
520
// Attributes can be polluted when we don't use this feature.
524
521
#[ cfg( feature = "experimental_metadata_attributes" ) ]
525
- assert_eq ! ( attributes. len( ) , 6 ) ;
526
-
527
- assert ! ( attributes. contains( & ( Key :: new( "name" ) , "log event" . into( ) ) ) ) ;
522
+ assert_eq ! ( attributes. len( ) , 5 ) ;
528
523
529
524
#[ cfg( feature = "experimental_metadata_attributes" ) ]
530
525
{
0 commit comments