feat: Add Tenant Telemetry Application Customizer sample #1548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new sample: Tenant Telemetry Application Customizer.
The solution provides a lightweight tenant-wide telemetry framework for SPFx solutions, enabling modern monitoring of component usage, page context, versions, and custom events across SharePoint Online.
The Application Customizer listens for browser
CustomEvent-based telemetry messages and forwards them—based on configuration—to either Azure Application Insights or a custom Azure Function endpoint.Key Features
Tenant-wide Application Customizer for telemetry collection
TelemetryService supporting two modes:
appinsights— direct ingestion via Application Insights Connection Stringfunction— POST telemetry to an Azure FunctionSimple integration from web parts via:
Automatic enrichment with:
Site URL
Page URL
Component ID, name, version
Works across all modern SharePoint sites without modifying existing web parts
Configurable at runtime using Tenant Wide Extensions
Includes full TypeScript, localization, and manifest configuration
Suitable for analytics, usage tracking, component adoption, and operational telemetry
What's in this Pull Request?
Added
package.jsonwith required dependencies and build scriptsAdded
ClientSideInstance.xmlandelements.xmlfor SharePoint integrationImplemented TelemetryService (App Insights + Azure Function support)
Implemented TenantTelemetryApplicationCustomizer to initialize telemetry and listen globally for telemetry events
Included localization support (
en-us.js,myStrings.d.ts)Configured TypeScript with project-appropriate settings (
tsconfig.json)Added README documentation, sample usage instructions, and console testing steps
Included preview image and PnP sample metadata
PR Metadata
Additional Notes
This sample demonstrates a scalable pattern for enterprise-grade telemetry collection across thousands of SharePoint Online sites. It enables administrators and developers to understand adoption, diagnose issues, and build richer insights without modifying each web part.