We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07e7688 commit 4798767Copy full SHA for 4798767
src/Service.ts
@@ -85,9 +85,19 @@ export class Service<E extends Emitter = Emitter> extends Root {
85
[SemanticResourceAttributes.SERVICE_NAME]: this.options.name,
86
}),
87
});
88
- const exporter = new JaegerExporter({
89
- endpoint: this.getSettingFromEnv('OTEL_AGENT', false),
90
- });
+
+ let host: string | undefined;
+ 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 });
101
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
102
provider.register();
103
}
0 commit comments