File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,11 @@ function _createWrappedRequestMethodFactory(
172
172
`[Tracing] Not adding sentry-trace header to outgoing request (${ requestUrl } ) due to mismatching tracePropagationTargets option.` ,
173
173
) ;
174
174
}
175
+
176
+ const transaction = parentSpan . transaction ;
177
+ if ( transaction ) {
178
+ transaction . metadata . propagations += 1 ;
179
+ }
175
180
}
176
181
}
177
182
Original file line number Diff line number Diff line change @@ -172,6 +172,20 @@ describe('tracing', () => {
172
172
expect ( baggage ) . not . toBeDefined ( ) ;
173
173
} ) ;
174
174
175
+ it ( 'records outgoing propagations on the transaction' , ( ) => {
176
+ nock ( 'http://dogs.are.great' ) . get ( '/' ) . reply ( 200 ) ;
177
+
178
+ const transaction = createTransactionOnScope ( ) ;
179
+
180
+ expect ( transaction . metadata . propagations ) . toBe ( 0 ) ;
181
+
182
+ http . get ( 'http://dogs.are.great/' ) ;
183
+ expect ( transaction . metadata . propagations ) . toBe ( 1 ) ;
184
+
185
+ http . get ( 'http://dogs.are.great/' ) ;
186
+ expect ( transaction . metadata . propagations ) . toBe ( 2 ) ;
187
+ } ) ;
188
+
175
189
describe ( 'tracePropagationTargets option' , ( ) => {
176
190
beforeEach ( ( ) => {
177
191
// hacky way of restoring monkey patched functions
You can’t perform that action at this time.
0 commit comments