Co-authored-by: Scott Densmore <scottdensmore@mac.com>
Co-authored-by: matt korwel <mattkorwel@google.com>
Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit refactors the `usageStatisticsEnabled` setting from a sub-property of the `telemetry` configuration to a top-level setting. This change simplifies the configuration by decoupling usage statistics from the telemetry settings.
The documentation has also been updated to reflect this change.
The previous implementation used `flushIfNeeded` to batch most telemetry events, but it was not reliably sending them, leading to data loss. Notably, the `startSession` event, which already used `flushToClearcut`, was working correctly, indicating an issue with the batching logic itself.
This change replaces all calls to `flushIfNeeded` with `flushToClearcut` to align all event logging with the working `startSession` implementation and ensure that events are sent immediately. This prioritizes the reliability of data collection over network efficiency.
This is a temporary solution to prevent further data loss. The underlying issue with the batching mechanism in `flushIfNeeded` should be investigated and fixed in the future, at which point this change can be reverted.
## TLDR
Introduces the `concurrently` package to simplify the dev startup process with GCP telemetry enabled.
## Dive Deeper
Previously, developers had to run the telemetry script and the main application start script in separate terminals. This change updates the `start:gcp` script to use `concurrently`, allowing both processes to be launched and managed with a single command. This improves the developer experience and reduces the chance of forgetting to start one of the required processes.
## Reviewer Test Plan
Set the required environment variable:
```shell
export OTLP_GOOGLE_CLOUD_PROJECT=<your-project-id>
```
Run the following command:
```shell
npm run start:gcp
```
#750
cc @teeler
Moves the telemetry.md file from docs/core to the top-level docs/ directory to make it more discoverable.
Updates the link in the main index.md and removes the old reference from the CLI configuration page.