Skip to content

Commit 2548a97

Browse files
committed
docs: telemetry
1 parent a959253 commit 2548a97

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

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)