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

Commit

Permalink
Jaeger exporter: remove require wrapper and make requires direct (#302)
Browse files Browse the repository at this point in the history
* Remove require wrapper and make requires direct

* Use filepath from installed module

* Add tslint ignores back

* Formatting fix
  • Loading branch information
tstirrat15 authored and mayurkale22 committed Mar 8, 2019
1 parent 36f63e6 commit 89cb441
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/opencensus-exporter-jaeger/src/jaeger-driver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@
*/

import {Span} from '@opencensus/core';
import * as path from 'path';

const indexPath = path.dirname(require.resolve('jaeger-client'));

function requireJaegerClientModule(nodeName: string) {
return require(path.join(indexPath, nodeName)).default;
}

// tslint:disable-next-line:variable-name
export const UDPSender = requireJaegerClientModule('reporters/udp_sender');
export const UDPSender =
require('jaeger-client/dist/src/reporters/udp_sender').default;
// tslint:disable-next-line:variable-name
export const Utils = requireJaegerClientModule('util');
export const Utils = require('jaeger-client/dist/src/util').default;
// tslint:disable-next-line:variable-name
export const ThriftUtils = requireJaegerClientModule('thrift');
export const ThriftUtils = require('jaeger-client/dist/src/thrift').default;

export type TagValue = string|number|boolean;

Expand Down

0 comments on commit 89cb441

Please sign in to comment.