File tree 1 file changed +13
-0
lines changed
packages/opentelemetry-exporter-jaeger/test
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { ReadableSpan } from '@opentelemetry/tracing';
23
23
import { ExportResult } from '@opentelemetry/base' ;
24
24
import { TraceFlags } from '@opentelemetry/api' ;
25
25
import { Resource } from '@opentelemetry/resources' ;
26
+ import { OT_REQUEST_HEADER } from '../src/utils' ;
26
27
27
28
describe ( 'JaegerExporter' , ( ) => {
28
29
describe ( 'constructor' , ( ) => {
@@ -150,5 +151,17 @@ describe('JaegerExporter', () => {
150
151
assert . strictEqual ( result , ExportResult . SUCCESS ) ;
151
152
} ) ;
152
153
} ) ;
154
+
155
+ it ( 'should use httpSender if config.endpoint is setten and set x-opentelemetry-outgoing-request header' , ( ) => {
156
+ const exporter = new JaegerExporter ( {
157
+ serviceName : 'opentelemetry' ,
158
+ endpoint : 'http://testendpoint' ,
159
+ } ) ;
160
+ assert . strictEqual ( exporter [ '_sender' ] . constructor . name , 'HTTPSender' ) ;
161
+ assert . strictEqual (
162
+ exporter [ '_sender' ] . _httpOptions . headers [ OT_REQUEST_HEADER ] ,
163
+ 1
164
+ ) ;
165
+ } ) ;
153
166
} ) ;
154
167
} ) ;
You can’t perform that action at this time.
0 commit comments