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

Commit

Permalink
fix: file persist not passing options (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wolff authored Jun 26, 2020
1 parent 30ec6fb commit 6fb7df3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export abstract class AzureMonitorBaseExporter implements BaseExporter {

this._telemetryProcessors = [];
this._sender = new HttpSender();
this._persister = new FileSystemPersist();
this._persister = new FileSystemPersist(this._options);
this._retryTimer = null;
this._logger.debug('AzureMonitorTraceExporter was successfully setup');
}
Expand Down
11 changes: 11 additions & 0 deletions packages/azure-opentelemetry-exporter/test/export/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TelemetryProcessor } from '../../src/types';
import { Envelope } from '../../src/Declarations/Contracts';
import { DEFAULT_BREEZE_ENDPOINT } from '../../src/Declarations/Constants';
import { failedBreezeResponse, partialBreezeResponse, successfulBreezeResponse } from '../breezeTestUtils';
import { FileSystemPersist } from '../../src/platform';

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

it('should pass options to persister', () => {
const exporter = new TestExporter();
assert.ok(exporter['_options'].instrumentationKey);
assert.strictEqual(
(exporter['_persister'] as FileSystemPersist)['_options'].instrumentationKey,
exporter['_options'].instrumentationKey,
);
assert.deepStrictEqual((exporter['_persister'] as FileSystemPersist)['_options'], exporter['_options']);
});

describe('Sender/Persister Controller', () => {
describe('#exportEnvelopes()', () => {
const scope = nock(DEFAULT_BREEZE_ENDPOINT).post('/v2/track');
Expand Down

0 comments on commit 6fb7df3

Please sign in to comment.