From 003d93b0f20db33b16bf0df4e168479a7133ed2f Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Mon, 26 Feb 2024 15:13:08 +0100 Subject: [PATCH] Added telemetry information --- README.beta.md | 15 +++++++++++++++ README.md | 15 +++++++++++++++ src/constants/SentryIgnore.ts | 3 ++- src/helpers/Telemetry.ts | 6 +++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/README.beta.md b/README.beta.md index 5b6ace70..b9b010b7 100644 --- a/README.beta.md +++ b/README.beta.md @@ -171,6 +171,21 @@ You can open showcase issues for the following things: - Share an article/video/webcast/... that explains how you use Front Matter; - Got something else to share? Open an issue and we can see where it fits on our website. +## 📊 Telemetry + +The Front Matter CMS extension collects telemetry data to help us build a better understand which features from the CMS are used. The extension respects the `telemetry.enableTelemetry` setting which you can learn more about in the [Visual Studio Code FAQ](https://aka.ms/vscode-remote/telemetry), or you can only disable it for the extension by configuring the `frontMatter.telemetry.disable` setting. + +We only collect the following data: + +- Type of event +- Extension title (main or beta) +- Extension version + +No user-specific data is collected, you can check the telemetry implementation in the following files: + +- [Telemetry class](https://github.com/estruyf/vscode-front-matter/blob/59528a3db01be8d34dc40638e6cf827090e31986/src/helpers/Telemetry.ts) +- [Metrics API](https://github.com/FrontMatter/web-documentation-nextjs/blob/main/pages/api/metrics.ts) + ## 👉 Contributors 🤘

diff --git a/README.md b/README.md index 73ce1070..47238f4c 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,21 @@ You can open showcase issues for the following things: - Share an article/video/webcast/... that explains how you use Front Matter; - Got something else to share? Open an issue and we can see where it fits on our website. +## 📊 Telemetry + +The Front Matter CMS extension collects telemetry data to help us build a better understand which features from the CMS are used. The extension respects the `telemetry.enableTelemetry` setting which you can learn more about in the [Visual Studio Code FAQ](https://aka.ms/vscode-remote/telemetry), or you can only disable it for the extension by configuring the `frontMatter.telemetry.disable` setting. + +We only collect the following data: + +- Type of event +- Extension title (main or beta) +- Extension version + +No user-specific data is collected, you can check the telemetry implementation in the following files: + +- [Telemetry class](https://github.com/estruyf/vscode-front-matter/blob/59528a3db01be8d34dc40638e6cf827090e31986/src/helpers/Telemetry.ts) +- [Metrics API](https://github.com/FrontMatter/web-documentation-nextjs/blob/main/pages/api/metrics.ts) + ## 👉 Contributors 🤘

diff --git a/src/constants/SentryIgnore.ts b/src/constants/SentryIgnore.ts index 76a3a848..d9016f6c 100644 --- a/src/constants/SentryIgnore.ts +++ b/src/constants/SentryIgnore.ts @@ -1,5 +1,6 @@ export const SentryIgnore = [ `ResizeObserver loop limit exceeded`, `Cannot read properties of undefined (reading 'unobserve')`, - `TypeError: Cannot read properties of undefined (reading 'unobserve')` + `TypeError: Cannot read properties of undefined (reading 'unobserve')`, + `ResizeObserver loop completed with undelivered notifications.` ]; diff --git a/src/helpers/Telemetry.ts b/src/helpers/Telemetry.ts index 245e058a..a863a69c 100644 --- a/src/helpers/Telemetry.ts +++ b/src/helpers/Telemetry.ts @@ -1,3 +1,4 @@ +import { workspace } from 'vscode'; import { Extension, Settings } from '.'; import { EXTENSION_BETA_ID, EXTENSION_ID, SETTING_TELEMETRY_DISABLE } from '../constants'; @@ -30,8 +31,11 @@ export class Telemetry { * @returns */ public static send(eventName: string, properties?: any) { + const config = workspace.getConfiguration('telemetry'); + const isVscodeEnable = config.get<'off' | undefined>('enableTelemetry'); + const isDisabled = Settings.get(SETTING_TELEMETRY_DISABLE); - if (isDisabled) { + if (isDisabled || isVscodeEnable === 'off') { return; }