Skip to content

Commit bb7f42e

Browse files
authored
Add telemetry (#12)
1 parent 5ac34fd commit bb7f42e

File tree

7 files changed

+458
-8
lines changed

7 files changed

+458
-8
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,31 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
4848
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
4949
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
5050

51+
52+
## Questions, issues, feature requests, and contributions
53+
54+
- If you have a question about how to accomplish something with the extension, please [ask on our Discussions page](https://github.com/microsoft/vscode-python/discussions/categories/q-a).
55+
- If you come across a problem with the extension, please [file an issue](https://github.com/microsoft/vscode-python).
56+
- Contributions are always welcome! Please see our [contributing guide](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md) for more details.
57+
- Any and all feedback is appreciated and welcome!
58+
- If someone has already [filed an issue](https://github.com/Microsoft/vscode-python) that encompasses your feedback, please leave a 👍/👎 reaction on the issue.
59+
- Otherwise please start a [new discussion](https://github.com/microsoft/vscode-python/discussions/categories/ideas).
60+
- If you're interested in the development of the extension, you can read about our [development process](https://github.com/Microsoft/vscode-python/blob/main/CONTRIBUTING.md#development-process).
61+
62+
## Data and telemetry
63+
64+
The Microsoft Python Extension for Visual Studio Code collects usage
65+
data and sends it to Microsoft to help improve our products and
66+
services. Read our
67+
[privacy statement](https://privacy.microsoft.com/privacystatement) to
68+
learn more. This extension respects the `telemetry.enableTelemetry`
69+
setting which you can learn more about at
70+
https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.
71+
5172
## Trademarks
5273

5374
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
5475
trademarks or logos is subject to and must follow
5576
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
5677
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
57-
Any use of third-party trademarks or logos are subject to those third-party's policies.
78+
Any use of third-party trademarks or logos are subject to those third-party's policies.

package-lock.json

Lines changed: 256 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@
442442
},
443443
"dependencies": {
444444
"@iarna/toml": "^2.2.5",
445+
"@vscode/extension-telemetry": "^0.9.7",
445446
"@vscode/test-cli": "^0.0.10",
446447
"fs-extra": "^11.2.0",
447448
"stack-trace": "0.0.10",

src/common/telemetry/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export enum EventNames {}
2+
3+
// Map all events to their properties
4+
export interface IEventNamePropertyMapping {}

src/common/telemetry/reporter.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type TelemetryReporter from '@vscode/extension-telemetry';
2+
3+
class ReporterImpl {
4+
private static telemetryReporter: TelemetryReporter | undefined;
5+
static getTelemetryReporter() {
6+
const tel = require('@vscode/extension-telemetry');
7+
// eslint-disable-next-line @typescript-eslint/naming-convention
8+
const Reporter = tel.default as typeof TelemetryReporter;
9+
ReporterImpl.telemetryReporter = new Reporter(
10+
'0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255',
11+
[
12+
{
13+
lookup: /(errorName|errorMessage|errorStack)/g,
14+
},
15+
],
16+
);
17+
18+
return ReporterImpl.telemetryReporter;
19+
}
20+
}
21+
22+
export function getTelemetryReporter() {
23+
return ReporterImpl.getTelemetryReporter();
24+
}

0 commit comments

Comments
 (0)