@codingame/monaco-vscode-telemetry-service-override 36.2.7 → 37.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -1
- package/package.json +2 -2
- package/vscode/src/vs/base/common/editArcTracker.d.ts +29 -0
- package/vscode/src/vs/base/common/editArcTracker.js +291 -0
- package/vscode/src/vs/platform/agentHost/common/diffComputeService.d.ts +19 -0
- package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.d.ts +107 -0
- package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.js +59 -0
- package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.service.d.ts +12 -0
- package/vscode/src/vs/platform/telemetry/browser/errorTelemetry.js +5 -5
- package/vscode/src/vs/platform/telemetry/common/1dsAppender.d.ts +2 -0
- package/vscode/src/vs/platform/telemetry/common/1dsAppender.js +12 -10
- package/vscode/src/vs/platform/telemetry/common/editArcTelemetry.d.ts +141 -0
- package/vscode/src/vs/platform/telemetry/common/editArcTelemetry.js +5 -0
- package/vscode/src/vs/platform/telemetry/common/editTelemetry.d.ts +49 -0
- package/vscode/src/vs/platform/telemetry/common/editTelemetry.js +10 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryLogAppender.d.ts +5 -2
- package/vscode/src/vs/platform/telemetry/common/telemetryLogAppender.js +4 -3
- package/vscode/src/vs/platform/telemetry/common/telemetryService.d.ts +14 -4
- package/vscode/src/vs/platform/telemetry/common/telemetryService.js +50 -34
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editStats/aiStatsChart.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editStats/aiStatsStatusBar.js +8 -8
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.js +12 -7
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editTelemetryContribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/helpers/documentWithAnnotatedEdits.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/helpers/documentWithAnnotatedEdits.js +15 -2
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/settingIds.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/settingIds.js +1 -2
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/agentHostEditMarkerService.d.ts +83 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/agentHostEditMarkerService.js +690 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetryReporter.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetrySender.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetrySender.js +3 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingFeature.js +11 -4
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingImpl.d.ts +15 -4
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingImpl.js +185 -83
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editTracker.d.ts +21 -5
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editTracker.js +128 -12
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/scmAdapter.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/editTelemetry/common/arcTracker.d.ts +3 -11
- package/vscode/src/vs/workbench/contrib/editTelemetry/common/arcTracker.js +17 -47
- package/vscode/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.js +13 -2
- package/vscode/src/vs/workbench/services/policies/browser/policyTelemetry.contribution.d.ts +14 -0
- package/vscode/src/vs/workbench/services/policies/browser/policyTelemetry.contribution.js +134 -0
- package/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/dataChannel/browser/dataChannelService.d.ts +0 -10
- package/vscode/src/vs/workbench/services/dataChannel/browser/dataChannelService.js +0 -30
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const EDIT_TELEMETRY_SETTING_ID = "telemetry.editStats.enabled";
|
|
2
|
+
export interface IEditArcTelemetryEvent {
|
|
3
|
+
sourceKeyCleaned: string;
|
|
4
|
+
extensionId: string | undefined;
|
|
5
|
+
extensionVersion: string | undefined;
|
|
6
|
+
opportunityId: string | undefined;
|
|
7
|
+
editSessionId: string | undefined;
|
|
8
|
+
requestId: string | undefined;
|
|
9
|
+
modelId: string | undefined;
|
|
10
|
+
languageId: string | undefined;
|
|
11
|
+
mode: string | undefined;
|
|
12
|
+
uniqueEditId: string | undefined;
|
|
13
|
+
provider: string | undefined;
|
|
14
|
+
agentSessionId: string | undefined;
|
|
15
|
+
isSubagentSession: string | undefined;
|
|
16
|
+
didBranchChange: number;
|
|
17
|
+
timeDelayMs: number;
|
|
18
|
+
originalCharCount: number;
|
|
19
|
+
originalLineCount: number;
|
|
20
|
+
originalDeletedLineCount: number;
|
|
21
|
+
arc: number;
|
|
22
|
+
currentLineCount: number;
|
|
23
|
+
currentDeletedLineCount: number;
|
|
24
|
+
}
|
|
25
|
+
export type IEditArcTelemetryClassification = {
|
|
26
|
+
owner: "hediet";
|
|
27
|
+
comment: "Reports the accepted and retained character count for an inline completion/edit. @sentToGitHub";
|
|
28
|
+
sourceKeyCleaned: {
|
|
29
|
+
classification: "SystemMetaData";
|
|
30
|
+
purpose: "FeatureInsight";
|
|
31
|
+
comment: "The key of the edit source.";
|
|
32
|
+
};
|
|
33
|
+
extensionId: {
|
|
34
|
+
classification: "SystemMetaData";
|
|
35
|
+
purpose: "FeatureInsight";
|
|
36
|
+
comment: "The extension id (copilot or copilot-chat); which provided this inline completion.";
|
|
37
|
+
};
|
|
38
|
+
extensionVersion: {
|
|
39
|
+
classification: "SystemMetaData";
|
|
40
|
+
purpose: "FeatureInsight";
|
|
41
|
+
comment: "The version of the extension.";
|
|
42
|
+
};
|
|
43
|
+
opportunityId: {
|
|
44
|
+
classification: "SystemMetaData";
|
|
45
|
+
purpose: "FeatureInsight";
|
|
46
|
+
comment: "Unique identifier for an opportunity to show an inline completion or NES.";
|
|
47
|
+
};
|
|
48
|
+
editSessionId: {
|
|
49
|
+
classification: "SystemMetaData";
|
|
50
|
+
purpose: "FeatureInsight";
|
|
51
|
+
comment: "The session id.";
|
|
52
|
+
};
|
|
53
|
+
requestId: {
|
|
54
|
+
classification: "SystemMetaData";
|
|
55
|
+
purpose: "FeatureInsight";
|
|
56
|
+
comment: "The request id.";
|
|
57
|
+
};
|
|
58
|
+
modelId: {
|
|
59
|
+
classification: "SystemMetaData";
|
|
60
|
+
purpose: "FeatureInsight";
|
|
61
|
+
comment: "The model id.";
|
|
62
|
+
};
|
|
63
|
+
languageId: {
|
|
64
|
+
classification: "SystemMetaData";
|
|
65
|
+
purpose: "FeatureInsight";
|
|
66
|
+
comment: "The language id of the document.";
|
|
67
|
+
};
|
|
68
|
+
mode: {
|
|
69
|
+
classification: "SystemMetaData";
|
|
70
|
+
purpose: "FeatureInsight";
|
|
71
|
+
comment: "The mode chat was in.";
|
|
72
|
+
};
|
|
73
|
+
uniqueEditId: {
|
|
74
|
+
classification: "SystemMetaData";
|
|
75
|
+
purpose: "FeatureInsight";
|
|
76
|
+
comment: "The unique identifier for the edit.";
|
|
77
|
+
};
|
|
78
|
+
provider: {
|
|
79
|
+
classification: "SystemMetaData";
|
|
80
|
+
purpose: "FeatureInsight";
|
|
81
|
+
comment: "The Agent Host provider that produced the edit.";
|
|
82
|
+
};
|
|
83
|
+
agentSessionId: {
|
|
84
|
+
classification: "SystemMetaData";
|
|
85
|
+
purpose: "FeatureInsight";
|
|
86
|
+
comment: "The Agent Host session identifier.";
|
|
87
|
+
};
|
|
88
|
+
isSubagentSession: {
|
|
89
|
+
classification: "SystemMetaData";
|
|
90
|
+
purpose: "FeatureInsight";
|
|
91
|
+
comment: "Whether the edit was produced in an Agent Host subagent session.";
|
|
92
|
+
};
|
|
93
|
+
didBranchChange: {
|
|
94
|
+
classification: "SystemMetaData";
|
|
95
|
+
purpose: "FeatureInsight";
|
|
96
|
+
isMeasurement: true;
|
|
97
|
+
comment: "Indicates if the branch changed in the meantime. If the branch changed (value is 1); this event should probably be ignored.";
|
|
98
|
+
};
|
|
99
|
+
timeDelayMs: {
|
|
100
|
+
classification: "SystemMetaData";
|
|
101
|
+
purpose: "FeatureInsight";
|
|
102
|
+
isMeasurement: true;
|
|
103
|
+
comment: "The time delay between the user accepting the edit and measuring the survival rate.";
|
|
104
|
+
};
|
|
105
|
+
originalCharCount: {
|
|
106
|
+
classification: "SystemMetaData";
|
|
107
|
+
purpose: "FeatureInsight";
|
|
108
|
+
isMeasurement: true;
|
|
109
|
+
comment: "The original character count before any edits.";
|
|
110
|
+
};
|
|
111
|
+
originalLineCount: {
|
|
112
|
+
classification: "SystemMetaData";
|
|
113
|
+
purpose: "FeatureInsight";
|
|
114
|
+
isMeasurement: true;
|
|
115
|
+
comment: "The original line count before any edits.";
|
|
116
|
+
};
|
|
117
|
+
originalDeletedLineCount: {
|
|
118
|
+
classification: "SystemMetaData";
|
|
119
|
+
purpose: "FeatureInsight";
|
|
120
|
+
isMeasurement: true;
|
|
121
|
+
comment: "The original deleted line count before any edits.";
|
|
122
|
+
};
|
|
123
|
+
arc: {
|
|
124
|
+
classification: "SystemMetaData";
|
|
125
|
+
purpose: "FeatureInsight";
|
|
126
|
+
isMeasurement: true;
|
|
127
|
+
comment: "The accepted and restrained character count.";
|
|
128
|
+
};
|
|
129
|
+
currentLineCount: {
|
|
130
|
+
classification: "SystemMetaData";
|
|
131
|
+
purpose: "FeatureInsight";
|
|
132
|
+
isMeasurement: true;
|
|
133
|
+
comment: "The current line count after edits.";
|
|
134
|
+
};
|
|
135
|
+
currentDeletedLineCount: {
|
|
136
|
+
classification: "SystemMetaData";
|
|
137
|
+
purpose: "FeatureInsight";
|
|
138
|
+
isMeasurement: true;
|
|
139
|
+
comment: "The current deleted line count after edits.";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
2
|
+
export type EditTelemetryMode = "longterm" | "10minFocusWindow" | "20minFocusWindow";
|
|
3
|
+
export type EditTelemetryTrigger = "10hours" | "hashChange" | "branchChange" | "closed" | "time";
|
|
4
|
+
export interface IEditSourcesDetailsTelemetryData {
|
|
5
|
+
copilotSku?: string;
|
|
6
|
+
mode: EditTelemetryMode;
|
|
7
|
+
sourceKey: string;
|
|
8
|
+
sourceKeyCleaned: string;
|
|
9
|
+
extensionId: string | undefined;
|
|
10
|
+
extensionVersion: string | undefined;
|
|
11
|
+
modelId: string | undefined;
|
|
12
|
+
trigger: EditTelemetryTrigger;
|
|
13
|
+
languageId: string | undefined;
|
|
14
|
+
statsUuid: string;
|
|
15
|
+
conversationId: string | undefined;
|
|
16
|
+
requestId: string | undefined;
|
|
17
|
+
origin: string | undefined;
|
|
18
|
+
harness: string | undefined;
|
|
19
|
+
modifiedCount: number;
|
|
20
|
+
deltaModifiedCount: number;
|
|
21
|
+
totalModifiedCount: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function sendEditSourcesDetailsTelemetry(telemetryService: ITelemetryService, data: IEditSourcesDetailsTelemetryData): void;
|
|
24
|
+
export interface IEditSourcesStatsTelemetryData {
|
|
25
|
+
copilotSku?: string;
|
|
26
|
+
attributionSchemaVersion: 2;
|
|
27
|
+
mode: EditTelemetryMode;
|
|
28
|
+
languageId?: string;
|
|
29
|
+
statsUuid: string;
|
|
30
|
+
nesModifiedCount: number;
|
|
31
|
+
inlineCompletionsCopilotModifiedCount: number;
|
|
32
|
+
inlineCompletionsNESModifiedCount: number;
|
|
33
|
+
otherAIModifiedCount: number;
|
|
34
|
+
agentHostModifiedCount: number;
|
|
35
|
+
unknownModifiedCount: number;
|
|
36
|
+
userModifiedCount: number;
|
|
37
|
+
ideModifiedCount: number;
|
|
38
|
+
totalModifiedCharacters: number;
|
|
39
|
+
externalModifiedCount: number;
|
|
40
|
+
isTrackedByGit?: number;
|
|
41
|
+
focusTime?: number;
|
|
42
|
+
actualTime?: number;
|
|
43
|
+
trigger: EditTelemetryTrigger;
|
|
44
|
+
trackingScope?: "agentHostStandalone";
|
|
45
|
+
agentHostAttributionCoverage?: "complete" | "partial";
|
|
46
|
+
agentHostUntrackedEditCount?: number;
|
|
47
|
+
agentHostUntrackedInsertedCount?: number;
|
|
48
|
+
}
|
|
49
|
+
export declare function sendEditSourcesStatsTelemetry(telemetryService: ITelemetryService, data: IEditSourcesStatsTelemetryData): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
function sendEditSourcesDetailsTelemetry(telemetryService, data) {
|
|
4
|
+
telemetryService.publicLog2('editTelemetry.editSources.details', data);
|
|
5
|
+
}
|
|
6
|
+
function sendEditSourcesStatsTelemetry(telemetryService, data) {
|
|
7
|
+
telemetryService.publicLog2('editTelemetry.editSources.stats', data);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { sendEditSourcesDetailsTelemetry, sendEditSourcesStatsTelemetry };
|
|
@@ -4,9 +4,12 @@ import { ILoggerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
4
4
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
5
5
|
import { ITelemetryAppender } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils";
|
|
6
6
|
export declare class TelemetryLogAppender extends Disposable implements ITelemetryAppender {
|
|
7
|
-
private readonly prefix;
|
|
8
7
|
private readonly logger;
|
|
9
|
-
|
|
8
|
+
private readonly prefix;
|
|
9
|
+
constructor(prefixOrOptions: string | {
|
|
10
|
+
readonly prefix: string;
|
|
11
|
+
readonly loggerId: string;
|
|
12
|
+
}, remote: boolean, loggerService: ILoggerService, environmentService: IEnvironmentService, productService: IProductService);
|
|
10
13
|
flush(): Promise<void>;
|
|
11
14
|
log(eventName: string, data: unknown): void;
|
|
12
15
|
}
|
|
@@ -8,10 +8,11 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
8
8
|
import { telemetryLogId, isLoggingOnly, TelemetryLogGroup, validateTelemetryData } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
9
9
|
|
|
10
10
|
let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(prefixOrOptions, remote, loggerService, environmentService, productService) {
|
|
12
12
|
super();
|
|
13
|
+
const prefix = typeof prefixOrOptions === "string" ? prefixOrOptions : prefixOrOptions.prefix;
|
|
13
14
|
this.prefix = prefix;
|
|
14
|
-
const id = remote ? "remoteTelemetry" : telemetryLogId;
|
|
15
|
+
const id = typeof prefixOrOptions === "string" ? (remote ? "remoteTelemetry" : telemetryLogId) : prefixOrOptions.loggerId;
|
|
15
16
|
const logger = loggerService.getLogger(id);
|
|
16
17
|
if (logger) {
|
|
17
18
|
this.logger = this._register(logger);
|
|
@@ -19,7 +20,7 @@ let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
|
|
|
19
20
|
const justLoggingAndNotSending = isLoggingOnly(productService, environmentService);
|
|
20
21
|
const logSuffix = justLoggingAndNotSending ? " (Not Sent)" : "";
|
|
21
22
|
this.logger = this._register(loggerService.createLogger(id, {
|
|
22
|
-
name: ( localize(
|
|
23
|
+
name: ( localize(2469, "Telemetry{0}", logSuffix)),
|
|
23
24
|
group: TelemetryLogGroup,
|
|
24
25
|
hidden: true
|
|
25
26
|
}));
|
|
@@ -10,6 +10,11 @@ export interface ITelemetryServiceConfig {
|
|
|
10
10
|
sendErrorTelemetry?: boolean;
|
|
11
11
|
commonProperties?: ICommonProperties;
|
|
12
12
|
piiPaths?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* A fixed telemetry level for processes that receive the resolved level from their launcher.
|
|
15
|
+
* When provided, the service does not read or observe telemetry settings.
|
|
16
|
+
*/
|
|
17
|
+
telemetryLevel?: TelemetryLevel;
|
|
13
18
|
/**
|
|
14
19
|
* If true, telemetry events will be buffered until setExperimentProperty is called
|
|
15
20
|
* (up to 10 seconds) to ensure experiment context is attached to all events.
|
|
@@ -21,7 +26,6 @@ export interface ITelemetryServiceConfig {
|
|
|
21
26
|
meteredConnectionService?: IMeteredConnectionService;
|
|
22
27
|
}
|
|
23
28
|
export declare class TelemetryService implements ITelemetryService {
|
|
24
|
-
private _configurationService;
|
|
25
29
|
private _productService;
|
|
26
30
|
static readonly IDLE_START_EVENT_NAME = "UserIdleStart";
|
|
27
31
|
static readonly IDLE_STOP_EVENT_NAME = "UserIdleStop";
|
|
@@ -33,7 +37,6 @@ export declare class TelemetryService implements ITelemetryService {
|
|
|
33
37
|
readonly sqmId: string;
|
|
34
38
|
readonly devDeviceId: string;
|
|
35
39
|
readonly firstSessionDate: string;
|
|
36
|
-
readonly msftInternal: boolean | undefined;
|
|
37
40
|
private _appenders;
|
|
38
41
|
private _commonProperties;
|
|
39
42
|
private _experimentProperties;
|
|
@@ -46,11 +49,18 @@ export declare class TelemetryService implements ITelemetryService {
|
|
|
46
49
|
private _flushTimeout;
|
|
47
50
|
private readonly _disposables;
|
|
48
51
|
private _cleanupPatterns;
|
|
49
|
-
|
|
52
|
+
static createWithLevel(config: ITelemetryServiceConfig & {
|
|
53
|
+
telemetryLevel: TelemetryLevel;
|
|
54
|
+
}, productService: IProductService): TelemetryService;
|
|
55
|
+
constructor(config: ITelemetryServiceConfig & {
|
|
56
|
+
telemetryLevel: TelemetryLevel;
|
|
57
|
+
}, configurationService: undefined, productService: IProductService);
|
|
58
|
+
constructor(config: ITelemetryServiceConfig, configurationService: IConfigurationService, productService: IProductService);
|
|
50
59
|
setExperimentProperty(name: string, value: string): void;
|
|
51
|
-
setCommonProperty(name: string, value: string | boolean): void;
|
|
60
|
+
setCommonProperty(name: string, value: string | boolean | undefined): void;
|
|
52
61
|
private _flushPendingEvents;
|
|
53
62
|
private _updateTelemetryLevel;
|
|
63
|
+
get msftInternal(): boolean | undefined;
|
|
54
64
|
get sendErrorTelemetry(): boolean;
|
|
55
65
|
get telemetryLevel(): TelemetryLevel;
|
|
56
66
|
dispose(): void;
|
|
@@ -12,7 +12,7 @@ import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/com
|
|
|
12
12
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
13
13
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
14
14
|
import { TelemetryLevel, TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_CRASH_REPORTER_SETTING_ID, TelemetryConfiguration, TELEMETRY_SECTION_ID } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry';
|
|
15
|
-
import {
|
|
15
|
+
import { getTelemetryLevel, TelemetryTrustedValue, cleanData } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
16
16
|
|
|
17
17
|
var TelemetryService_1;
|
|
18
18
|
let TelemetryService = class TelemetryService {
|
|
@@ -31,8 +31,10 @@ let TelemetryService = class TelemetryService {
|
|
|
31
31
|
static {
|
|
32
32
|
this.MAX_BUFFER_SIZE = 1000;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
static createWithLevel(config, productService) {
|
|
35
|
+
return ( new TelemetryService_1(config, undefined, productService));
|
|
36
|
+
}
|
|
37
|
+
constructor(config, configurationService, _productService) {
|
|
36
38
|
this._productService = _productService;
|
|
37
39
|
this._experimentProperties = {};
|
|
38
40
|
this._pendingEvents = [];
|
|
@@ -46,7 +48,6 @@ let TelemetryService = class TelemetryService {
|
|
|
46
48
|
this.sqmId = this._commonProperties["common.sqmId"];
|
|
47
49
|
this.devDeviceId = this._commonProperties["common.devDeviceId"];
|
|
48
50
|
this.firstSessionDate = this._commonProperties["common.firstSessionDate"];
|
|
49
|
-
this.msftInternal = this._commonProperties["common.msftInternal"];
|
|
50
51
|
this._piiPaths = config.piiPaths || [];
|
|
51
52
|
this._telemetryLevel = TelemetryLevel.USAGE;
|
|
52
53
|
this._sendErrorTelemetry = !!config.sendErrorTelemetry;
|
|
@@ -58,13 +59,22 @@ let TelemetryService = class TelemetryService {
|
|
|
58
59
|
this._cleanupPatterns.push(( new RegExp(escapeRegExpCharacters(piiPath.replace(/\\/g, "/")), "gi")));
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
62
|
+
if (config.telemetryLevel !== undefined) {
|
|
63
|
+
this._updateTelemetryLevel(config.telemetryLevel);
|
|
64
|
+
} else {
|
|
65
|
+
if (!configurationService) {
|
|
66
|
+
throw ( new Error(
|
|
67
|
+
"TelemetryService requires a configuration service or a fixed telemetry level."
|
|
68
|
+
));
|
|
66
69
|
}
|
|
67
|
-
|
|
70
|
+
this._updateTelemetryLevel(getTelemetryLevel(configurationService));
|
|
71
|
+
this._disposables.add(configurationService.onDidChangeConfiguration(e => {
|
|
72
|
+
const affectsTelemetryConfig = e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID) || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID);
|
|
73
|
+
if (affectsTelemetryConfig) {
|
|
74
|
+
this._updateTelemetryLevel(getTelemetryLevel(configurationService));
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
68
78
|
if (config.waitForExperimentProperties) {
|
|
69
79
|
this._flushTimeout = setTimeout(() => this._flushPendingEvents(), TelemetryService_1.BUFFER_FLUSH_TIMEOUT);
|
|
70
80
|
} else {
|
|
@@ -78,7 +88,11 @@ let TelemetryService = class TelemetryService {
|
|
|
78
88
|
}
|
|
79
89
|
}
|
|
80
90
|
setCommonProperty(name, value) {
|
|
81
|
-
|
|
91
|
+
if (value === undefined) {
|
|
92
|
+
delete this._commonProperties[name];
|
|
93
|
+
} else {
|
|
94
|
+
this._commonProperties[name] = value;
|
|
95
|
+
}
|
|
82
96
|
}
|
|
83
97
|
_flushPendingEvents() {
|
|
84
98
|
if (this._isExperimentPropertySet) {
|
|
@@ -94,8 +108,7 @@ let TelemetryService = class TelemetryService {
|
|
|
94
108
|
}
|
|
95
109
|
this._pendingEvents = [];
|
|
96
110
|
}
|
|
97
|
-
_updateTelemetryLevel() {
|
|
98
|
-
let level = getTelemetryLevel(this._configurationService);
|
|
111
|
+
_updateTelemetryLevel(level) {
|
|
99
112
|
const collectableTelemetry = this._productService.enabledTelemetryLevels;
|
|
100
113
|
if (collectableTelemetry) {
|
|
101
114
|
this._sendErrorTelemetry = this.sendErrorTelemetry ? collectableTelemetry.error : false;
|
|
@@ -104,6 +117,9 @@ let TelemetryService = class TelemetryService {
|
|
|
104
117
|
}
|
|
105
118
|
this._telemetryLevel = level;
|
|
106
119
|
}
|
|
120
|
+
get msftInternal() {
|
|
121
|
+
return this._commonProperties["common.msftInternal"];
|
|
122
|
+
}
|
|
107
123
|
get sendErrorTelemetry() {
|
|
108
124
|
return this._sendErrorTelemetry;
|
|
109
125
|
}
|
|
@@ -164,28 +180,28 @@ let TelemetryService = class TelemetryService {
|
|
|
164
180
|
TelemetryService = TelemetryService_1 = ( __decorate([( __param(1, IConfigurationService)), ( __param(2, IProductService))], TelemetryService));
|
|
165
181
|
function getTelemetryLevelSettingDescription() {
|
|
166
182
|
const telemetryText = ( localize(
|
|
167
|
-
|
|
183
|
+
2470,
|
|
168
184
|
"Controls {0} telemetry, first-party extension telemetry, and participating third-party extension telemetry. Some third party extensions might not respect this setting. Consult the specific extension's documentation to be sure. Telemetry helps us better understand how {0} is performing, where improvements need to be made, and how features are being used.",
|
|
169
185
|
product.nameLong
|
|
170
186
|
));
|
|
171
187
|
const externalLinksStatement = !product.privacyStatementUrl ? ( localize(
|
|
172
|
-
|
|
188
|
+
2471,
|
|
173
189
|
"Read more about the [data we collect]({0}).",
|
|
174
190
|
"https://aka.ms/vscode-telemetry"
|
|
175
191
|
)) : ( localize(
|
|
176
|
-
|
|
192
|
+
2472,
|
|
177
193
|
"Read more about the [data we collect]({0}) and our [privacy statement]({1}).",
|
|
178
194
|
"https://aka.ms/vscode-telemetry",
|
|
179
195
|
product.privacyStatementUrl
|
|
180
196
|
));
|
|
181
197
|
const restartString = !isWeb ? ( localize(
|
|
182
|
-
|
|
198
|
+
2473,
|
|
183
199
|
"A full restart of the application is necessary for crash reporting changes to take effect."
|
|
184
200
|
)) : "";
|
|
185
|
-
const crashReportsHeader = ( localize(
|
|
186
|
-
const errorsHeader = ( localize(
|
|
187
|
-
const usageHeader = ( localize(
|
|
188
|
-
const telemetryTableDescription = ( localize(
|
|
201
|
+
const crashReportsHeader = ( localize(2474, "Crash Reports"));
|
|
202
|
+
const errorsHeader = ( localize(2475, "Error Telemetry"));
|
|
203
|
+
const usageHeader = ( localize(2476, "Usage Data"));
|
|
204
|
+
const telemetryTableDescription = ( localize(2477, "The following table outlines the data sent with each setting:"));
|
|
189
205
|
const telemetryTable = `
|
|
190
206
|
| | ${crashReportsHeader} | ${errorsHeader} | ${usageHeader} |
|
|
191
207
|
|:------|:-------------:|:---------------:|:----------:|
|
|
@@ -195,7 +211,7 @@ function getTelemetryLevelSettingDescription() {
|
|
|
195
211
|
| off | - | - | - |
|
|
196
212
|
`;
|
|
197
213
|
const deprecatedSettingNote = ( localize(
|
|
198
|
-
|
|
214
|
+
2478,
|
|
199
215
|
"****Note:*** If this setting is 'off', no telemetry will be sent regardless of other telemetry settings. If this setting is set to anything except 'off' and telemetry is disabled with deprecated settings, no telemetry will be sent.*"
|
|
200
216
|
));
|
|
201
217
|
const telemetryDescription = `
|
|
@@ -217,7 +233,7 @@ configurationRegistry.registerConfiguration({
|
|
|
217
233
|
"id": TELEMETRY_SECTION_ID,
|
|
218
234
|
"order": 1,
|
|
219
235
|
"type": "object",
|
|
220
|
-
"title": ( localize(
|
|
236
|
+
"title": ( localize(2479, "Telemetry")),
|
|
221
237
|
"properties": {
|
|
222
238
|
[TELEMETRY_SETTING_ID]: {
|
|
223
239
|
"type": "string",
|
|
@@ -227,7 +243,7 @@ configurationRegistry.registerConfiguration({
|
|
|
227
243
|
TelemetryConfiguration.CRASH,
|
|
228
244
|
TelemetryConfiguration.OFF
|
|
229
245
|
],
|
|
230
|
-
"enumDescriptions": [( localize(
|
|
246
|
+
"enumDescriptions": [( localize(2480, "Sends usage data, errors, and crash reports.")), ( localize(2481, "Sends general error telemetry and crash reports.")), ( localize(2482, "Sends OS level crash reports.")), ( localize(2483, "Disables all product telemetry."))],
|
|
231
247
|
"markdownDescription": getTelemetryLevelSettingDescription(),
|
|
232
248
|
"default": TelemetryConfiguration.ON,
|
|
233
249
|
"restricted": true,
|
|
@@ -240,20 +256,20 @@ configurationRegistry.registerConfiguration({
|
|
|
240
256
|
localization: {
|
|
241
257
|
description: {
|
|
242
258
|
key: "telemetry.telemetryLevel.policyDescription",
|
|
243
|
-
value: ( localize(
|
|
259
|
+
value: ( localize(2484, "Controls the level of telemetry."))
|
|
244
260
|
},
|
|
245
261
|
enumDescriptions: [{
|
|
246
262
|
key: "telemetry.telemetryLevel.default",
|
|
247
|
-
value: ( localize(
|
|
263
|
+
value: ( localize(2480, "Sends usage data, errors, and crash reports."))
|
|
248
264
|
}, {
|
|
249
265
|
key: "telemetry.telemetryLevel.error",
|
|
250
|
-
value: ( localize(
|
|
266
|
+
value: ( localize(2481, "Sends general error telemetry and crash reports."))
|
|
251
267
|
}, {
|
|
252
268
|
key: "telemetry.telemetryLevel.crash",
|
|
253
|
-
value: ( localize(
|
|
269
|
+
value: ( localize(2482, "Sends OS level crash reports."))
|
|
254
270
|
}, {
|
|
255
271
|
key: "telemetry.telemetryLevel.off",
|
|
256
|
-
value: ( localize(
|
|
272
|
+
value: ( localize(2483, "Disables all product telemetry."))
|
|
257
273
|
}]
|
|
258
274
|
}
|
|
259
275
|
}
|
|
@@ -262,7 +278,7 @@ configurationRegistry.registerConfiguration({
|
|
|
262
278
|
type: "boolean",
|
|
263
279
|
default: true,
|
|
264
280
|
description: ( localize(
|
|
265
|
-
|
|
281
|
+
2485,
|
|
266
282
|
"Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
|
|
267
283
|
)),
|
|
268
284
|
policy: {
|
|
@@ -273,7 +289,7 @@ configurationRegistry.registerConfiguration({
|
|
|
273
289
|
description: {
|
|
274
290
|
key: "telemetry.feedback.enabled",
|
|
275
291
|
value: ( localize(
|
|
276
|
-
|
|
292
|
+
2485,
|
|
277
293
|
"Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
|
|
278
294
|
))
|
|
279
295
|
}
|
|
@@ -283,11 +299,11 @@ configurationRegistry.registerConfiguration({
|
|
|
283
299
|
[TELEMETRY_OLD_SETTING_ID]: {
|
|
284
300
|
"type": "boolean",
|
|
285
301
|
"markdownDescription": !product.privacyStatementUrl ? ( localize(
|
|
286
|
-
|
|
302
|
+
2486,
|
|
287
303
|
"Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.",
|
|
288
304
|
product.nameLong
|
|
289
305
|
)) : ( localize(
|
|
290
|
-
|
|
306
|
+
2487,
|
|
291
307
|
"Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.",
|
|
292
308
|
product.nameLong,
|
|
293
309
|
product.privacyStatementUrl
|
|
@@ -295,7 +311,7 @@ configurationRegistry.registerConfiguration({
|
|
|
295
311
|
"default": true,
|
|
296
312
|
"restricted": true,
|
|
297
313
|
"markdownDeprecationMessage": ( localize(
|
|
298
|
-
|
|
314
|
+
2488,
|
|
299
315
|
"If this setting is false, no telemetry will be sent regardless of the new setting's value. Deprecated in favor of the {0} setting.",
|
|
300
316
|
`\`#${TELEMETRY_SETTING_ID}#\``
|
|
301
317
|
)),
|
|
@@ -82,7 +82,7 @@ function createAiStatsChart(options) {
|
|
|
82
82
|
text.setAttribute("text-anchor", "middle");
|
|
83
83
|
text.setAttribute("fill", asCssVariable(chartsForeground));
|
|
84
84
|
text.setAttribute("font-size", "11px");
|
|
85
|
-
text.textContent = ( localize(
|
|
85
|
+
text.textContent = ( localize(12150, "No data yet"));
|
|
86
86
|
g.appendChild(text);
|
|
87
87
|
return container;
|
|
88
88
|
}
|
|
@@ -36,8 +36,8 @@ let AiStatsStatusBar = class AiStatsStatusBar extends Disposable {
|
|
|
36
36
|
const statusBarItem = this._createStatusBar().keepUpdated(reader.store);
|
|
37
37
|
const store = this._register(( new DisposableStore()));
|
|
38
38
|
reader.store.add(this._statusbarService.addEntry({
|
|
39
|
-
name: ( localize(
|
|
40
|
-
ariaLabel: ( localize(
|
|
39
|
+
name: ( localize(12151, "Inline Suggestions")),
|
|
40
|
+
ariaLabel: ( localize(12152, "Inline suggestions status bar")),
|
|
41
41
|
text: "",
|
|
42
42
|
tooltip: {
|
|
43
43
|
element: async _token => {
|
|
@@ -140,7 +140,7 @@ function createAiStatsHover(options) {
|
|
|
140
140
|
style: {
|
|
141
141
|
flex: 1
|
|
142
142
|
}
|
|
143
|
-
}, [( localize(
|
|
143
|
+
}, [( localize(12153, "AI Usage Statistics"))]), n.div({
|
|
144
144
|
style: {
|
|
145
145
|
marginLeft: "auto"
|
|
146
146
|
}
|
|
@@ -151,7 +151,7 @@ function createAiStatsHover(options) {
|
|
|
151
151
|
enabled: true,
|
|
152
152
|
run: options.onOpenSettings,
|
|
153
153
|
class: ThemeIcon.asClassName(Codicon.gear),
|
|
154
|
-
tooltip: ( localize(
|
|
154
|
+
tooltip: ( localize(12154, "Configure"))
|
|
155
155
|
},
|
|
156
156
|
options: {
|
|
157
157
|
icon: true,
|
|
@@ -167,13 +167,13 @@ function createAiStatsHover(options) {
|
|
|
167
167
|
flex: 1,
|
|
168
168
|
paddingRight: "4px"
|
|
169
169
|
}
|
|
170
|
-
}, [( localize(
|
|
170
|
+
}, [( localize(12155, "AI vs Typing Average: {0}", aiRatePercent.get()))])]), n.div({
|
|
171
171
|
style: {
|
|
172
172
|
flex: 1,
|
|
173
173
|
paddingRight: "4px"
|
|
174
174
|
}
|
|
175
175
|
}, [( localize(
|
|
176
|
-
|
|
176
|
+
12156,
|
|
177
177
|
"Accepted inline suggestions today: {0}",
|
|
178
178
|
options.data.acceptedInlineSuggestionsToday.get()
|
|
179
179
|
))]),
|
|
@@ -195,14 +195,14 @@ function createAiStatsHover(options) {
|
|
|
195
195
|
style: {
|
|
196
196
|
flex: 1
|
|
197
197
|
}
|
|
198
|
-
}, [( chartViewMode.map(mode => mode === "days" ? ( localize(
|
|
198
|
+
}, [( chartViewMode.map(mode => mode === "days" ? ( localize(12157, "AI Rate by Day")) : ( localize(12158, "AI Rate by Session"))))]), n.div({
|
|
199
199
|
class: "chart-view-toggle",
|
|
200
200
|
style: {
|
|
201
201
|
marginLeft: "auto",
|
|
202
202
|
display: "flex",
|
|
203
203
|
gap: "2px"
|
|
204
204
|
}
|
|
205
|
-
}, [createToggleButton("days", ( localize(
|
|
205
|
+
}, [createToggleButton("days", ( localize(12159, "Days")), Codicon.calendar), createToggleButton("sessions", ( localize(12160, "Sessions")), Codicon.listFlat)])]),
|
|
206
206
|
derived(reader => {
|
|
207
207
|
const sessions = options.data.sessions.read(reader);
|
|
208
208
|
const viewMode = chartViewMode.read(reader);
|