Skip to content

debug: filter exceptions from DAP telemetry on web #97627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 12, 2020

Conversation

connor4312
Copy link
Member

This change will filter DAP keys beginning with ! when the remote
authority is "other", which SteVen recommended as a way to tell if we're
on web/codespaces.

Isidor mentioned previously that there was filtering for keys beginning
with an underscore, but this was only applied to some data in error
responses, not general telemetry events. An alternative approach to this
is filtering exceptions based on the environment on the extension side,
but I figured it would be better to have VS Code do that so that we
don't end up with N many possibly deviant sets of environment detection
logic.

This change will filter DAP keys beginning with `!` when the remote
authority is "other", which SteVen recommended as a way to tell if we're
on web/codespaces.

Isidor mentioned previously that there was filtering for keys beginning
with an underscore, but this was only applied to some data in error
responses, not general telemetry events. An alternative approach to this
is filtering exceptions based on the environment on the extension side,
but I figured it would be better to have VS Code do that so that we
don't end up with N many possibly deviant sets of environment detection
logic.
@connor4312 connor4312 requested review from isidorn and sbatten May 12, 2020 17:13
@connor4312 connor4312 self-assigned this May 12, 2020
@connor4312 connor4312 added this to the May 2020 milestone May 12, 2020
@@ -848,7 +848,17 @@ export class DebugSession implements IDebugSession {
// and the user opted in telemetry
if (this.raw.customTelemetryService && this.telemetryService.isOptedIn) {
// __GDPR__TODO__ We're sending events in the name of the debug extension and we can not ensure that those are declared correctly.
this.raw.customTelemetryService.publicLog(event.body.output, event.body.data);
let data = event.body.data;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it make sense to move this out to a helper method which would live in debugTelemetry.ts?

Copy link
Member Author

@connor4312 connor4312 May 12, 2020

Choose a reason for hiding this comment

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

The DebugTelemetry class isn't very accessible here; that's used for the top-level of the session and sends to the global(?) telemetry service, and for this bit of telemetry we're sending to a separate instance of the service created from the aiKey inside the debug extension's package.json.

So perhaps not a method, but I did pop this to its own helper function in debugUtils.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks. I like that!

@isidorn
Copy link
Collaborator

isidorn commented May 12, 2020

Looks good, great job 👏
Just left one minor comment, if you can tackle it great, if not no problem.

@connor4312 connor4312 merged commit 6eec8bd into master May 12, 2020
@connor4312 connor4312 deleted the connor4312/filter-debug-exceptions branch May 12, 2020 20:17
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2020
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.

2 participants