File tree 2 files changed +10
-0
lines changed
packages/opentelemetry-plugin-xml-http-request
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ export class XMLHttpRequestPlugin extends BasePlugin<XMLHttpRequest> {
316
316
}
317
317
318
318
const currentSpan = this . _tracer . startSpan ( url , {
319
+ kind : api . SpanKind . CLIENT ,
319
320
attributes : {
320
321
[ AttributeNames . COMPONENT ] : this . component ,
321
322
[ AttributeNames . HTTP_METHOD ] : method ,
Original file line number Diff line number Diff line change @@ -210,6 +210,15 @@ describe('xhr', () => {
210
210
assert . strictEqual ( span . name , url , 'span has wrong name' ) ;
211
211
} ) ;
212
212
213
+ it ( 'span should have correct kind' , ( ) => {
214
+ const span : tracing . ReadableSpan = exportSpy . args [ 0 ] [ 0 ] [ 0 ] ;
215
+ assert . strictEqual (
216
+ span . kind ,
217
+ types . SpanKind . CLIENT ,
218
+ 'span has wrong kind'
219
+ ) ;
220
+ } ) ;
221
+
213
222
it ( 'span should have correct attributes' , ( ) => {
214
223
const span : tracing . ReadableSpan = exportSpy . args [ 0 ] [ 0 ] [ 0 ] ;
215
224
const attributes = span . attributes ;
You can’t perform that action at this time.
0 commit comments