@opentelemetry/exporter-jaeger
Advanced tools
Comparing version 0.11.0 to 0.11.1-alpha.15
@@ -12,2 +12,5 @@ import { ExportResult } from '@opentelemetry/core'; | ||
private readonly _onShutdownFlushTimeout; | ||
private _isShutdown; | ||
private _shutdownFlushTimeout; | ||
private _shuttingDownPromise; | ||
constructor(config: jaegerTypes.ExporterConfig); | ||
@@ -17,3 +20,3 @@ /** Exports a list of spans to Jaeger. */ | ||
/** Shutdown exporter. */ | ||
shutdown(): void; | ||
shutdown(): Promise<void>; | ||
/** Transform spans and sends to Jaeger service. */ | ||
@@ -20,0 +23,0 @@ private _sendSpans; |
@@ -29,2 +29,4 @@ "use strict"; | ||
constructor(config) { | ||
this._isShutdown = false; | ||
this._shuttingDownPromise = Promise.resolve(); | ||
const localConfig = Object.assign({}, config); | ||
@@ -75,9 +77,34 @@ this._logger = localConfig.logger || new core_1.NoopLogger(); | ||
shutdown() { | ||
// Make an optimistic flush. | ||
this._flush(); | ||
// Sleeping x seconds before closing the sender's connection to ensure | ||
// all spans are flushed. | ||
setTimeout(() => { | ||
this._sender.close(); | ||
}, this._onShutdownFlushTimeout); | ||
if (this._isShutdown) { | ||
return this._shuttingDownPromise; | ||
} | ||
this._isShutdown = true; | ||
this._shuttingDownPromise = new Promise((resolve, reject) => { | ||
let rejected = false; | ||
this._shutdownFlushTimeout = setTimeout(() => { | ||
rejected = true; | ||
reject('timeout'); | ||
this._sender.close(); | ||
}, this._onShutdownFlushTimeout); | ||
Promise.resolve() | ||
.then(() => { | ||
// Make an optimistic flush. | ||
return this._flush(); | ||
}) | ||
.then(() => { | ||
if (rejected) { | ||
return; | ||
} | ||
else { | ||
this._shutdownFlushTimeout && | ||
clearTimeout(this._shutdownFlushTimeout); | ||
resolve(); | ||
this._sender.close(); | ||
} | ||
}) | ||
.catch(e => { | ||
reject(e); | ||
}); | ||
}); | ||
return this._shuttingDownPromise; | ||
} | ||
@@ -84,0 +111,0 @@ /** Transform spans and sends to Jaeger service. */ |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.11.0"; | ||
export declare const VERSION = "0.11.1-alpha.15+e170039"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.11.0'; | ||
exports.VERSION = '0.11.1-alpha.15+e170039'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/exporter-jaeger", | ||
"version": "0.11.0", | ||
"version": "0.11.1-alpha.15+e170039", | ||
"description": "OpenTelemetry Exporter Jaeger allows user to send collected traces to Jaeger", | ||
@@ -45,3 +45,3 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@opentelemetry/resources": "^0.11.0", | ||
"@opentelemetry/resources": "^0.11.1-alpha.15+e170039", | ||
"@types/mocha": "8.0.2", | ||
@@ -60,8 +60,8 @@ "@types/node": "14.0.27", | ||
"dependencies": { | ||
"@opentelemetry/api": "^0.11.0", | ||
"@opentelemetry/core": "^0.11.0", | ||
"@opentelemetry/tracing": "^0.11.0", | ||
"@opentelemetry/api": "^0.11.1-alpha.15+e170039", | ||
"@opentelemetry/core": "^0.11.1-alpha.15+e170039", | ||
"@opentelemetry/tracing": "^0.11.1-alpha.15+e170039", | ||
"jaeger-client": "^3.15.0" | ||
}, | ||
"gitHead": "15174c6647ab9863dfc1424412fa60f2fddb3351" | ||
"gitHead": "e170039015e8a1a7419bb835a00659b2a734b8a6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
45319
456
+ Added@opentelemetry/api@0.11.1-alpha.53(transitive)
+ Added@opentelemetry/core@0.11.1-alpha.53(transitive)
+ Added@opentelemetry/resources@0.11.1-alpha.53(transitive)
+ Added@opentelemetry/tracing@0.11.1-alpha.53(transitive)
- Removed@opentelemetry/api@0.11.0(transitive)
- Removed@opentelemetry/core@0.11.0(transitive)
- Removed@opentelemetry/resources@0.11.0(transitive)
- Removed@opentelemetry/tracing@0.11.0(transitive)