Skip to content

Telemetry tweaks#7933

Merged
Colengms merged 6 commits intomainfrom
bobbrow/telemetryUpdate
Sep 23, 2021
Merged

Telemetry tweaks#7933
Colengms merged 6 commits intomainfrom
bobbrow/telemetryUpdate

Conversation

@bobbrow
Copy link
Member

@bobbrow bobbrow commented Aug 6, 2021

While reviewing the exp platform changes for CMake Tools, a few issues were noticed that we wanted to bring fixes back to cpptools for:

  • Incorrect placement of undefined in type annotation. For some reason TypeScript does not complain about getExperimentationService returning undefined
  • experimentationTelemetry should always be disposed
  • Prefer not to use await for logging telemetry. It's not an issue in cpptools right now, but if the no-floating-promises linter rule is enabled it wants you to annotate every call to log*Event.


if (initializationPromise) {
try {
// Use 'then' instead of 'await' because telemetry should be "fire and forget".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logDebuggerEvent and logLanguageServerEvent were already "fire and forget" due to not awaiting calls to it. We don't use no-floating-promises. There are many cases in which async functions are not being awaited, and cannot be awaited (such as when registered as a callback to a registerCommand or when registering for various VS Code events. There are other intentional cases a well). Are you sure you want to take this change an incur more calls to then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention was to keep the two implementations in sync. If you don't want this part of the change I can back it out. There's nothing wrong with using .then for intentional "fire and forget" cases. We still have several .then calls in the extension.

@sean-mcmanus
Copy link
Contributor

@bobbrow Are you going to check this in now?

@sean-mcmanus
Copy link
Contributor

@bobbrow Did you want to check this in?

@bobbrow
Copy link
Member Author

bobbrow commented Sep 13, 2021

Sorry, I thought you were going to merge this for me.

@Colengms Colengms merged commit 2f78e86 into main Sep 23, 2021
@Colengms Colengms deleted the bobbrow/telemetryUpdate branch September 23, 2021 19:26
@bobbrow
Copy link
Member Author

bobbrow commented Sep 23, 2021

Thanks @Colengms. I had updated the branch, and then forgot again.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants