sp-dev-fx-webparts/samples/react-appinsights-dashboard/README.md

95 lines
3.8 KiB
Markdown
Raw Normal View History

2020-05-16 00:33:02 -04:00
---
page_type: sample
products:
- office-sp
languages:
- javascript
- typescript
extensions:
contentType: samples
technologies:
- SharePoint Framework
platforms:
- react
createdDate: 5/10/2020 12:00:00 AM
---
# React AppInsights Dashboard
## Summary
2020-05-16 00:33:02 -04:00
This web part displays different statistics data captured in the **Azure Application Insights** in a graphical representation. Filters are provided to search for certain period of days. There are few **Application Customizer** which can be activated in **SharePoint Online** to track page view, performance etc., to **Azure Application Insights**, but the data can be viewed only by the administrator who is in-charge of **Azure portal**. Not all the users will have access to this data, this web gupart will provide access to those data that can be used by the portal administrators and developers to keep track of the page performance and hits. Fetched insights data using **[Application Insights API](https://dev.applicationinsights.io/)**.
## Pre-requisites
2020-05-16 00:33:02 -04:00
**Azure Application Insights** has to be configured. If you want to track the **SharePoint Online** web parts and pages, please use either of the following **Application Customizer** or you can use your own extensions to track the pages and other components.
* [Injecting JavaScript with SharePoint Framework Extensions - Azure Application Insights](https://github.com/pnp/sp-dev-fx-extensions/tree/master/samples/js-application-appinsights)
* [JS Application AppInsights Advanced](https://github.com/pnp/sp-dev-fx-extensions/tree/master/samples/js-application-appinsights-advanced)
2020-05-16 00:33:02 -04:00
Following are required to access the data using **[App Insights API](https://dev.applicationinsights.io/)**. The API has been provided in a very simple way with **[API Explorer](https://dev.applicationinsights.io/apiexplorer)** for the developers to play around the API to understand the schema and the methods that can used.
* **Application ID** of the Application Insights
* **API Key** for the data access
![AppInsights API Application ID](./assets/AppInsights_APIAccess.png)
![AppInsights API Key](./assets/AppInsights_APIKey.png)
## Properties
* **_Application ID_**: Application ID of the Azure Application Insights API Access.
* **_Application Key_**: Application Key of the Azure Application Insights API Access.
## Preview
2020-05-16 00:33:02 -04:00
#### AppInsights Dashboard
2020-05-16 00:33:02 -04:00
![AppInsights Dashboard](./assets/AppInsights_Dashboard.gif)
2020-05-16 00:33:02 -04:00
#### Page Statistics
2020-05-16 00:33:02 -04:00
![AppInsights Dashboard - Page Statistics](./assets/PageStatistics.png)
2020-05-16 00:33:02 -04:00
#### User Statistics
2020-05-16 00:33:02 -04:00
![AppInsights Dashboard - User Statistics](./assets/UserStatistics.png)
2020-05-16 00:33:02 -04:00
#### Performance Statistics
2020-05-16 00:33:02 -04:00
![AppInsights Dashboard - Performance Statistics](./assets/PerformanceStatistics.png)
## Applies to
* [SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
* [Office 365 tenant](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
## SharePoint Framework Pre-requisites
2020-05-16 00:33:02 -04:00
**@microsoft/generator-sharepoint - 1.10.0**
## Solution
Solution|Author(s)
--------|---------
react-appinsights-dashboard | Sudharsan K.([@sudharsank](https://twitter.com/sudharsank), [Know More](http://windowssharepointserver.blogspot.com/))
## Version history
Version|Date|Comments
-------|----|--------
1.0.0.0|May 10, 2020|Initial release
1.0.0.1|June 16, 2020|Initial release
## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
## Minimal Path to Awesome
- Clone this repository
- in the command line run:
- `npm install`
- `gulp bundle --ship && gulp package-solution --ship`
#### Local Mode
2020-05-16 00:33:02 -04:00
This solution doesn't work on local mode.
<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-appinsights-dashboard" />