Skip to content

Commit

Permalink
Remove more unused telemetry events (#14288)
Browse files Browse the repository at this point in the history
* Remove more unused telemetry events

* misc

* oops
  • Loading branch information
DonJayamanne authored Sep 8, 2023
1 parent 7732f59 commit 9837d77
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 321 deletions.
130 changes: 4 additions & 126 deletions src/gdpr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
//Telemetry.EnterRemoteJupyterUrl
/* __GDPR__
"DATASCIENCE.ENTER_REMOTE_JUPYTER_URL" : {
"serverIdHash": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Unique Id of this Server","owner":"donjayamanne"},
"baseUrlHash": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Has of the origin/base Url.","owner":"donjayamanne"},
"isLocalHost": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether user is connecting to the local host.","owner":"donjayamanne"},
"isJupyterHub": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether this is Jupyter Hub or not.","owner":"donjayamanne"},
Expand Down Expand Up @@ -897,58 +898,6 @@
"${include}": [
"${F1}"
]
}
*/
//Telemetry.SelectLocalJupyterKernel
/* __GDPR__
"DATASCIENCE.SELECT_LOCAL_JUPYTER_KERNEL" : {
"actionSource": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether this was started by Jupyter extension or a 3rd party. Common to most of the events.","owner":"donjayamanne"},
"disableUI": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether the notebook startup UI (progress indicator & the like) was displayed to the user or not. If its not displayed, then its considered an auto start (start in the background, like pre-warming kernel) Common to most of the events.","owner":"donjayamanne"},
"userExecutedCell": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether the user executed a cell. Common to most of the events.","owner":"donjayamanne"},
"resourceHash": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Hash of the resource (notebook.uri or pythonfile.uri associated with this). If we run the same notebook tomorrow, the hash will be the same. Used to check whether a particular notebook fails across time or not. This is also used to map different telemetry events related to this same resource. E.g. we could have an event sent for starting a notebook with this hash, and then later we get yet another event indicating starting a notebook failed. And another event indicating the Python environment used for this notebook is a conda environment or we have some other event indicating some other piece of data for this resource. With the information across multiple resources we can now join the different data points and have a better understanding of what is going on, e.g. why something failed. Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentVersion": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Found plenty of issues when starting Conda Python 3.7, Python 3.7 Python 3.9 (in early days when ipykernel was not up to date) Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentType": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Found plenty of issues when starting kernels with conda, hence useful to capture this info. Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentPath": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"A key, so that rest of the information is tied to this. (hash) Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentPackages": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Comma delimited list of hashed packages & their versions. Common to most of the events.","owner":"donjayamanne"},
"kernelSessionId": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Unique identifier for an instance of a notebook session. If we restart or run this notebook tomorrow, this id will be different. Id could be something as simple as a hash of the current Epoch time. Common to most of the events.","owner":"donjayamanne"},
"kernelLanguage": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Language of the kernel connection. Common to most of the events.","owner":"donjayamanne"},
"kernelSpecHash": {"classification":"EndUserPseudonymizedInformation","purpose":"FeatureInsight","comment":"Hash of the kernelspec file (so we do not end up with duplicate telemetry for the same user in same session)","owner":"donjayamanne"},
"kernelId": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Hash of the Kernel Connection id. Common to most of the events.","owner":"donjayamanne"},
"kernelConnectionType": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether kernel was started using kernel spec, interpreter, etc. Common to most of the events.","owner":"donjayamanne"},
"isUsingActiveInterpreter": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether this resource is using the active Python interpreter or not. Common to most of the events.","owner":"donjayamanne"},
"capturedEnvVars": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether we managed to capture the environment variables or not. In the case of conda environments, `false` would be an error condition, as we must have env variables for conda to work. Common to most of the events.","owner":"donjayamanne"},
"newKernelPicker": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether using the new kernel picker or not. This will be obsolete once we ship the new kernel picker.","owner":"donjayamanne"},
"resourceType": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Used to determine whether this event is related to a Notebooks or Interactive window. Common to most of the events.","owner":"donjayamanne"},
"${include}": [
"${F1}"
]
}
*/
//Telemetry.SelectRemoteJupyterKernel
/* __GDPR__
"DATASCIENCE.SELECT_REMOTE_JUPYTER_KERNEL" : {
"actionSource": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether this was started by Jupyter extension or a 3rd party. Common to most of the events.","owner":"donjayamanne"},
"disableUI": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether the notebook startup UI (progress indicator & the like) was displayed to the user or not. If its not displayed, then its considered an auto start (start in the background, like pre-warming kernel) Common to most of the events.","owner":"donjayamanne"},
"userExecutedCell": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether the user executed a cell. Common to most of the events.","owner":"donjayamanne"},
"resourceHash": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Hash of the resource (notebook.uri or pythonfile.uri associated with this). If we run the same notebook tomorrow, the hash will be the same. Used to check whether a particular notebook fails across time or not. This is also used to map different telemetry events related to this same resource. E.g. we could have an event sent for starting a notebook with this hash, and then later we get yet another event indicating starting a notebook failed. And another event indicating the Python environment used for this notebook is a conda environment or we have some other event indicating some other piece of data for this resource. With the information across multiple resources we can now join the different data points and have a better understanding of what is going on, e.g. why something failed. Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentVersion": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Found plenty of issues when starting Conda Python 3.7, Python 3.7 Python 3.9 (in early days when ipykernel was not up to date) Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentType": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Found plenty of issues when starting kernels with conda, hence useful to capture this info. Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentPath": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"A key, so that rest of the information is tied to this. (hash) Common to most of the events.","owner":"donjayamanne"},
"pythonEnvironmentPackages": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Comma delimited list of hashed packages & their versions. Common to most of the events.","owner":"donjayamanne"},
"kernelSessionId": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Unique identifier for an instance of a notebook session. If we restart or run this notebook tomorrow, this id will be different. Id could be something as simple as a hash of the current Epoch time. Common to most of the events.","owner":"donjayamanne"},
"kernelLanguage": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Language of the kernel connection. Common to most of the events.","owner":"donjayamanne"},
"kernelSpecHash": {"classification":"EndUserPseudonymizedInformation","purpose":"FeatureInsight","comment":"Hash of the kernelspec file (so we do not end up with duplicate telemetry for the same user in same session)","owner":"donjayamanne"},
"kernelId": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Hash of the Kernel Connection id. Common to most of the events.","owner":"donjayamanne"},
"kernelConnectionType": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether kernel was started using kernel spec, interpreter, etc. Common to most of the events.","owner":"donjayamanne"},
"isUsingActiveInterpreter": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether this resource is using the active Python interpreter or not. Common to most of the events.","owner":"donjayamanne"},
"capturedEnvVars": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether we managed to capture the environment variables or not. In the case of conda environments, `false` would be an error condition, as we must have env variables for conda to work. Common to most of the events.","owner":"donjayamanne"},
"newKernelPicker": {"classification":"PublicNonPersonalData","purpose":"PerformanceAndHealth","comment":"Whether using the new kernel picker or not. This will be obsolete once we ship the new kernel picker.","owner":"donjayamanne"},
"resourceType": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Used to determine whether this event is related to a Notebooks or Interactive window. Common to most of the events.","owner":"donjayamanne"},
"${include}": [
"${F1}"
]
}
*/
Expand Down Expand Up @@ -1101,51 +1050,6 @@
"${include}": [
"${F1}"
]
}
*/
//Telemetry.ConnectFailedJupyter
/* __GDPR__
"DS_INTERNAL.CONNECTFAILEDJUPYTER" : {
"${include}": [
"${F1}"
]
}
*/
//Telemetry.ConnectRemoteExpiredCertFailedJupyter
/* __GDPR__
"DS_INTERNAL.CONNECTREMOTEEXPIREDCERTFAILEDJUPYTER" : {
"${include}": [
"${F1}"
]
}
*/
//Telemetry.ConnectRemoteFailedJupyter
/* __GDPR__
"DS_INTERNAL.CONNECTREMOTEFAILEDJUPYTER" : {
"${include}": [
"${F1}"
]
}
*/
//Telemetry.ConnectRemoteJupyterViaLocalHost
/* __GDPR__
"DS_INTERNAL.CONNECTREMOTEJUPYTER_VIA_LOCALHOST" : {
"${include}": [
"${F1}"
]
}
*/
//Telemetry.ConnectRemoteSelfCertFailedJupyter
/* __GDPR__
"DS_INTERNAL.CONNECTREMOTESELFCERTFAILEDJUPYTER" : {
"${include}": [
"${F1}"
]
}
*/
Expand All @@ -1171,17 +1075,6 @@
"${include}": [
"${F1}"
]
}
*/
//Telemetry.FailedToUpdateKernelSpec
/* __GDPR__
"DS_INTERNAL.FAILED_TO_UPDATE_JUPYTER_KERNEL_SPEC" : {
"name": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Name of the kernel spec.","owner":"donjayamanne"},
"language": {"classification":"PublicNonPersonalData","purpose":"FeatureInsight","comment":"Language of the kernel spec.","owner":"donjayamanne"},
"${include}": [
"${F1}"
]
}
*/
Expand Down Expand Up @@ -1381,6 +1274,9 @@
/* __GDPR__
"DS_INTERNAL.JUPYTER_KERNEL_SPEC" : {
"kernelSpecHash": {"classification":"EndUserPseudonymizedInformation","purpose":"FeatureInsight","comment":"Hash of the kernelspec file (so we do not end up with duplicate telemetry for the same user in same session)","owner":"donjayamanne"},
"serverIdHash": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Unique Id of this Server","owner":"donjayamanne"},
"providerExtensionId": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Extension that owns (provided) this Jupyter Url","owner":"donjayamanne"},
"baseUrlHash": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Has of the origin/base Url.","owner":"donjayamanne"},
"kernelId": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Hash of the Kernel Connection id.","owner":"donjayamanne"},
"kernelConnectionType": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"What kind of kernel spec did we fail to create.","owner":"donjayamanne"},
"kernelLanguage": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Language of the kernel spec.","owner":"donjayamanne"},
Expand All @@ -1391,15 +1287,6 @@
"${include}": [
"${F1}"
]
}
*/
//Telemetry.JupyterServerZMQStreamError
/* __GDPR__
"DS_INTERNAL.JUPYTER_SERVER_ZMQ_STREAM_ERROR" : {
"${include}": [
"${F1}"
]
}
*/
Expand Down Expand Up @@ -1785,15 +1672,6 @@
"${include}": [
"${F1}"
]
}
*/
//Telemetry.StartSessionFailedJupyter
/* __GDPR__
"DS_INTERNAL.START_SESSION_FAILED_JUPYTER" : {
"${include}": [
"${F1}"
]
}
*/
Expand Down
2 changes: 0 additions & 2 deletions src/kernels/common/baseJupyterSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { IDisposable, Resource } from '../../platform/common/types';
import { createDeferred, raceTimeout } from '../../platform/common/utils/async';
import * as localize from '../../platform/common/utils/localize';
import { noop, swallowExceptions } from '../../platform/common/utils/misc';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { JupyterInvalidKernelError } from '../errors/jupyterInvalidKernelError';
import { JupyterWaitForIdleError } from '../errors/jupyterWaitForIdleError';
import { ISessionWithSocket, KernelConnectionMetadata, KernelSocketInformation, IBaseKernelSession } from '../types';
Expand Down Expand Up @@ -72,7 +71,6 @@ export function suppressShutdownErrors(realKernel: any) {
export class JupyterSessionStartError extends WrappedError {
constructor(originalException: Error) {
super(originalException.message, originalException);
sendTelemetryEvent(Telemetry.StartSessionFailedJupyter, undefined, undefined, originalException);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/kernels/jupyter/connection/jupyterConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
} from '../types';
import { IJupyterServerUri } from '../../../api';
import { JupyterSelfCertsError } from '../../../platform/errors/jupyterSelfCertsError';
import { Telemetry, sendTelemetryEvent } from '../../../telemetry';
import { JupyterSelfCertsExpiredError } from '../../../platform/errors/jupyterSelfCertsExpiredError';
import { IDataScienceErrorHandler } from '../../errors/types';
import { IApplicationShell } from '../../../platform/common/application/types';
Expand Down Expand Up @@ -79,13 +78,11 @@ export class JupyterConnection {
// We should throw an exception if any of that fails.
} catch (err) {
if (JupyterSelfCertsError.isSelfCertsError(err)) {
sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter);
const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message);
if (!handled) {
throw err;
}
} else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) {
sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter);
const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message);
if (!handled) {
throw err;
Expand Down
8 changes: 1 addition & 7 deletions src/kernels/jupyter/launcher/jupyterServerStarter.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { DataScience } from '../../../platform/common/utils/localize';
import { JupyterConnectError } from '../../../platform/errors/jupyterConnectError';
import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError';
import { IServiceContainer } from '../../../platform/ioc/types';
import { sendTelemetryEvent, Telemetry } from '../../../telemetry';
import { JupyterConnectionWaiter } from './jupyterConnectionWaiter.node';
import { WrappedError } from '../../../platform/errors/types';
import { KernelProgressReporter } from '../../../platform/progress/kernelProgressReporter';
Expand Down Expand Up @@ -102,12 +101,7 @@ export class JupyterServerStarter implements IJupyterServerStarter {
// Watch for premature exits
if (launchResult.proc) {
launchResult.proc.on('exit', (c: number | null) => (exitCode = c));
launchResult.out.subscribe((out) => {
if (out.out.includes('Uncaught exception in ZMQStream callback')) {
sendTelemetryEvent(Telemetry.JupyterServerZMQStreamError);
}
this.jupyterOutputChannel.append(out.out);
});
launchResult.out.subscribe((out) => this.jupyterOutputChannel.append(out.out));
}

// Make sure this process gets cleaned up. We might be canceled before the connection finishes.
Expand Down
Loading

0 comments on commit 9837d77

Please sign in to comment.