This repository was archived by the owner on Nov 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/azure-opentelemetry-exporter Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { TelemetryProcessor } from '../../src/types';
88import { Envelope } from '../../src/Declarations/Contracts' ;
99import { DEFAULT_BREEZE_ENDPOINT } from '../../src/Declarations/Constants' ;
1010import { failedBreezeResponse , partialBreezeResponse , successfulBreezeResponse } from '../breezeTestUtils' ;
11+ import { FileSystemPersist } from '../../src/platform' ;
1112
1213function 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' ) ;
You can’t perform that action at this time.
0 commit comments