@@ -108,10 +108,13 @@ test('mix internal and NR span tests', (t, end) => {
108
108
helper . runInTransaction ( agent , ( tx ) => {
109
109
tx . name = 'otel-example-tx'
110
110
tracer . startActiveSpan ( 'main' , ( span ) => {
111
+ span . setAttribute ( 'custom-key' , 'custom-value' )
111
112
const segment = agent . tracer . getSegment ( )
112
113
assert . equal ( tx . traceId , span . spanContext ( ) . traceId )
113
114
main ( segment , tx )
114
115
span . end ( )
116
+ const attrs = segment . getAttributes ( )
117
+ assert . equal ( attrs [ 'custom-key' ] , 'custom-value' )
115
118
assert . equal ( span [ otelSynthesis ] , undefined )
116
119
assert . equal ( segment . name , span . name )
117
120
assert . equal ( segment . parentId , tx . trace . root . id )
@@ -128,13 +131,13 @@ test('mix internal and NR span tests', (t, end) => {
128
131
]
129
132
} )
130
133
const metrics = tx . metrics . scoped [ tx . name ]
131
- assert . equal ( metrics [ 'Custom/ main' ] . callCount , 1 )
132
- assert . equal ( metrics [ 'Custom/ hi' ] . callCount , 1 )
133
- assert . equal ( metrics [ 'Custom/ bye' ] . callCount , 1 )
134
+ assert . equal ( metrics [ 'main' ] . callCount , 1 )
135
+ assert . equal ( metrics [ 'hi' ] . callCount , 1 )
136
+ assert . equal ( metrics [ 'bye' ] . callCount , 1 )
134
137
const unscopedMetrics = tx . metrics . unscoped
135
- assert . equal ( unscopedMetrics [ 'Custom/ main' ] . callCount , 1 )
136
- assert . equal ( unscopedMetrics [ 'Custom/ hi' ] . callCount , 1 )
137
- assert . equal ( unscopedMetrics [ 'Custom/ bye' ] . callCount , 1 )
138
+ assert . equal ( unscopedMetrics [ 'main' ] . callCount , 1 )
139
+ assert . equal ( unscopedMetrics [ 'hi' ] . callCount , 1 )
140
+ assert . equal ( unscopedMetrics [ 'bye' ] . callCount , 1 )
138
141
end ( )
139
142
} )
140
143
} )
0 commit comments