Skip to content

Commit

Permalink
fix: env var was never called
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardodalcin committed Jun 3, 2020
1 parent d284387 commit 8d51800
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/opentelemetry-exporter-jaeger/src/jaeger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ export class JaegerExporter implements SpanExporter {
// 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.
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.host = localConfig.host || process.env.JAEGER_AGENT_HOST;
if (localConfig.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;
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
);
Expand Down

0 comments on commit 8d51800

Please sign in to comment.