Skip to content

Commit

Permalink
Telemetry removal
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Jul 18, 2024
1 parent 1d7436d commit 00bbb38
Show file tree
Hide file tree
Showing 33 changed files with 23 additions and 317 deletions.
13 changes: 1 addition & 12 deletions README.beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,7 @@ You can open showcase issues for the following things:

## 📊 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)
The Front Matter CMS extension only uses telemetry on application crashes. 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).

For crash reports in the webviews, we make use of Sentry to help us understand what went wrong. This data is only used to fix issues and improve the extension. You can find more information about the Sentry implementation in the following files:

Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,7 @@ You can open showcase issues for the following things:

## 📊 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)
The Front Matter CMS extension only uses telemetry on application crashes. 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).

For crash reports in the webviews, we make use of Sentry to help us understand what went wrong. This data is only used to fix issues and improve the extension. You can find more information about the Sentry implementation in the following files:

Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1985,11 +1985,6 @@
},
"scope": "Taxonomy"
},
"frontMatter.telemetry.disable": {
"type": "boolean",
"default": false,
"markdownDescription": "%setting.frontMatter.telemetry.disable.markdownDescription%"
},
"frontMatter.templates.enabled": {
"type": "boolean",
"default": false,
Expand Down
4 changes: 0 additions & 4 deletions src/commands/Article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
SETTING_SLUG_PREFIX,
SETTING_SLUG_SUFFIX,
SETTING_CONTENT_PLACEHOLDERS,
TelemetryEvent,
SETTING_SLUG_TEMPLATE
} from './../constants';
import { CustomPlaceholder, Field } from '../models';
Expand All @@ -39,7 +38,6 @@ import { COMMAND_NAME, DefaultFields } from '../constants';
import { DashboardData, SnippetInfo, SnippetRange } from '../models/DashboardData';
import { DateHelper } from '../helpers/DateHelper';
import { parseWinPath } from '../helpers/parseWinPath';
import { Telemetry } from '../helpers/Telemetry';
import { ParsedFrontMatter } from '../parsers';
import { MediaListener } from '../listeners/panel';
import { NavigationType } from '../dashboardWebView/models';
Expand Down Expand Up @@ -192,8 +190,6 @@ export class Article {
* Generate the slug based on the article title
*/
public static async updateSlug() {
Telemetry.send(TelemetryEvent.generateSlug);

const updateFileName = Settings.get(SETTING_SLUG_UPDATE_FILE_NAME) as string;
const editor = window.activeTextEditor;

Expand Down
5 changes: 1 addition & 4 deletions src/commands/Chatbot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Telemetry } from './../helpers/Telemetry';
import { TelemetryEvent, PreviewCommands, GeneralCommands } from './../constants';
import { PreviewCommands, GeneralCommands } from './../constants';
import { join } from 'path';
import { commands, Uri, ViewColumn, window } from 'vscode';
import { Extension } from '../helpers';
Expand Down Expand Up @@ -116,7 +115,5 @@ export class Chatbot {
</body>
</html>
`;

Telemetry.send(TelemetryEvent.openChatbot);
}
}
12 changes: 1 addition & 11 deletions src/commands/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {
CONTEXT,
ExtensionState,
SETTING_EXPERIMENTAL,
COMMAND_NAME,
TelemetryEvent
COMMAND_NAME
} from '../constants';
import { join } from 'path';
import { commands, Uri, ViewColumn, Webview, WebviewPanel, window } from 'vscode';
Expand All @@ -17,7 +16,6 @@ import {
DashboardListener,
MediaListener,
SettingsListener,
TelemetryListener,
DataListener,
PagesListener,
ExtensionListener,
Expand All @@ -28,7 +26,6 @@ import {
} from '../listeners/dashboard';
import { MediaListener as PanelMediaListener } from '../listeners/panel';
import { GitListener, ModeListener } from '../listeners/general';
import { Folders } from './Folders';
import * as l10n from '@vscode/l10n';
import { LocalizationKey } from '../localization';
import { DashboardMessage } from '../dashboardWebView/DashboardMessage';
Expand Down Expand Up @@ -66,7 +63,6 @@ export class Dashboard {

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboard, (data?: DashboardData) => {
Telemetry.send(TelemetryEvent.openContentDashboard);
if (!data) {
Dashboard.open({ type: NavigationType.Contents });
} else {
Expand All @@ -77,35 +73,30 @@ export class Dashboard {

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboardMedia, () => {
Telemetry.send(TelemetryEvent.openMediaDashboard);
Dashboard.open({ type: NavigationType.Media });
})
);

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboardSnippets, () => {
Telemetry.send(TelemetryEvent.openSnippetsDashboard);
Dashboard.open({ type: NavigationType.Snippets });
})
);

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboardData, () => {
Telemetry.send(TelemetryEvent.openDataDashboard);
Dashboard.open({ type: NavigationType.Data });
})
);

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboardTaxonomy, () => {
Telemetry.send(TelemetryEvent.openTaxonomyDashboard);
Dashboard.open({ type: NavigationType.Taxonomy });
})
);

subscriptions.push(
commands.registerCommand(COMMAND_NAME.dashboardClose, () => {
Telemetry.send(TelemetryEvent.closeDashboard);
Dashboard.close();
})
);
Expand Down Expand Up @@ -240,7 +231,6 @@ export class Dashboard {
PagesListener.process(msg);
SettingsListener.process(msg);
DataListener.process(msg);
TelemetryListener.process(msg);
SnippetListener.process(msg);
ModeListener.process(msg);
GitListener.process(msg);
Expand Down
9 changes: 1 addition & 8 deletions src/commands/Folders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
SETTING_CONTENT_PAGE_FOLDERS,
SETTING_CONTENT_STATIC_FOLDER,
SETTING_CONTENT_SUPPORTED_FILETYPES,
SETTING_DATE_FORMAT,
TelemetryEvent
SETTING_DATE_FORMAT
} from './../constants';
import { commands, Uri, workspace, window } from 'vscode';
import { basename, dirname, join, relative, sep } from 'path';
Expand Down Expand Up @@ -107,8 +106,6 @@ export class Folders {
MediaHelpers.resetMedia();
MediaListener.sendMediaFiles(0, folderPath);
}

Telemetry.send(TelemetryEvent.addMediaFolder);
}

/**
Expand Down Expand Up @@ -183,8 +180,6 @@ export class Folders {

Notifications.info(l10n.t(LocalizationKey.commandsFoldersCreateSuccess));

Telemetry.send(TelemetryEvent.registerFolder);

SettingsListener.getSettings(true);
}
}
Expand All @@ -198,8 +193,6 @@ export class Folders {
let folders = await Folders.get();
folders = folders.filter((f) => f.path !== folder.fsPath);
await Folders.update(folders);

Telemetry.send(TelemetryEvent.unregisterFolder);
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/commands/Preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
SETTING_PREVIEW_HOST,
SETTING_PREVIEW_PATHNAME,
CONTEXT,
TelemetryEvent,
PreviewCommands,
SETTING_EXPERIMENTAL,
SETTING_DATE_FORMAT,
Expand All @@ -20,7 +19,6 @@ import {
processFmPlaceholders,
processPathPlaceholders,
Settings,
Telemetry,
processDateTimePlaceholders
} from '../helpers';
import { ContentFolder, ContentType, PreviewSettings } from '../models';
Expand Down Expand Up @@ -199,8 +197,6 @@ export class Preview {
</body>
</html>
`;

Telemetry.send(TelemetryEvent.openPreview);
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/commands/Project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DEFAULT_CONTENT_TYPE } from './../constants/ContentType';
import { Telemetry } from './../helpers/Telemetry';
import { workspace, Uri, commands, window } from 'vscode';
import { join } from 'path';
import { Notifications } from '../helpers/Notifications';
Expand All @@ -16,8 +15,7 @@ import {
import {
COMMAND_NAME,
SETTING_CONTENT_DEFAULT_FILETYPE,
SETTING_TAXONOMY_CONTENT_TYPES,
TelemetryEvent
SETTING_TAXONOMY_CONTENT_TYPES
} from '../constants';
import { SettingsListener } from '../listeners/dashboard';
import { existsAsync, writeFileAsync } from '../utils';
Expand Down Expand Up @@ -96,8 +94,6 @@ categories: []
// Initialize the taxonomy database
TaxonomyHelper.initDb();

Telemetry.send(TelemetryEvent.initialization);

// Check if you can find the framework
const wsFolder = Folders.getWorkspaceFolder();
const framework = await FrameworkDetector.get(wsFolder?.fsPath || '');
Expand Down
6 changes: 1 addition & 5 deletions src/commands/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
COMMAND_NAME,
DefaultFields,
SETTING_CONTENT_DEFAULT_FILETYPE,
SETTING_TEMPLATES_FOLDER,
TelemetryEvent
SETTING_TEMPLATES_FOLDER
} from '../constants';
import { ArticleHelper, Extension, Settings } from '../helpers';
import { Article, Folders } from '.';
Expand All @@ -16,7 +15,6 @@ import { ContentType } from '../helpers/ContentType';
import { ContentType as IContentType } from '../models';
import { PagesListener } from '../listeners/dashboard';
import { extname } from 'path';
import { Telemetry } from '../helpers/Telemetry';
import { writeFileAsync, copyFileAsync } from '../utils';
import * as l10n from '@vscode/l10n';
import { LocalizationKey } from '../localization';
Expand Down Expand Up @@ -224,8 +222,6 @@ export class Template {

Notifications.info(l10n.t(LocalizationKey.commandsTemplateCreateSuccess));

Telemetry.send(TelemetryEvent.createContentFromTemplate);

// Trigger a refresh for the dashboard
PagesListener.refresh();
}
Expand Down
56 changes: 0 additions & 56 deletions src/constants/TelemetryEvent.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './ContentType';
export * from './DefaultFeatureFlags';
export * from './DefaultFieldValues';
export * from './DefaultFields';
export * from './DefaultFileTypes';
Expand All @@ -17,7 +18,6 @@ export * from './SentryIgnore';
export * from './Snippet';
export * from './SsgScripts';
export * from './StaticFolderPlaceholder';
export * from './TelemetryEvent';
export * from './Templates';
export * from './charCode';
export * from './charMap';
Expand Down
2 changes: 0 additions & 2 deletions src/constants/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const SETTING_TEMPLATES_FOLDER = 'templates.folder';
export const SETTING_TEMPLATES_PREFIX = 'templates.prefix';
export const SETTING_TEMPLATES_ENABLED = 'templates.enabled';

export const SETTING_TELEMETRY_DISABLE = 'telemetry.disable';

export const SETTING_PANEL_FREEFORM = 'panel.freeform';
export const SETTING_PANEL_ACTIONS_DISABLED = 'panel.actions.disabled';

Expand Down
1 change: 0 additions & 1 deletion src/dashboardWebView/DashboardMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export enum DashboardMessage {
setState = 'setState',
getState = 'getState',
runCustomScript = 'runCustomScript',
sendTelemetry = 'sendTelemetry',
showNotification = 'showNotification',
setTitle = 'setTitle',

Expand Down
6 changes: 1 addition & 5 deletions src/dashboardWebView/components/Contents/Contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import usePages from '../../hooks/usePages';
import { useCallback, useEffect, useState } from 'react';
import { Messenger, messageHandler } from '@estruyf/vscode/dist/client';
import { DashboardMessage } from '../../DashboardMessage';
import { GeneralCommands, TelemetryEvent } from '../../../constants';
import { GeneralCommands } from '../../../constants';
import { PageLayout } from '../Layout/PageLayout';
import { FilesProvider } from '../../providers/FilesProvider';
import { Alert } from '../Modals/Alert';
Expand Down Expand Up @@ -67,10 +67,6 @@ export const Contents: React.FunctionComponent<IContentsProps> = ({
}, [JSON.stringify(pageItems)]);

useEffect(() => {
Messenger.send(DashboardMessage.sendTelemetry, {
event: TelemetryEvent.webviewContentsView
});

Messenger.send(DashboardMessage.setTitle, l10n.t(LocalizationKey.dashboardHeaderTabsContents));
}, []);

Expand Down
Loading

0 comments on commit 00bbb38

Please sign in to comment.