Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(config: jaegerTypes.ExporterConfig) {
this._logger = config.logger || new NoopLogger();
const tags: jaegerTypes.Tag[] = config.tags || [];
this._forceFlushOnShutdown =
typeof config.forceFlush === 'boolean' ? config.forceFlush : true;
this._onShutdownFlushTimeout =
typeof config.flushTimeout === 'number' ? config.flushTimeout : 2000;
this._sender = new jaegerTypes.UDPSender(config);
this._process = {
serviceName: config.serviceName,
tags: jaegerTypes.ThriftUtils.getThriftTags(tags),
};
this._sender.setProcess(this._process);
}
constructor(tracer: types.Tracer, logger?: types.Logger) {
super();
this._tracer = tracer;
this._logger = logger || new NoopLogger();
}
constructor(config: ExporterConfig = {}, callback?: () => void) {
this._logger = config.logger || new NoopLogger();
this._port = config.port || PrometheusExporter.DEFAULT_OPTIONS.port;
this._prefix = config.prefix || PrometheusExporter.DEFAULT_OPTIONS.prefix;
this._server = createServer(this._requestHandler);
this._endpoint = (
config.endpoint || PrometheusExporter.DEFAULT_OPTIONS.endpoint
).replace(/^([^/])/, '/$1');
if (config.startServer || PrometheusExporter.DEFAULT_OPTIONS.startServer) {
this.startServer(callback);
} else if (callback) {
callback();
}
}
constructor(config: zipkinTypes.ExporterConfig) {
const urlStr = config.url || ZipkinExporter.DEFAULT_URL;
const urlOpts = url.parse(urlStr);
this._forceFlush = config.forceFlush || true;
this._logger = config.logger || new NoopLogger();
this._reqOpts = Object.assign(
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
[OT_REQUEST_HEADER]: 1,
},
},
urlOpts
);
this._serviceName = config.serviceName;
this._statusCodeTagName = config.statusCodeTagName || statusCodeTagName;
this._statusDescriptionTagName =
config.statusDescriptionTagName || statusDescriptionTagName;
this._isShutdown = false;
}