Skip to content

Commit 3cd8387

Browse files
authored
docs: telemetry #3779
2 parents 21ca0fc + 2548a97 commit 3cd8387

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ end_of_line = lf
88
insert_final_newline = true
99
indent_size = 4
1010
indent_style = space
11+
max_line_length = 100
1112

1213
[*.{js,ts,py}]
1314
charset = utf-8
14-
max_line_length = 100
1515

1616
[Makefile]
1717
indent_style = tab

CONTRIBUTING.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,21 @@ then following the log with:
273273
274274
tail -F ~/awstoolkit.log
275275
276+
### Telemetry
277+
278+
See [aws-toolkit-common/telemetry](https://github.com/aws/aws-toolkit-common/tree/main/telemetry#telemetry) for full details about defining telemetry metrics.
279+
280+
- You can define new metrics during development by adding items to
281+
[telemetry/vscodeTelemetry.json](https://github.com/aws/aws-toolkit-vscode/blob/21ca0fca26d677f105caef81de2638b2e4796804/src/shared/telemetry/vscodeTelemetry.json).
282+
- Building the project will trigger the `generateClients` build task, which generates new symbols in `shared/telemetry/telemetry`, which you can import via:
283+
```
284+
import { telemetry } from '../../shared/telemetry/telemetry'
285+
```
286+
- The metrics defined in `vscodeTelemetry.json` should be upstreamed to [aws-toolkit-common](https://github.com/aws/aws-toolkit-common/blob/main/telemetry/definitions/commonDefinitions.json) after launch (at the latest).
287+
- Metrics are dropped (not posted to the service) if the extension is running in [CI or other
288+
automation tasks](https://github.com/aws/aws-toolkit-vscode/blob/21ca0fca26d677f105caef81de2638b2e4796804/src/shared/vscode/env.ts#L71-L73).
289+
- You can always _test_ telemetry via [assertTelemetry()](https://github.com/aws/aws-toolkit-vscode/blob/21ca0fca26d677f105caef81de2638b2e4796804/src/test/testUtil.ts#L164), regardless of the current environment.
290+
276291
### Service Endpoints
277292
278293
Endpoint overrides can be set per-service using the `aws.dev.endpoints` settings. This is a JSON object where each key is the service ID (case-insensitive) and each value is the endpoint. Refer to the SDK [API models](https://github.com/aws/aws-sdk-js/tree/master/apis) to find relevant service IDs.
@@ -285,13 +300,6 @@ Example:
285300
}
286301
```
287302

288-
### Telemetry and Automation
289-
290-
Metrics are only emitted if the extension is assumed to be ran from an actual user rather than automation scripts.
291-
This condition is checked through an environment variable `AWS_TOOLKIT_AUTOMATION` which is set by test entry points.
292-
If any truthy value is present, telemetry will be dropped if the current build is not a release version. Utility functions,
293-
such as `assertTelemetry`, can be used to test specific telemetry emits even in automation.
294-
295303
### SAM/CFN ("goformation") JSON schema
296304

297305
See [docs/cfn-schema-support.md](./docs/cfn-schema-support.md) for how to fix

0 commit comments

Comments
 (0)