Commit graph

24 commits

Author SHA1 Message Date
Eric
bafbc05f6d
Website: Add support for new usage statistics (#40879)
Closes: https://github.com/fleetdm/fleet/issues/39836

Changes:
- Added `fleetMaintainedAppsWindows` and `fleetMaintainedAppsMacOS`
attributes to the HistoricalUsageSnapshot model
- Added `fleetMaintainedAppsWindows` and `fleetMaintainedAppsMacOS` as
inputs to the receive-usage-analytics webhook


Note: This pull request requires database migrations and should only be
merged after the website's database is updated while it is in
maintenance mode.
2026-03-06 07:41:50 -06:00
Eric
d5bf210354
Website: Add support for new usage statistic (#28384)
Closes: #28255

Changes:
- Updated the receive-usage-analytics webhook to support a new input
`numHostsABMPending`
- Added a `numHostsABMPending` attribute to the
`HistoricalUsageSnapshot` model
2025-04-24 00:34:21 -05:00
Eric
02b0a97ac8
Website: add support for new usage statistics (#24511)
Changes:
- Updated the receive-usage-analytics webhook to support a new input:
`numQueries`
- Added a new attribute to the HistoricalUsageSnapshot model
`numQueries`
- Added a commented-out section to the
send-aggregated-metrics-to-datadog script.
2024-12-13 15:00:30 -06:00
Eric
4ffde1dc09
Website: add new metrics to HistoricalUsageSnapshot model. (#21625)
Related to: #21259

Changes:
- Updated the `receive-usage-analytics` webhook to add new inputs for
metrics added in [#21131](https://github.com/fleetdm/fleet/pull/21131)
- Updated the `HIstoricalUsageSnapshot` model to add attributes for the
new metrics.


When this PR is merged:
- [ ] Put the website into maintenance mode
- [ ] Update the HistoricalUsageSnapshot table to add new columns
- [ ] Update all existing records to set the default value for the new
columns
2024-08-30 17:13:07 -05:00
Eric
9ea69df576
Website: add new usage statistics (#19315)
Closes: https://github.com/fleetdm/fleet/issues/19308

Changes:
- Added six new attributes to the `HistoricalUsageSnapshot` model (
`numSoftwareVersions`, `numHostSoftwares`, `numSoftwareTitles`,
`numHostSoftwareInstalledPaths`, `numSoftwareCPEs` and
`numSoftwareCVEs`)
- Added inputs to the receive-usage-analytics webhook for the new usage
statistics.


When this PR is merged, we will need to migrate the Fleet website's
database to add the new columns, to do this:
- [x] Make an announcement in Slack to let people know the website will
be offline for ~8 minutes
- [ ] Merge this PR
- [ ] As the deploy action runs, put the website into maintenance mode
- [ ] Add the new columns for the added attributes
- [ ] Set the default value for the new attributes on existing database
records
- [ ] After the deploy workflow is complete, take the website out of
maintenance mode.
2024-06-04 18:36:25 -05:00
Eric
4ee1d0b736
Website: update receive-usage-analytics webhook (#18864)
Related to: https://github.com/fleetdm/fleet/issues/18863

Changes:
- Updated the receive-usage-analytics webhook to set a default value for
organization if a Fleet instance reports an empty string as its
organization.
2024-05-09 08:39:49 -05:00
Eric
b7a85fba48
Website: Update usage analytics sent to Datadog (#16572)
Related to: #16458

Changes:
- Updated the receive-usage-analytics webhook not to send metrics to
Datadog.
- Updated the send-aggregated-metrics-to-datadog script to build
aggregated metrics from the JSON values reported by Fleet instances
(stored errors, host count by orbit version, host count by osquery
version, host count by operating system), and updated the script to not
report metrics from Fleet instances using the development premium
license key.
2024-02-02 17:23:33 -06:00
Eric
f14ab358fe
2023-11-21 Website: Add new usage statistics (#15263)
Closes: #15255

Changes:
- Added the usage statistics added in
https://github.com/fleetdm/fleet/pull/14216 to the inputs of the
`receive-usage-analytics` webhook.
- Updated the `receive-usage-analytics` webhook to send the new usage
statistics to Datadog.
- Added attributes for the new usage statistics to the
`HistoricalUsageSnapshot` model.
- Removed the `columnName` from the `hostsStatusWebHookEnabled`
attribute of the `HistoricalUsageSnapshot` model, the name of this
column will be changed in the database when the new columns are added to
the databse table.
- Updated the usage statistics documentation to have the new statistics.


This PR requires database migrations. When this is approved and ready to
merge, we will need to:
- [ ] Merge this PR
- [ ] Put fleetdm.com into maintenance mode while the "Deploy Fleet
website" GH action runs.
- [ ] Add the new columns to the database table
- [ ] Change the name of the `hostStatusWebhookEnabled` column to
`hostsStatusWebHookEnabled`
- [ ] Set the default values for the new columns on the existing
records.
- [ ] When the website has finished redeploying, take it out of
maintenance mode.
2023-12-01 17:59:41 -06:00
Eric
29671f4249
Website: Update receive-usage-analytics webhook to limit size of requests sent to Datadog. (#15245)
Closes: https://github.com/fleetdm/fleet/issues/15243

Changes:
- Updated the `receive-usage analytics` webhook to send multiple
requests to Datadog, depending on the number of metrics built from
reported usage statistics. (Datadog has a request body limit of 512kb)
2023-11-21 10:15:59 -06:00
Eric
6a6f51dce6
Website: Update usage statistics webhook inputs and HistoricalUsageSnapshot model. (#15180)
Closes: #11812

Changes:
- Renamed the `hostStatusWebhookEnabled` attribute of the
`HistoricalUsageSnapshot` model to `hostsStatusWebHookEnabled` and
updated the definition to use the existing database column name.
- Updated the inputs of the `receive-usage-analytics` webhook to accept
a `hostsStatusWebHookEnabled` input.
- Updated the usage statistics documentation to have the [correct
variable
name](36e12d02e3/server/fleet/statistics.go (L21)).
2023-11-20 15:34:19 -06:00
Eric
9984bc6894
Website: Fix object mutation in receive-usage-analytics webhook. (#15185)
Closes: #15182

Changes:
- Updated the receive-usage-analytics webhook to create new database
records with a cloned `inputs` object. This prevents the JSON attributes
from being mutated into strings.
2023-11-20 12:04:03 -06:00
Eric
1d022e76b6
Website: Fix storedError metric reporting in receive-usage-analytics.js (#11404)
Changes:
- updated `receive-usage-analytics.js` to only try to send metrics for
`storedErrors` if the error objects are in [the format we
expect.](https://fleetdm.com/docs/using-fleet/usage-statistics#what-is-included-in-usage-statistics-in-fleet)
2023-04-27 17:40:10 -05:00
Eric
fe07c39f22
Website: Send custom metrics from anonymous usage statistics to Datadog (#11362)
. 
Closes: #10848 
Changes:
- Updated the `receive-usage-analytics` webhook to send custom metrics
to our Datadog account, where we can create graphs and dashboards to
track Fleet feature adoption, Fleet/osquery/orbit versions in use,
reported host counts, and stored errors.
- Added a new config variable: `sails.config.custom.datadogApiKey`
2023-04-27 16:45:35 -05:00
Eric
f5b60b9667
update hostsEnrolledByOrbitVersion and hostsEnrolledByOsqueryVersion types (#9041) 2022-12-15 18:13:14 -06:00
Eric
6db419001f
Update receive-usage-analytics.js (#8239) 2022-10-14 18:37:31 -05:00
gillespi314
5603ee8114
Add more usage stats to Sails app (#8230) 2022-10-14 13:54:23 -05:00
Martin Angers
012869f971
Fleet Premium: de-anonymize usage stats (#7013) 2022-08-03 14:44:34 -04:00
gillespi314
9a1adeb61b
Update documentation and Sails app for additional usage statistics (#6589) 2022-07-20 20:53:19 -05:00
Roberto Dip
b2d07e56b5
report error analytics (#6341)
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.
2022-06-28 16:31:14 -03:00
Martin Angers
8f66a50f2b
Add hosts enrolled by operating system to anonymous usage stats (#6329) 2022-06-22 16:38:11 -04:00
Martin Angers
dc9e158153
Add weekly active users count in anonymous usage stats (#6317) 2022-06-22 15:20:57 -04:00
gillespi314
6ee6dba4a4
Update anonymous usage statistics to record Fleet feature adoption (#3056)
* Collect additional anonymous usage statistics

* Update fleetdm.com and docs for usage stats

* Fix lint-go errors

* Fix failing test

* update webhook inputs

* Update receive-usage-analytics.js

* fix failing test

* Update statistics_test.go

Co-authored-by: eashaw <[email protected]>
2021-12-06 14:39:00 -06:00
Mike McNeil
62c93eae0d
clarify which Fleet environments receive data when usage analytics are enabled (#2106) 2021-09-16 22:33:25 -05:00
Mike McNeil
00f30c1e84
Fleetbot (#1572)
* Move usage analytics action for the sake of convention

* followup to ed4a500e15 to fix policy mapping

* Add stub of webhook handler for GitHub bot (at this point, a mostly-verbatim copy paste of sailsbot -- will work backwards from this to what we actually need in Fleet)

* Everyone can follow the same rules.  Except bots.  And Noah.

* same as 5c97f47eff

* replace a separate, explicit check for "sailsbot"

* Comment out stuff Fleet is not using for the foreseeable future

* use Fleet's green label color (could switch to "+" prefix as well, just would require tweaking)
2021-08-06 02:52:02 -05:00
Renamed from website/api/controllers/receive-usage-analytics.js (Browse further)