Skip to content

Commit

Permalink
Merge pull request #3202 from microsoft-search/remove-appinsights-tel…
Browse files Browse the repository at this point in the history
…emetry

Remove app insights tracking
  • Loading branch information
wobba authored Aug 23, 2023
2 parents 2081d56 + 07c65a5 commit bea1970
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 293 deletions.
198 changes: 0 additions & 198 deletions search-parts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion search-parts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@fluentui/react": "^8.109.7",
"@fluentui/react-file-type-icons": "8.8.18",
"@fluentui/react-theme-provider": "0.19.16",
"@microsoft/applicationinsights-web": "^2.8.9",
"@microsoft/mgt-react": "^2.10.1",
"@microsoft/mgt-sharepoint-provider": "^2.10.1",
"@microsoft/sp-component-base": "1.15.2",
Expand Down
6 changes: 0 additions & 6 deletions search-parts/src/common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export class Constants {
* The client tag to append to all REST calls to SharePoint
*/
public static readonly X_CLIENTSERVICE_CLIENTTAG = 'NonISV|PnP|ModernSearch';

/**
* The PnP Application Insights instrumentation key and events for stats tracking
*/
public static readonly PNP_APP_INSIGHTS_INSTRUMENTATION_KEY = '0f0b9db6-680c-480c-804d-f75830e2c383';
public static readonly PNP_MODERN_SEARCH_EVENT_NAME = 'pnpModernSearchV4';
}

export enum AutoCalculatedDataSourceFields {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ export default interface ISearchResultsWebPartProps extends IBaseWebPartProps {
*/
selectedItemFieldValue: DynamicProperty<string>;

/**
* Flag indicating if telemetry are enabled
*/
enableTelemetry: boolean;

/**
* The queryModifier properties
*/
Expand Down
35 changes: 0 additions & 35 deletions search-parts/src/webparts/searchResults/SearchResultsWebPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import { BuiltinFilterTemplates } from '../../layouts/AvailableTemplates';
import { IExtensibilityConfiguration } from '../../models/common/IExtensibilityConfiguration';
import { IDataVerticalSourceData } from '../../models/dynamicData/IDataVerticalSourceData';
import { BaseWebPart } from '../../common/BaseWebPart';
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import commonStyles from '../../styles/Common.module.scss';
import { UrlHelper } from '../../helpers/UrlHelper';
import { ObjectHelper } from '../../helpers/ObjectHelper';
Expand Down Expand Up @@ -526,34 +525,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
// Web components are only defined once.
await this.templateService.registerWebComponents(this.availableWebComponentDefinitions, this.instanceId);

if (this.properties.dataSourceKey && this.properties.selectedLayoutKey && this.properties.enableTelemetry) {

const usageEvent = {
name: Constants.PNP_MODERN_SEARCH_EVENT_NAME,
properties: {
selectedDataSource: this.properties.dataSourceKey,
selectedLayout: this.properties.selectedLayoutKey,
useFilters: this.properties.useFilters,
useVerticals: this.properties.useVerticals
}
};

// Track event with application insights (PnP)
const appInsights = new ApplicationInsights({
config: {
maxBatchInterval: 0,
instrumentationKey: Constants.PNP_APP_INSIGHTS_INSTRUMENTATION_KEY,
namePrefix: LogSource,
disableFetchTracking: true,
disableAjaxTracking: true
}
});

appInsights.loadAppInsights();
appInsights.context.application.ver = this.manifest.version;
appInsights.trackEvent(usageEvent);
}

// Initializes MS Graph Toolkit
if (this.properties.useMicrosoftGraphToolkit) {
await loadMsGraphToolkit(this.context);
Expand Down Expand Up @@ -694,11 +665,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
this._propertyPanePropertyEditor({
webpart: this,
key: 'propertyEditor'
}),
PropertyPaneToggle('enableTelemetry', {
label: webPartStrings.PropertyPane.InformationPage.EnableTelemetryLabel,
offText: webPartStrings.PropertyPane.InformationPage.EnableTelemetryOn,
onText: webPartStrings.PropertyPane.InformationPage.EnableTelemetryOff,
})
]
}
Expand Down Expand Up @@ -1169,7 +1135,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
this.properties.showResultsCount = this.properties.showResultsCount !== undefined ? this.properties.showResultsCount : true;
this.properties.showBlankIfNoResult = this.properties.showBlankIfNoResult !== undefined ? this.properties.showBlankIfNoResult : false;
this.properties.useMicrosoftGraphToolkit = this.properties.useMicrosoftGraphToolkit !== undefined ? this.properties.useMicrosoftGraphToolkit : false;
this.properties.enableTelemetry = this.properties.enableTelemetry !== undefined ? this.properties.enableTelemetry : true;

// Item selection properties
if (!this.properties.selectedItemFieldValue) {
Expand Down
5 changes: 1 addition & 4 deletions search-parts/src/webparts/searchResults/loc/da-dk.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ define([], function() {
Extensibility: {
PanelHeader: "Konfigurér extensibility-biblioteker så de indlæser ved opstart.",
PanelDescription: "Tilføj/Fjern ID på dit extensibility-bibliotek her. Du kan specificere et visningsnavn og beslutte, om biblioteket skal indlæses eller ej ved opstart. Kun brugerdefinerede datakilder, layouts, web-komponenter og Handlebars-hjælpere vil blive loadet her.",
},
EnableTelemetryLabel: "PnP telemetri",
EnableTelemetryOn: "Slå telemetri til",
EnableTelemetryOff: "Slå telemetri fra"
}
},
CustomQueryModifier: {
EditQueryModifiersLabel: "Konfigurere tilgængelige brugerdefinerede forespørgselsmodifikatorer",
Expand Down
5 changes: 1 addition & 4 deletions search-parts/src/webparts/searchResults/loc/de-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ define([], function() {
Extensibility: {
PanelHeader: "Erweiterungsbibliotheken die beim Start geladen werden konfigurieren ",
PanelDescription: "Hier können Sie die IDs Ihrer benutzerdefinierten Erweiterungsbibliotheken hinzufügen/entfernen. Sie können einen Anzeigenamen angeben und entscheiden, ob die Bibliothek beim Starten geladen werden soll oder nicht. Nur benutzerdefinierte Datenquellen, Layouts, Webkomponenten und Handlebars-Helfer werden hier geladen.",
},
EnableTelemetryLabel: "PnP Telemetrie",
EnableTelemetryOn: "Telemetrie einschalten",
EnableTelemetryOff: "Telemetrie ausschalten"
}
},
CustomQueryModifier: {
EditQueryModifiersLabel: "Verfügbare benutzerdefinierte Abfragemodifikatoren konfigurieren",
Expand Down
Loading

0 comments on commit bea1970

Please sign in to comment.