Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardodalcin committed Jun 3, 2020
1 parent 2c75792 commit d284387
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions packages/opentelemetry-exporter-jaeger/src/jaeger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,32 @@ export class JaegerExporter implements SpanExporter {
private readonly _onShutdownFlushTimeout: number;

constructor(config: jaegerTypes.ExporterConfig) {
const localConfig = Object.assign({}, config)
const localConfig = Object.assign({}, config);
this._logger = localConfig.logger || new NoopLogger();
const tags: jaegerTypes.Tag[] = localConfig.tags || [];
this._onShutdownFlushTimeout =
typeof localConfig.flushTimeout === 'number' ? localConfig.flushTimeout : 2000;
typeof localConfig.flushTimeout === 'number'
? localConfig.flushTimeout
: 2000;

// https://github.com/jaegertracing/jaeger-client-node#environment-variables
// By default, the client sends traces via UDP to the agent at localhost:6832. Use JAEGER_AGENT_HOST and
// JAEGER_AGENT_PORT to send UDP traces to a different host:port. If JAEGER_ENDPOINT is set, the client sends traces
// to the endpoint via HTTP, making the JAEGER_AGENT_HOST and JAEGER_AGENT_PORT unused. If JAEGER_ENDPOINT is secured,
// HTTP basic authentication can be performed by setting the JAEGER_USER and JAEGER_PASSWORD environment variables.
if (localConfig.endpoint) {
localConfig.endpoint = localConfig.endpoint || process.env.JAEGER_ENDPOINT;
localConfig.endpoint =
localConfig.endpoint || process.env.JAEGER_ENDPOINT;
localConfig.username = localConfig.username || process.env.JAEGER_USER;
localConfig.password = localConfig.password || process.env.JAEGER_PASSWORD;
localConfig.password =
localConfig.password || process.env.JAEGER_PASSWORD;
this._sender = new jaegerTypes.HTTPSender(localConfig);
this._sender._httpOptions.headers[OT_REQUEST_HEADER] = 1;
} else {
localConfig.host = localConfig.host || process.env.JAEGER_AGENT_HOST;
this._sender = localConfig.endpoint = new jaegerTypes.UDPSender(localConfig);
this._sender = localConfig.endpoint = new jaegerTypes.UDPSender(
localConfig
);
}

if (this._sender._client instanceof Socket) {
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('JaegerExporter', () => {
const mockedEndpoint = 'http://testendpoint';
nock(mockedEndpoint)
.post('/')
.reply(function() {
.reply(function () {
assert.strictEqual(this.req.headers[OT_REQUEST_HEADER], 1);
assert.strictEqual(
this.req.headers['content-type'],
Expand Down

0 comments on commit d284387

Please sign in to comment.