Skip to content

Commit 4798767

Browse files
authored
fix: Change opentracing protocol (#94)
1 parent 07e7688 commit 4798767

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Service.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,19 @@ export class Service<E extends Emitter = Emitter> extends Root {
8585
[SemanticResourceAttributes.SERVICE_NAME]: this.options.name,
8686
}),
8787
});
88-
const exporter = new JaegerExporter({
89-
endpoint: this.getSettingFromEnv('OTEL_AGENT', false),
90-
});
88+
89+
let host: string | undefined;
90+
let port: number | undefined;
91+
92+
const agentUrl = this.getSettingFromEnv('OTEL_AGENT', false);
93+
94+
if (agentUrl) {
95+
const agent = agentUrl.split(':');
96+
host = agent[0];
97+
port = parseInt(agent[1]) || undefined;
98+
}
99+
100+
const exporter = new JaegerExporter({ host, port });
91101
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
92102
provider.register();
93103
}

0 commit comments

Comments
 (0)