You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
- Not easy to observe telemetry as it happens.
- Telemetry logs could be much more readable with some formatting.
Solution:
- Use new vscode API [LogOutputChannel](https://github.com/microsoft/vscode/blob/aa835c938d2518832a934a7e3124fa761c6f50a0/src/vscode-dts/vscode.d.ts#L10766)
- Add "AWS (Developer): Watch Logs" command which shows logs the vscode
Debug Console (which allows filtering, unlike the Output panel).
microsoft/vscode#52134
- Cleanup the metrics `Metadata` field before logging it.
- Format with "%O" instead of JSON stringify.
Before:
telemetry: emitted metric "aws_expandExplorerNode" -> {"Metadata":[{"Key":"serviceType","Value":"ecs"},{"Key":"awsAccount","Value":"541201481031"},{"Key":"awsRegion","Value":"us-west-2"}],"MetricName":"aws_expandExplorerNode","Value":1,"Unit":"None","Passive":false,"EpochTimestamp":1697147194606}
After:
2023-10-19 14:22:25 [DEBUG]: telemetry: aws_expandExplorerNode {
Metadata: {
serviceType: 'logs',
awsAccount: '541201481031',
awsRegion: 'us-west-2'
},
Value: 1,
Unit: 'None',
Passive: false
}
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,28 +286,36 @@ generating SDKs, etc.
286
286
287
287
### Toolkit developer settings (`aws.dev.*`)
288
288
289
-
The [DevSettngs](https://github.com/aws/aws-toolkit-vscode/blob/479b9d45b5f5ad30fc10567e649b59801053aeba/src/shared/settings.ts#L553) class defines various developer-only settings that change the behavior of the
289
+
The [DevSettings](https://github.com/aws/aws-toolkit-vscode/blob/479b9d45b5f5ad30fc10567e649b59801053aeba/src/shared/settings.ts#L553) class defines various developer-only settings that change the behavior of the
290
290
Toolkit for testing and development purposes. To use a setting just add it to
291
291
your `settings.json`. At runtime, if the Toolkit reads any of these settings,
292
292
the "AWS" statusbar item will [change its color](https://github.com/aws/aws-toolkit-vscode/blob/479b9d45b5f5ad30fc10567e649b59801053aeba/src/credentials/awsCredentialsStatusBarItem.ts#L45).
293
293
294
-
The setting `aws.dev.forceDevMode` will take precedence over all dev settings and enable dev mode on `"aws.dev.forceDevMode": true` or disable on `"aws.dev.forceDevMode": false`.
294
+
The `aws.dev.forceDevMode` setting enables or disables Toolkit "dev mode". Without this setting, the presence of any other `aws.dev.*` setting defined in `DevSettings` implicitly enables "dev mode".
295
295
296
296
### Logging
297
297
298
-
The `aws.dev.logfile` setting allows you to set the path of the logfile. This makes it easy to
299
-
follow and filter the logfile using shell tools like `tail` and `grep`. For example in
300
-
settings.json,
301
-
298
+
- Use the `aws.dev.logfile` setting to set the logfile path to a fixed location, so you can easily
299
+
follow and filter the logfile using shell tools like `tail` and `grep`. For example in
300
+
settings.json,
301
+
```
302
302
"aws.dev.logfile": "~/awstoolkit.log",
303
-
304
-
then following the log with:
305
-
303
+
```
304
+
then you can tail the logfile in your terminal:
305
+
```
306
306
tail -F ~/awstoolkit.log
307
+
```
308
+
- Use the `AWS (Developer): Watch Logs` command to watch and filter Toolkit logs (including
309
+
telemetry) in VSCode.
310
+
- Only available if you enabled "dev mode" (`aws.dev.forceDevMode` setting, see above).
311
+
- Sets `aws.logLevel` to "debug".
312
+
- Enter text in the Debug Console filter box to show only log messages with that text. <br/>
See [docs/telemetry.md](./docs/telemetry.md) for notes on emitting telemetry in this project.
317
+
- See [docs/telemetry.md](./docs/telemetry.md) for guidelines on developing telemetry in this project.
318
+
- To watch Toolkit telemetry events, use the `AWS (Developer): Watch Logs` command (see [Logging](#logging) above) and enter "telemetry" in the Debug Console filter box.
0 commit comments