Skip to content

Commit 7719c91

Browse files
obecnymayurkale22
andauthored
chore: removing force flush (open-telemetry#916)
Co-authored-by: Mayur Kale <mayurkale@google.com>
1 parent 3d26f82 commit 7719c91

File tree

4 files changed

+4
-23
lines changed

4 files changed

+4
-23
lines changed

packages/opentelemetry-exporter-jaeger/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"precompile": "tsc --version",
1616
"version:update": "node ../../scripts/version-update.js",
1717
"compile": "npm run version:update && tsc -p .",
18-
"prepare": "npm run compile"
18+
"prepare": "npm run compile",
19+
"watch": "tsc -w"
1920
},
2021
"keywords": [
2122
"opentelemetry",

packages/opentelemetry-exporter-jaeger/src/jaeger.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@ export class JaegerExporter implements SpanExporter {
2929
private readonly _logger: api.Logger;
3030
private readonly _process: jaegerTypes.ThriftProcess;
3131
private readonly _sender: typeof jaegerTypes.UDPSender;
32-
private readonly _forceFlushOnShutdown: boolean = true;
3332
private readonly _onShutdownFlushTimeout: number;
3433

3534
constructor(config: jaegerTypes.ExporterConfig) {
3635
this._logger = config.logger || new NoopLogger();
3736
const tags: jaegerTypes.Tag[] = config.tags || [];
38-
this._forceFlushOnShutdown =
39-
typeof config.forceFlush === 'boolean' ? config.forceFlush : true;
4037
this._onShutdownFlushTimeout =
4138
typeof config.flushTimeout === 'number' ? config.flushTimeout : 2000;
4239

@@ -69,7 +66,6 @@ export class JaegerExporter implements SpanExporter {
6966

7067
/** Shutdown exporter. */
7168
shutdown(): void {
72-
if (!this._forceFlushOnShutdown) return;
7369
// Make an optimistic flush.
7470
this._flush();
7571
// Sleeping x seconds before closing the sender's connection to ensure

packages/opentelemetry-exporter-jaeger/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export interface ExporterConfig {
2626
host?: string; // default: 'localhost'
2727
port?: number; // default: 6832
2828
maxPacketSize?: number; // default: 65000
29-
/** Force a flush on shutdown */
30-
forceFlush?: boolean; // default: true
3129
/** Time to wait for an onShutdown flush to finish before closing the sender */
3230
flushTimeout?: number; // default: 2000
3331
}

packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,40 +54,26 @@ describe('JaegerExporter', () => {
5454
assert.strictEqual(process.tags[0].vStr, '0.1.0');
5555
});
5656

57-
it('should construct an exporter with forceFlush and flushTimeout', () => {
57+
it('should construct an exporter with flushTimeout', () => {
5858
const exporter = new JaegerExporter({
5959
serviceName: 'opentelemetry',
60-
forceFlush: true,
6160
flushTimeout: 5000,
6261
});
6362
assert.ok(typeof exporter.export === 'function');
6463
assert.ok(typeof exporter.shutdown === 'function');
6564

66-
assert.ok(exporter['_forceFlushOnShutdown']);
6765
assert.strictEqual(exporter['_onShutdownFlushTimeout'], 5000);
6866
});
6967

70-
it('should construct an exporter without forceFlush and flushTimeout', () => {
68+
it('should construct an exporter without flushTimeout', () => {
7169
const exporter = new JaegerExporter({
7270
serviceName: 'opentelemetry',
7371
});
7472
assert.ok(typeof exporter.export === 'function');
7573
assert.ok(typeof exporter.shutdown === 'function');
7674

77-
assert.ok(exporter['_forceFlushOnShutdown']);
7875
assert.strictEqual(exporter['_onShutdownFlushTimeout'], 2000);
7976
});
80-
81-
it('should construct an exporter with forceFlush = false', () => {
82-
const exporter = new JaegerExporter({
83-
serviceName: 'opentelemetry',
84-
forceFlush: false,
85-
});
86-
assert.ok(typeof exporter.export === 'function');
87-
assert.ok(typeof exporter.shutdown === 'function');
88-
89-
assert.ok(!exporter['_forceFlushOnShutdown']);
90-
});
9177
});
9278

9379
describe('export', () => {

0 commit comments

Comments
 (0)