mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Related to #5898, this reports an anonymized summary of errors stored in Redis into the analytics payload. For each error stored, this includes: - A `count` attribute with the number of occurrences of the error - A `loc` attribute with the 3 topmost lines in the stack trace. Note that stack traces only contain package name + line number (example: github.com/fleetdm/fleet/server.go:12 This also includes a minor refactor around error types.
41 lines
1.5 KiB
JavaScript
Vendored
41 lines
1.5 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Receive usage analytics',
|
|
|
|
|
|
description: 'Receive anonymous usage analytics from deployments of Fleet running in production. (Not fleetctl preview or dev-mode deployments.)',
|
|
|
|
|
|
inputs: {
|
|
anonymousIdentifier: { required: true, type: 'string', example: '9pnzNmrES3mQG66UQtd29cYTiX2+fZ4CYxDvh495720=', description: 'An anonymous identifier telling us which Fleet deployment this is.', },
|
|
fleetVersion: { required: true, type: 'string', example: 'x.x.x' },
|
|
licenseTier: { type: 'string', isIn: ['free', 'premium', 'unknown'], defaultsTo: 'unknown' },
|
|
numHostsEnrolled: { required: true, type: 'number', min: 0, custom: (num) => Math.floor(num) === num },
|
|
numUsers: { type: 'number', defaultsTo: 0 },
|
|
numTeams: { type: 'number', defaultsTo: 0 },
|
|
numPolicies: { type: 'number', defaultsTo: 0 },
|
|
numLabels: { type: 'number', defaultsTo: 0 },
|
|
softwareInventoryEnabled: { type: 'boolean', defaultsTo: false },
|
|
vulnDetectionEnabled: { type: 'boolean', defaultsTo: false },
|
|
systemUsersEnabled: { type: 'boolean', defaultsTo: false },
|
|
hostStatusWebhookEnabled: { type: 'boolean', defaultsTo: false },
|
|
numWeeklyActiveUsers: { type: 'number', defaultsTo: 0 },
|
|
hostsEnrolledByOperatingSystem: { type: 'json', defaultsTo: {} },
|
|
storedErrors: { type: 'json', defaultsTo: '[]' },
|
|
},
|
|
|
|
|
|
exits: {
|
|
success: { description: 'Analytics data was stored successfully.' },
|
|
},
|
|
|
|
|
|
fn: async function (inputs) {
|
|
|
|
await HistoricalUsageSnapshot.create(inputs);
|
|
|
|
}
|
|
|
|
|
|
};
|