Skip to content

Commit

Permalink
accept instrumentation and connection string (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 authored Nov 19, 2024
1 parent eaf9dc2 commit 82c90ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/appInsightsClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ export const appInsightsClientFactory = async (connectionString: string, machine
extensionConfig[BreezeChannelIdentifier] = channelConfig;
}

let instrumentationKey: string | undefined;
if (!connectionString.startsWith("InstrumentationKey=")) {
instrumentationKey = connectionString;
}

const authConfig = instrumentationKey ? { instrumentationKey } : { connectionString };

appInsightsClient = new basicAISDK.ApplicationInsights({
connectionString: connectionString,
...authConfig,
disableAjaxTracking: true,
disableExceptionTracking: true,
disableFetchTracking: true,
Expand Down

0 comments on commit 82c90ba

Please sign in to comment.