Skip to content

Commit

Permalink
feat: Synth optional de-identified telemetry
Browse files Browse the repository at this point in the history
* Added telemetry

* Added interactive prompt for telemetry install

* Bumped version to 0.4.5

GitOrigin-RevId: 0380a0ce71443db423941f46bbca0afb1cef48a3
  • Loading branch information
christos-h authored and oq-bot committed May 8, 2021
1 parent 26d0705 commit 9245418
Show file tree
Hide file tree
Showing 9 changed files with 644 additions and 175 deletions.
171 changes: 162 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
, release ? true
}:
let
version = "0.4.4";
version = "0.4.5";
darwinBuildInputs =
stdenv.lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
libiconv
Expand Down
85 changes: 85 additions & 0 deletions docs/docs/other/telemetry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Telemetry
---

Synth collects de-identified usage data to help create a better product and user experience.

Synth telemetry is **opt-in**; the user is explicity prompted at installation, asking if they would like to participate
in de-identified data collection.

## Philosophy

Below are a set of principles that guide the telemetry decisions made in Synth:

1. It is made *completely transparent* that telemetry is going to be installed
2. It is made *completely transparent* as to what data we collect
3. No personally identifiable information is collected. (IP addresses are discarded at the Sink)
4. Nothing is collected unless the user explicitly opts-in.

## Enabling / Disabling Telemetry

Synth uses a configuration file under the user configuration directory (e.g. `~/.config/synth/config.json` on typical unix systems) as a marker for telemetry being enabled. This file
also contains the user's randomly generated unique `distinct_id`.

The user is prompted during the installation process about telemetry being enabled.

Users can check if telemetry is enabled by running `synth telemetry status`.

Users can opt-out at any time by running `synth telemetry disable`.

## Where does the data go?

All the telemetry data is collected in a [Posthog](https://posthog.com/) instance run by the maintainers of Synth.

If for whatever reason you would like the data associated with your UUID to be deleted, please contact `[email protected]`.

## What does Synth collect?

Synth's telemetry collects 6 fields:

- `distinct_id`: A randomly generated UUID stored at `~/.config/synth/config.json`
- `command`: The command that was issued by the user. One
of (`init | import | generate | telemetry::enabled | telemetry::disabled`)
- `success`: If the command issued succeeded or failed.
- `version`: The version of Synth being used. For example `v0.4.3`.
- `os`: The host operating system, for example 'linux'
- `timestamp`: The time at which the command was issued. For example `2021-05-06T16:13:40.084Z`.

Below is a Synth schema generates telemetry events:

```json synth
{
"type": "object",
"distinct_id": {
"type": "string",
"uuid": {}
},
"command": {
"type": "string",
"categorical": {
"import": 1,
"generate": 10
}
},
"version": {
"type": "string",
"pattern": "v0\\.4\\.3"
},
"os": {
"type": "string",
"categorical": {
"linux": 10,
"mac os": 1
}
},
"timestamp": {
"type": "string",
"date_time": {
"format": "%Y-%m-%dT%H:%M:%S",
"subtype": "naive_date_time",
"begin": "2015-01-01T00:00:00",
"end": "2020-01-01T12:00:00"
}
}
}
```
Loading

0 comments on commit 9245418

Please sign in to comment.