2021-07-06 20:03:40 +00:00
module . exports = {
friendlyName : 'Receive usage analytics' ,
2021-09-17 03:33:25 +00:00
description : 'Receive anonymous usage analytics from deployments of Fleet running in production. (Not fleetctl preview or dev-mode deployments.)' ,
2021-07-06 20:03:40 +00:00
inputs : {
2021-12-06 20:39:00 +00:00
anonymousIdentifier : { required : true , type : 'string' , example : '9pnzNmrES3mQG66UQtd29cYTiX2+fZ4CYxDvh495720=' , description : 'An anonymous identifier telling us which Fleet deployment this is.' , } ,
2021-07-06 20:03:40 +00:00
fleetVersion : { required : true , type : 'string' , example : 'x.x.x' } ,
2021-12-06 20:39:00 +00:00
licenseTier : { type : 'string' , isIn : [ 'free' , 'premium' , 'unknown' ] , defaultsTo : 'unknown' } ,
2021-07-06 20:03:40 +00:00
numHostsEnrolled : { required : true , type : 'number' , min : 0 , custom : ( num ) => Math . floor ( num ) === num } ,
2021-12-06 20:39:00 +00:00
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 } ,
2022-06-22 19:20:57 +00:00
numWeeklyActiveUsers : { type : 'number' , defaultsTo : 0 } ,
2022-06-22 20:38:11 +00:00
hostsEnrolledByOperatingSystem : { type : 'json' , defaultsTo : { } } ,
2022-06-28 19:31:14 +00:00
storedErrors : { type : 'json' , defaultsTo : '[]' } ,
2022-07-21 01:53:19 +00:00
numHostsNotResponding : { type : 'number' , defaultsTo : 0 , description : 'The number of hosts per deployment that have not submitted results for distibuted queries. A host is counted as not responding if Fleet hasn\'t received a distributed write to requested distibuted queries for the host during the 2-hour interval since the host was last seen. Hosts that have not been seen for 7 days or more are not counted.' , } ,
2022-08-03 18:44:34 +00:00
organization : { type : 'string' , defaultsTo : 'unknown' , description : 'For Fleet Premium deployments, the organization registered with the license.' , } ,
2021-07-06 20:03:40 +00:00
} ,
exits : {
success : { description : 'Analytics data was stored successfully.' } ,
} ,
2021-12-06 20:39:00 +00:00
fn : async function ( inputs ) {
2021-07-06 20:03:40 +00:00
2021-12-06 20:39:00 +00:00
await HistoricalUsageSnapshot . create ( inputs ) ;
2021-07-06 20:03:40 +00:00
}
} ;