Skip to content

Commit

Permalink
test(opentelemetry-exporter-jaeger): verify http sender usage
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardodalcin committed Apr 17, 2020
1 parent 256eb0e commit 2ef75b5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ReadableSpan } from '@opentelemetry/tracing';
import { ExportResult } from '@opentelemetry/base';
import { TraceFlags } from '@opentelemetry/api';
import { Resource } from '@opentelemetry/resources';
import { OT_REQUEST_HEADER } from '../src/utils';

describe('JaegerExporter', () => {
describe('constructor', () => {
Expand Down Expand Up @@ -150,5 +151,17 @@ describe('JaegerExporter', () => {
assert.strictEqual(result, ExportResult.SUCCESS);
});
});

it('should use httpSender if config.endpoint is setten and set x-opentelemetry-outgoing-request header', () => {
const exporter = new JaegerExporter({
serviceName: 'opentelemetry',
endpoint: 'http://testendpoint',
});
assert.strictEqual(exporter['_sender'].constructor.name, 'HTTPSender');
assert.strictEqual(
exporter['_sender']._httpOptions.headers[OT_REQUEST_HEADER],
1
);
});
});
});

0 comments on commit 2ef75b5

Please sign in to comment.