diff --git a/src/main/ScratchDesktopTelemetry.js b/src/main/ScratchDesktopTelemetry.js index 314f458..ec27205 100644 --- a/src/main/ScratchDesktopTelemetry.js +++ b/src/main/ScratchDesktopTelemetry.js @@ -1,10 +1,11 @@ import {app, ipcMain} from 'electron'; import defaultsDeep from 'lodash.defaultsdeep'; +import {version} from '../../package.json'; import TelemetryClient from './telemetry/TelemetryClient'; const EVENT_TEMPLATE = { - version: '3.0.0', + version, projectName: '', language: '', metadata: { diff --git a/src/main/telemetry/TelemetryClient.js b/src/main/telemetry/TelemetryClient.js index de94505..6a9979d 100644 --- a/src/main/telemetry/TelemetryClient.js +++ b/src/main/telemetry/TelemetryClient.js @@ -1,5 +1,6 @@ import ElectronStore from 'electron-store'; import nets from 'nets'; +import * as os from 'os'; import uuidv1 from 'uuid/v1'; // semi-persistent client ID import uuidv4 from 'uuid/v4'; // random ID @@ -17,7 +18,7 @@ import uuidv4 from 'uuid/v4'; // random ID * Default telemetry service URLs */ const TelemetryServerURL = Object.freeze({ - staging: 'http://scratch-telemetry-s.us-east-1.elasticbeanstalk.com/', + staging: 'http://scratch-telemetry-staging.us-east-1.elasticbeanstalk.com/', production: 'https://telemetry.scratch.mit.edu/' }); const DefaultServerURL = ( @@ -49,6 +50,12 @@ const DefaultQueueLimit = 100; */ const DeliveryAttemptLimit = 3; +const platform = [ + `${os.platform()} ${os.release()}`, // "win32 10.0.18362", "darwin 18.7.0", etc. + `Electron ${process.versions.electron}`, // "Electron 4.2.6" + `Store=${process.mas || process.windowsStore || false}` // "Store=true" or "Store=false" +].join(', '); + /** * Client interface for the Scratch telemetry service. @@ -213,6 +220,7 @@ class TelemetryClient { clientID: this.clientID, id: packetId, name: eventName, + platform, timestamp: now.getTime(), userTimezone: now.getTimezoneOffset() }, additionalFields);