Commit 66a3ca5
telemetry(smus): Handle async calls gracefully in telemetry (#8472)
## Problem
- sometimes custom metrics are missing from `smus_stopSpace` and
`smus_openRemoteConnection`
## Solution
- Some telemetry custom variables are fetched via async calls
- This calls should gracefully handle async failures, and still being
able to record what metrics are available.
### Example
- successful async calls
```
2025-12-29 11:38:25.994 [debug] telemetry: smus_openRemoteConnection {
Metadata: {
metricId: 'acc0a9b4-e642-4e4f-a2a7-949879fca73d',
traceId: '911f58fd-9f63-4a8f-8e87-590d3f46d534',
smusAuthMode: 'iam',
smusSpaceKey: 'd-5eomwrxzxbim__default-ce003678-576c-4253-a65f-01ef29af4f94',
smusDomainRegion: 'us-east-2',
smusDomainId: 'dzd-byubiyc1bebgfd',
smusProjectId: 'b236u0pytkd02x',
smusDomainAccountId: '619071339486',
smusProjectAccountId: '619071339486',
smusProjectRegion: 'us-east-2',
duration: '20598',
result: 'Succeeded',
awsAccount: 'not-set',
awsRegion: 'us-west-2'
},
Value: 1,
Unit: 'None',
Passive: false
}
```
```
2025-12-29 11:39:28.454 [debug] telemetry: smus_stopSpace {
Metadata: {
metricId: '743e4212-8d6f-40bf-b2aa-a3ab45b5aa86',
traceId: '6bfd857d-cf53-410e-9e38-d1f8b37ec833',
smusAuthMode: 'iam',
smusSpaceKey: 'd-5eomwrxzxbim__default-ce003678-576c-4253-a65f-01ef29af4f94',
smusDomainRegion: 'us-east-2',
smusDomainId: 'dzd-byubiyc1bebgfd',
smusProjectId: 'b236u0pytkd02x',
smusDomainAccountId: '619071339486',
smusProjectAccountId: '619071339486',
smusProjectRegion: 'us-east-2',
duration: '4430',
result: 'Succeeded',
awsAccount: 'not-set',
awsRegion: 'us-west-2'
},
Value: 1,
Unit: 'None',
Passive: false
}
```
- failed async calls
```
2025-12-29 12:00:12.444 [warning] smus: Failed to get project region for telemetry: The security token included in the request is expired
```
```
2025-12-29 12:00:15.237 [debug] telemetry: smus_stopSpace {
Metadata: {
metricId: '52e34dd6-3016-4abc-82cb-2605c2cb7e71',
traceId: '8288d8a9-6674-4402-901a-0ebafe57ad1d',
smusAuthMode: 'iam',
smusSpaceKey: 'd-5eomwrxzxbim__default-ce003678-576c-4253-a65f-01ef29af4f94',
smusDomainRegion: 'us-east-2',
smusDomainId: 'dzd-byubiyc1bebgfd',
smusProjectId: 'b236u0pytkd02x',
smusDomainAccountId: '619071339486',
smusProjectAccountId: '619071339486',
smusProjectRegion: 'not-set',
duration: '2973',
result: 'Failed',
reason: 'ExpiredTokenException',
reasonDesc: 'ExpiredTokenException: Failed to stop space default-ce003678-576c-4253-a65f-01ef29af4f94: The security token included in the request is expired | ExpiredTokenException: The security token included in the request is expired',
awsAccount: 'not-set',
awsRegion: 'us-west-2'
},
Value: 1,
Unit: 'None',
Passive: false
}
```
`smusProjectRegion` is set to 'not-set` and the rest of custom metrics
are recorded.
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Co-authored-by: kzr-at-amazon <build@amazon.com>1 parent 9083350 commit 66a3ca5
2 files changed
+63
-53
lines changedLines changed: 52 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
33 | 47 | | |
34 | | - | |
35 | | - | |
36 | 48 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
42 | 54 | | |
43 | | - | |
44 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
45 | 65 | | |
46 | | - | |
| 66 | + | |
47 | 67 | | |
48 | 68 | | |
49 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
50 | 73 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| |||
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| 103 | + | |
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
| |||
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
109 | 134 | | |
110 | | - | |
111 | | - | |
112 | 135 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 136 | + | |
125 | 137 | | |
126 | | - | |
| 138 | + | |
| 139 | + | |
127 | 140 | | |
128 | 141 | | |
Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 82 | + | |
80 | 83 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 84 | + | |
88 | 85 | | |
89 | 86 | | |
0 commit comments