mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Update events for insiders (#6807)
* Update events for insiders * Add back in isBuilt check
This commit is contained in:
@@ -70,7 +70,7 @@ interface ISharedProcessInitData {
|
|||||||
logLevel: LogLevel;
|
logLevel: LogLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
const eventPrefix = 'monacoworkbench';
|
const eventPrefix = product.quality !== 'stable' ? 'adsworkbench' : 'monacoworkbench'; // {{ SQL CARBON EDIT }}
|
||||||
|
|
||||||
class MainProcessService implements IMainProcessService {
|
class MainProcessService implements IMainProcessService {
|
||||||
constructor(private server: Server, private mainRouter: StaticRouter) { }
|
constructor(private server: Server, private mainRouter: StaticRouter) { }
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ export class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const eventPrefix = 'monacoworkbench';
|
const eventPrefix = product.quality !== 'stable' ? 'adsworkbench' : 'monacoworkbench';
|
||||||
|
|
||||||
export async function main(argv: ParsedArgs): Promise<void> {
|
export async function main(argv: ParsedArgs): Promise<void> {
|
||||||
const services = new ServiceCollection();
|
const services = new ServiceCollection();
|
||||||
|
|||||||
@@ -14,15 +14,25 @@ const productObject = product;
|
|||||||
|
|
||||||
export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | undefined; }> {
|
export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | undefined; }> {
|
||||||
const result: { [name: string]: string | undefined; } = Object.create(null);
|
const result: { [name: string]: string | undefined; } = Object.create(null);
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
// __GDPR__COMMON__ "common.machineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
|
if (productObject.quality !== 'stable') {
|
||||||
result['common.machineId'] = '';
|
// __GDPR__COMMON__ "common.machineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
|
||||||
// __GDPR__COMMON__ "sessionID" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
result['common.machineId'] = machineId;
|
||||||
result['sessionID'] = '';
|
// __GDPR__COMMON__ "sessionID" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
result['sessionID'] = uuid.generateUuid() + Date.now();
|
||||||
|
// __GDPR__COMMON__ "commitHash" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
|
result['commitHash'] = commit;
|
||||||
|
} else {
|
||||||
|
// __GDPR__COMMON__ "common.machineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
|
||||||
|
// result['common.machineId'] = machineId;
|
||||||
|
result['common.machineId'] = '';
|
||||||
|
// // __GDPR__COMMON__ "sessionID" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
// result['sessionID'] = uuid.generateUuid() + Date.now();
|
||||||
|
result['sessionID'] = '';
|
||||||
|
// __GDPR__COMMON__ "commitHash" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
result['commitHash'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
// __GDPR__COMMON__ "commitHash" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
|
||||||
result['commitHash'] = '';
|
|
||||||
// __GDPR__COMMON__ "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
// __GDPR__COMMON__ "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
result['version'] = version;
|
result['version'] = version;
|
||||||
// __GDPR__COMMON__ "common.platformVersion" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
// __GDPR__COMMON__ "common.platformVersion" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
@@ -34,9 +44,8 @@ export async function resolveCommonProperties(commit: string | undefined, versio
|
|||||||
// __GDPR__COMMON__ "common.nodeArch" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
// __GDPR__COMMON__ "common.nodeArch" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
result['common.nodeArch'] = process.arch;
|
result['common.nodeArch'] = process.arch;
|
||||||
// __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
// __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
// {{SQL CARBON EDIT}}
|
result['common.product'] = productObject.nameShort || 'desktop'; // {{SQL CARBON EDIT}}
|
||||||
result['common.product'] = productObject.nameShort || 'desktop';
|
result['common.application.name'] = productObject.nameLong; // {{SQL CARBON EDIT}}
|
||||||
result['common.application.name'] = productObject.nameLong;
|
|
||||||
|
|
||||||
// dynamic properties which value differs on each call
|
// dynamic properties which value differs on each call
|
||||||
let seq = 0;
|
let seq = 0;
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper
|
|||||||
import { instanceStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry';
|
import { instanceStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtils';
|
import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
|
|
||||||
// {{ SQL CARBON EDIT }}
|
import product from 'vs/platform/product/node/product'; // {{ SQL CARBON EDIT }}
|
||||||
import product from 'vs/platform/product/node/product';
|
|
||||||
|
|
||||||
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> {
|
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> {
|
||||||
const result = await resolveCommonProperties(commit, version, machineId, installSourcePath);
|
const result = await resolveCommonProperties(commit, version, machineId, installSourcePath);
|
||||||
@@ -17,27 +16,41 @@ export async function resolveWorkbenchCommonProperties(storageService: IStorageS
|
|||||||
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
|
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||||
const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!;
|
const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||||
|
|
||||||
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
if (product.quality !== 'stable') {
|
||||||
// result['common.version.shell'] = process.versions && process.versions['electron'];
|
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
result['common.version.shell'] = process.versions && process.versions['electron'];
|
||||||
// result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
||||||
// result['common.firstSessionDate'] = firstSessionDate;
|
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
result['common.firstSessionDate'] = firstSessionDate;
|
||||||
// result['common.lastSessionDate'] = lastSessionDate || '';
|
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
result['common.lastSessionDate'] = lastSessionDate || '';
|
||||||
// result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||||
// result['common.instanceId'] = instanceId;
|
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
// __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
result['common.instanceId'] = instanceId;
|
||||||
// result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority);
|
// __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
|
result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority);
|
||||||
|
} else {
|
||||||
|
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
|
// result['common.version.shell'] = process.versions && process.versions['electron'];
|
||||||
|
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
|
// result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
||||||
|
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
// result['common.firstSessionDate'] = firstSessionDate;
|
||||||
|
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
// result['common.lastSessionDate'] = lastSessionDate || '';
|
||||||
|
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
// result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||||
|
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
// result['common.instanceId'] = instanceId;
|
||||||
|
// __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||||
|
// result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority);
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
result['common.userId'] = ''; // {{SQL CARBON EDIT}}
|
||||||
result['common.application.name'] = product.nameLong;
|
}
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
result['common.userId'] = '';
|
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
result['common.application.name'] = product.nameLong; // {{SQL CARBON EDIT}}
|
||||||
setUsageDates(storageService);
|
setUsageDates(storageService);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import { ApplicationInsights } from '@microsoft/applicationinsights-web';
|
|||||||
export class WebTelemetryAppender implements ITelemetryAppender {
|
export class WebTelemetryAppender implements ITelemetryAppender {
|
||||||
private _aiClient?: ApplicationInsights;
|
private _aiClient?: ApplicationInsights;
|
||||||
|
|
||||||
constructor(aiKey: string, private _logService: ILogService) {
|
constructor(aiKey: string, private _logService: ILogService
|
||||||
|
, @IWorkbenchEnvironmentService private _environmentService: IWorkbenchEnvironmentService) { // {{ SQL CARBON EDIT }}
|
||||||
const initConfig = {
|
const initConfig = {
|
||||||
config: {
|
config: {
|
||||||
instrumentationKey: aiKey,
|
instrumentationKey: aiKey,
|
||||||
@@ -44,8 +45,10 @@ export class WebTelemetryAppender implements ITelemetryAppender {
|
|||||||
data = validateTelemetryData(data);
|
data = validateTelemetryData(data);
|
||||||
this._logService.trace(`telemetry/${eventName}`, data);
|
this._logService.trace(`telemetry/${eventName}`, data);
|
||||||
|
|
||||||
|
// {{ SQL CARBON EDIT }}
|
||||||
|
const eventPrefix = this._environmentService.appQuality !== 'stable' ? 'adsworkbench/' : 'monacoworkbench/';
|
||||||
this._aiClient.trackEvent({
|
this._aiClient.trackEvent({
|
||||||
name: 'monacoworkbench/' + eventName,
|
name: eventPrefix + eventName,
|
||||||
properties: data.properties,
|
properties: data.properties,
|
||||||
measurements: data.measurements
|
measurements: data.measurements
|
||||||
});
|
});
|
||||||
@@ -82,7 +85,7 @@ export class TelemetryService extends Disposable implements ITelemetryService {
|
|||||||
const aiKey = productService.aiConfig && productService.aiConfig.asimovKey;
|
const aiKey = productService.aiConfig && productService.aiConfig.asimovKey;
|
||||||
if (!environmentService.isExtensionDevelopment && !environmentService.args['disable-telemetry'] && !!productService.enableTelemetry && !!aiKey) {
|
if (!environmentService.isExtensionDevelopment && !environmentService.args['disable-telemetry'] && !!productService.enableTelemetry && !!aiKey) {
|
||||||
const config: ITelemetryServiceConfig = {
|
const config: ITelemetryServiceConfig = {
|
||||||
appender: combinedAppender(new WebTelemetryAppender(aiKey, logService), new LogAppender(logService)),
|
appender: combinedAppender(new WebTelemetryAppender(aiKey, logService, environmentService), new LogAppender(logService)),
|
||||||
commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.configuration.remoteAuthority),
|
commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.configuration.remoteAuthority),
|
||||||
piiPaths: [environmentService.appRoot]
|
piiPaths: [environmentService.appRoot]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user