-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metrics): question to activate telemetry + documentation
- Loading branch information
1 parent
7dad11e
commit e2c839e
Showing
13 changed files
with
227 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Telemetry | ||
|
||
You can help the Otter Team to prioritize features and improvements by permitting the Otter team to send command-line command usage statistics to Amadeus. The Otter Team does not collect usage statistics unless you explicitly opt in. | ||
|
||
## What is collected? | ||
|
||
Usage analytics may include the following information: | ||
- Your operating system (macOS, Linux distribution, Windows) and its version. | ||
- Package manager name and version (local version only). | ||
- Node.js version (local version only). | ||
- Otter version (local version only). | ||
- Command name that was run. | ||
- The time it took to run. | ||
- Project name. | ||
- The schematic/builder options. | ||
|
||
> [!WARNING] | ||
> We don't use it but your IP address will also be stored during one month for security reason. | ||
## How to disable telemetry? | ||
|
||
To disable it for: | ||
- your project, set `cli.o3rMetrics` to false in your `package.json`. | ||
- your machine, set `O3R_METRICS` to false in your environment variables. | ||
- a builder/schematic run, run it with `--no-o3r-metrics` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,5 +280,8 @@ | |
"tools/@*/*", | ||
"apps/*" | ||
], | ||
"cli": { | ||
"o3rMetrics": true | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import { noop, Rule } from '@angular-devkit/schematics'; | ||
import type { JsonObject } from '@angular-devkit/core'; | ||
import type { Rule } from '@angular-devkit/schematics'; | ||
import type { NgAddSchematicsSchema } from './schema'; | ||
|
||
/** | ||
* Add Otter telemetry to an Otter Project | ||
* @param options | ||
*/ | ||
export function ngAdd(_options: NgAddSchematicsSchema): Rule { | ||
return noop(); | ||
return (tree, context) => { | ||
if (tree.exists('/package.json')) { | ||
const packageJson = tree.readJson('/package.json') as JsonObject; | ||
packageJson.cli ||= {}; | ||
(packageJson.cli as JsonObject).o3rMetrics = true; | ||
tree.overwrite('/package.json', JSON.stringify(packageJson, null, 2)); | ||
} | ||
context.logger.info(` | ||
By installing '@o3r/telemetry', you have activated the collect of anonymous usage data. | ||
You can deactivate it at any time by changing 'cli.o3rMetrics' in 'package.json' or by setting 'O3R_METRICS' to false as environment variable. | ||
You can also temporarily deactivate it by running your builder or schematic with '--no-o3r-metrics'. | ||
`); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.