Skip to content

Commit

Permalink
common: Collect architecture as a common property
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Nov 18, 2021
1 parent bdbab89 commit 4d7a45b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/browser/telemetryReporter.ts
Expand Up @@ -68,6 +68,10 @@ export default class TelemetryReporter extends BaseTelemetryReporter {
if (key && key.indexOf("AIF-") === 0) {
firstParty = true;
}
super(extensionId, extensionVersion, appender, { release: navigator.appVersion, platform: "web" }, firstParty);
super(extensionId, extensionVersion, appender, {
release: navigator.appVersion,
platform: "web",
architecture: "web",
}, firstParty);
}
}
4 changes: 3 additions & 1 deletion src/common/baseTelemetryReporter.ts
Expand Up @@ -28,7 +28,7 @@ export class BaseTelemetryReporter {
private extensionId: string,
private extensionVersion: string,
private telemetryAppender: ITelemetryAppender,
private osShim: { release: string, platform: string },
private osShim: { release: string, platform: string, architecture: string },
firstParty?: boolean
) {

Expand Down Expand Up @@ -132,6 +132,7 @@ export class BaseTelemetryReporter {
}

// __GDPR__COMMON__ "common.os" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
// __GDPR__COMMON__ "common.arch" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
// __GDPR__COMMON__ "common.platformversion" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
// __GDPR__COMMON__ "common.extname" : { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
// __GDPR__COMMON__ "common.extversion" : { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
Expand All @@ -145,6 +146,7 @@ export class BaseTelemetryReporter {
private getCommonProperties(): TelemetryEventProperties {
const commonProperties = Object.create(null);
commonProperties["common.os"] = this.osShim.platform;
commonProperties["common.arch"] = this.osShim.architecture;
commonProperties["common.platformversion"] = (this.osShim.release || "").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/, "$1$2$3");
commonProperties["common.extname"] = this.extensionId;
commonProperties["common.extversion"] = this.extensionVersion;
Expand Down
6 changes: 5 additions & 1 deletion src/node/telemetryReporter.ts
Expand Up @@ -76,6 +76,10 @@ export default class TelemetryReporter extends BaseTelemetryReporter {
if (key && key.indexOf("AIF-") === 0) {
firstParty = true;
}
super(extensionId, extensionVersion, appender, { release: os.release(), platform: os.platform() }, firstParty);
super(extensionId, extensionVersion, appender, {
release: os.release(),
platform: os.platform(),
architecture: os.arch(),
}, firstParty);
}
}

0 comments on commit 4d7a45b

Please sign in to comment.