5
5
6
6
using System . Collections . Generic ;
7
7
using System . Diagnostics ;
8
+ using Elastic . Apm . Api ;
8
9
using Elastic . Apm . Tests . Utilities ;
9
10
using FluentAssertions ;
10
11
using Xunit ;
@@ -41,14 +42,15 @@ public void CaptureBaggageWithDefaultConfig()
41
42
RunSample ( agent ) ;
42
43
43
44
payloadSender . FirstTransaction . Should ( ) . NotBeNull ( ) ;
44
- payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "foo" , "bar" ) ) ;
45
+ payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "baggage. foo" , "bar" ) ) ;
45
46
46
47
payloadSender . FirstSpan . Should ( ) . NotBeNull ( ) ;
47
- payloadSender . FirstSpan . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "foo" , "bar" ) ) ;
48
+ payloadSender . FirstSpan . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "baggage.foo" , "bar" ) ) ;
49
+ payloadSender . FirstSpan . Otel . Attributes . Should ( ) . NotContain ( new KeyValuePair < string , object > ( "foo" , "bar" ) ) ;
48
50
49
51
payloadSender . FirstError . Should ( ) . NotBeNull ( ) ;
50
52
payloadSender . FirstError . Context . InternalLabels . Should ( ) . NotBeNull ( ) ;
51
- payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . Contain ( new KeyValuePair < string , string > ( "foo" , "bar" ) ) ;
53
+ payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . Contain ( new KeyValuePair < string , string > ( "baggage. foo" , "bar" ) ) ;
52
54
}
53
55
54
56
/// <summary>
@@ -66,17 +68,21 @@ public void CaptureBaggageWithNonDefaultConfig()
66
68
RunSample ( agent ) ;
67
69
68
70
payloadSender . FirstTransaction . Should ( ) . NotBeNull ( ) ;
69
- payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "foo" , "bar" ) ) ;
71
+ payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "baggage. foo" , "bar" ) ) ;
70
72
payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . NotContainKey ( "key1" ) ;
73
+ payloadSender . FirstTransaction . Otel . Attributes . Should ( ) . NotContainKey ( "baggage.key1" ) ;
71
74
72
75
payloadSender . FirstSpan . Should ( ) . NotBeNull ( ) ;
73
- payloadSender . FirstSpan . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "foo" , "bar" ) ) ;
76
+ payloadSender . FirstSpan . Otel . Attributes . Should ( ) . Contain ( new KeyValuePair < string , object > ( "baggage. foo" , "bar" ) ) ;
74
77
payloadSender . FirstSpan . Otel . Attributes . Should ( ) . NotContainKey ( "key1" ) ;
78
+ payloadSender . FirstSpan . Otel . Attributes . Should ( ) . NotContainKey ( "baggage.key1" ) ;
75
79
76
80
payloadSender . FirstError . Should ( ) . NotBeNull ( ) ;
77
81
payloadSender . FirstError . Context . InternalLabels . Should ( ) . NotBeNull ( ) ;
78
- payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . Contain ( new KeyValuePair < string , string > ( "foo" , "bar" ) ) ;
82
+ payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . Contain ( new KeyValuePair < string , string > ( "baggage. foo" , "bar" ) ) ;
79
83
payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . NotContainKey ( "key1" ) ;
84
+ payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . NotContainKey ( "foo" ) ;
85
+ payloadSender . FirstError . Context . InternalLabels . Value . Should ( ) . NotContainKey ( "baggage.key1" ) ;
80
86
}
81
87
82
88
private void RunSample ( ApmAgent agent )
0 commit comments