Skip to content

Commit

Permalink
Upgrade extension telemetry package (#5853)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Dec 7, 2024
1 parent 3599a00 commit 61d7520
Showing 5 changed files with 85 additions and 335 deletions.
2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
@@ -1609,7 +1609,7 @@
},
"dependencies": {
"@hediet/std": "0.6.0",
"@vscode/extension-telemetry": "0.8.5",
"@vscode/extension-telemetry": "0.9.8",
"appdirs": "1.1.0",
"execa": "5.1.1",
"fs-extra": "11.2.0",
3 changes: 2 additions & 1 deletion extension/src/telemetry/constants.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ import {
SectionCollapsed
} from '../plots/webview/contract'

export const APPLICATION_INSIGHTS_KEY = '46e8e554-d50a-471a-a53b-4af2b1cd6594'
export const APPLICATION_INSIGHTS_CONNECTION_STRING =
'InstrumentationKey=46e8e554-d50a-471a-a53b-4af2b1cd6594;IngestionEndpoint=https://westus2-2.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/;ApplicationId=f8ed111b-7a8f-4e59-94a5-9979333db978'

const ViewOpenedEvent = {
VIEWS_EXPERIMENTS_FILTER_BY_TREE_OPENED:
4 changes: 2 additions & 2 deletions extension/src/telemetry/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TelemetryReporter from '@vscode/extension-telemetry'
import { getTelemetryReporter, sendTelemetryEvent } from '.'
import {
APPLICATION_INSIGHTS_KEY,
APPLICATION_INSIGHTS_CONNECTION_STRING,
IEventNamePropertyMapping
} from './constants'
import { getUserId } from './uuid'
@@ -40,7 +40,7 @@ describe('getTelemetryReporter', () => {
expect(telemetryReporter).toBeDefined()
expect(mockedTelemetryReporter).toHaveBeenCalledTimes(1)
expect(mockedTelemetryReporter).toHaveBeenCalledWith(
APPLICATION_INSIGHTS_KEY
APPLICATION_INSIGHTS_CONNECTION_STRING
)
})

6 changes: 4 additions & 2 deletions extension/src/telemetry/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line import/default
import TelemetryReporter from '@vscode/extension-telemetry'
import {
APPLICATION_INSIGHTS_KEY,
APPLICATION_INSIGHTS_CONNECTION_STRING,
IEventNamePropertyMapping,
ViewOpenedEventName
} from './constants'
@@ -18,7 +18,9 @@ export const getTelemetryReporter = (): TelemetryReporter => {
return telemetryReporter
}

telemetryReporter = new TelemetryReporter(APPLICATION_INSIGHTS_KEY)
telemetryReporter = new TelemetryReporter(
APPLICATION_INSIGHTS_CONNECTION_STRING
)
return telemetryReporter
}

Loading

0 comments on commit 61d7520

Please sign in to comment.