application-insights-fetch-monitor
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/MaximBalaganskiy/application-insights-fetch-monitor/compare/v1.0.4...v1.1.0) (2018-07-26) | ||
### Bug Fixes | ||
* **monitor:** clean up unused unprotected code ([d79a292](https://github.com/MaximBalaganskiy/application-insights-fetch-monitor/commit/d79a292)) | ||
### Features | ||
* **monitor:** record failure reason ([11ba0c5](https://github.com/MaximBalaganskiy/application-insights-fetch-monitor/commit/11ba0c5)) | ||
<a name="1.0.4"></a> | ||
@@ -7,0 +22,0 @@ ## [1.0.4](https://github.com/MaximBalaganskiy/application-insights-fetch-monitor/compare/v1.0.3...v1.0.4) (2018-07-23) |
@@ -66,3 +66,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
var id = "|" + fetchMonitorInstance.appInsights.context.operation.id + "." + Microsoft.ApplicationInsights.Util.newId(); | ||
var ajaxData; | ||
@@ -85,3 +84,3 @@ try { | ||
.catch(function (reason) { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -174,3 +173,3 @@ }); | ||
}; | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData) { | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData, reason) { | ||
try { | ||
@@ -188,2 +187,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
var dependency = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData(ajaxData.id, ajaxData.getAbsoluteUrl(), ajaxData.getPathName(), ajaxData.ajaxTotalDuration, false, 0, ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -190,0 +190,0 @@ } |
@@ -66,3 +66,2 @@ "use strict"; | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
var id = "|" + fetchMonitorInstance.appInsights.context.operation.id + "." + Microsoft.ApplicationInsights.Util.newId(); | ||
var ajaxData; | ||
@@ -85,3 +84,3 @@ try { | ||
.catch(function (reason) { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -174,3 +173,3 @@ }); | ||
}; | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData) { | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData, reason) { | ||
try { | ||
@@ -188,2 +187,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
var dependency = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData(ajaxData.id, ajaxData.getAbsoluteUrl(), ajaxData.getPathName(), ajaxData.ajaxTotalDuration, false, 0, ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -190,0 +190,0 @@ } |
@@ -64,3 +64,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
var id = "|" + fetchMonitorInstance.appInsights.context.operation.id + "." + Microsoft.ApplicationInsights.Util.newId(); | ||
var ajaxData; | ||
@@ -83,3 +82,3 @@ try { | ||
.catch(function (reason) { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -172,3 +171,3 @@ }); | ||
}; | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData) { | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData, reason) { | ||
try { | ||
@@ -186,2 +185,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
var dependency = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData(ajaxData.id, ajaxData.getAbsoluteUrl(), ajaxData.getPathName(), ajaxData.ajaxTotalDuration, false, 0, ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -188,0 +188,0 @@ } |
@@ -64,3 +64,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
var id = "|" + fetchMonitorInstance.appInsights.context.operation.id + "." + Microsoft.ApplicationInsights.Util.newId(); | ||
var ajaxData; | ||
@@ -83,3 +82,3 @@ try { | ||
.catch(function (reason) { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -172,3 +171,3 @@ }); | ||
}; | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData) { | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData, reason) { | ||
try { | ||
@@ -186,2 +185,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
var dependency = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData(ajaxData.id, ajaxData.getAbsoluteUrl(), ajaxData.getPathName(), ajaxData.ajaxTotalDuration, false, 0, ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -188,0 +188,0 @@ } |
@@ -93,3 +93,2 @@ System.register(["./app-insights-sdk"], function (exports_1, context_1) { | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
var id = "|" + fetchMonitorInstance.appInsights.context.operation.id + "." + Microsoft.ApplicationInsights.Util.newId(); | ||
var ajaxData; | ||
@@ -112,3 +111,3 @@ try { | ||
.catch(function (reason) { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -201,3 +200,3 @@ }); | ||
}; | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData) { | ||
FetchMonitor.prototype.onFetchFailed = function (input, ajaxData, reason) { | ||
try { | ||
@@ -215,2 +214,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
var dependency = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData(ajaxData.id, ajaxData.getAbsoluteUrl(), ajaxData.getPathName(), ajaxData.ajaxTotalDuration, false, 0, ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -217,0 +217,0 @@ } |
{ | ||
"name": "application-insights-fetch-monitor", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Fetch API monitor for Application Insights", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js", |
@@ -40,3 +40,2 @@ import "./app-insights-sdk"; | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
let id: string = `|${fetchMonitorInstance.appInsights.context.operation.id}.${Microsoft.ApplicationInsights.Util.newId()}`; | ||
let ajaxData: Microsoft.ApplicationInsights.ajaxRecord; | ||
@@ -62,3 +61,3 @@ try { | ||
.catch(reason => { | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData); | ||
fetchMonitorInstance.onFetchFailed(input, ajaxData, reason); | ||
throw reason; | ||
@@ -168,3 +167,3 @@ }); | ||
private onFetchFailed(input: Request | string, ajaxData: Microsoft.ApplicationInsights.ajaxRecord): void { | ||
private onFetchFailed(input: Request | string, ajaxData: Microsoft.ApplicationInsights.ajaxRecord, reason: any): void { | ||
try { | ||
@@ -193,3 +192,3 @@ ajaxData.responseFinishedTime = Microsoft.ApplicationInsights.dateTime.Now(); | ||
ajaxData.method); | ||
dependency.properties = { error: reason.message }; | ||
this.appInsights.trackDependencyData(dependency); | ||
@@ -196,0 +195,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
136972