Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 89cb441

Browse files
tstirrat15mayurkale22
authored andcommitted
Jaeger exporter: remove require wrapper and make requires direct (#302)
* Remove require wrapper and make requires direct * Use filepath from installed module * Add tslint ignores back * Formatting fix
1 parent 36f63e6 commit 89cb441

File tree

1 file changed

+4
-10
lines changed
  • packages/opencensus-exporter-jaeger/src/jaeger-driver

1 file changed

+4
-10
lines changed

packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@
1515
*/
1616

1717
import {Span} from '@opencensus/core';
18-
import * as path from 'path';
19-
20-
const indexPath = path.dirname(require.resolve('jaeger-client'));
21-
22-
function requireJaegerClientModule(nodeName: string) {
23-
return require(path.join(indexPath, nodeName)).default;
24-
}
2518

2619
// tslint:disable-next-line:variable-name
27-
export const UDPSender = requireJaegerClientModule('reporters/udp_sender');
20+
export const UDPSender =
21+
require('jaeger-client/dist/src/reporters/udp_sender').default;
2822
// tslint:disable-next-line:variable-name
29-
export const Utils = requireJaegerClientModule('util');
23+
export const Utils = require('jaeger-client/dist/src/util').default;
3024
// tslint:disable-next-line:variable-name
31-
export const ThriftUtils = requireJaegerClientModule('thrift');
25+
export const ThriftUtils = require('jaeger-client/dist/src/thrift').default;
3226

3327
export type TagValue = string|number|boolean;
3428

0 commit comments

Comments
 (0)