-
Notifications
You must be signed in to change notification settings - Fork 34.5k
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
Conversation
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.
@@ -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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I like that!
Looks good, great job 👏 |
This change will filter DAP keys beginning with
!
when the remoteauthority 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.