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

Commit 6fb7df3

Browse files
author
Mark Wolff
authored
fix: file persist not passing options (#46)
1 parent 30ec6fb commit 6fb7df3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/azure-opentelemetry-exporter/src/export/exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export abstract class AzureMonitorBaseExporter implements BaseExporter {
5252

5353
this._telemetryProcessors = [];
5454
this._sender = new HttpSender();
55-
this._persister = new FileSystemPersist();
55+
this._persister = new FileSystemPersist(this._options);
5656
this._retryTimer = null;
5757
this._logger.debug('AzureMonitorTraceExporter was successfully setup');
5858
}

packages/azure-opentelemetry-exporter/test/export/export.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { TelemetryProcessor } from '../../src/types';
88
import { Envelope } from '../../src/Declarations/Contracts';
99
import { DEFAULT_BREEZE_ENDPOINT } from '../../src/Declarations/Constants';
1010
import { failedBreezeResponse, partialBreezeResponse, successfulBreezeResponse } from '../breezeTestUtils';
11+
import { FileSystemPersist } from '../../src/platform';
1112

1213
function toObject(obj: object) {
1314
return JSON.parse(JSON.stringify(obj));
@@ -26,6 +27,16 @@ describe('#AzureMonitorBaseExporter', () => {
2627
}
2728
}
2829

30+
it('should pass options to persister', () => {
31+
const exporter = new TestExporter();
32+
assert.ok(exporter['_options'].instrumentationKey);
33+
assert.strictEqual(
34+
(exporter['_persister'] as FileSystemPersist)['_options'].instrumentationKey,
35+
exporter['_options'].instrumentationKey,
36+
);
37+
assert.deepStrictEqual((exporter['_persister'] as FileSystemPersist)['_options'], exporter['_options']);
38+
});
39+
2940
describe('Sender/Persister Controller', () => {
3041
describe('#exportEnvelopes()', () => {
3142
const scope = nock(DEFAULT_BREEZE_ENDPOINT).post('/v2/track');

0 commit comments

Comments
 (0)