vue-app-insights
v1.0.8
Published
Application insights for vue.js. Add custom property to every log in application insights from one place
Downloads
169
Readme
vue-app-insights
Installation
$ npm install vue-app-insights --save
Get started
Use app-insights without router
import Vue from "vue";
import VueAppInsights from "vue-app-insights";
Vue.use(VueAppInsights, {
id: "XXXXXXXX--XXXX-XXXX-XXXXXXXXXXXX"
});
Use app-insights with router
import Vue from "vue";
import router from "./router";
import VueAppInsights from "vue-app-insights";
Vue.use(VueAppInsights, {
id: "XXXXXXXX--XXXX-XXXX-XXXXXXXXXXXX",
router
});
Use app-insights to track custom events
this.$appInsights.trackEvent(name: string, properties?: {[string]:string}, measurements?: {[string]:number})
Use app-insights to track exception
this.$appInsights.trackException(exception: Error, handledAt?: string, properties?: {[string]:string}, measurements?: {[string]:number}, severityLevel?: AI.SeverityLevel)
Use app-insights to track metrics
this.$appInsights.trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: {[string]:string})
Use app-insights to track trace
this.$appInsights.trackTrace(message: string, properties?: {[string]:string}, severityLevel?: AI.SeverityLevel)
Use app-insights to track dependancy
this.$appInsights.trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) {
Use app-insights to add custom properties
import Vue from "vue";
import router from "./router";
import VueAppInsights from "vue-app-insights";
Vue.use(VueAppInsights, {
id: "XXXXXXXX--XXXX-XXXX-XXXXXXXXXXXX",
router,
property: { "custom property": "custom value" }
});
Use app-insights to add configuration
import Vue from "vue";
import router from "./router";
import VueAppInsights from "vue-app-insights";
Vue.use(VueAppInsights, {
id: "XXXXXXXX--XXXX-XXXX-XXXXXXXXXXXX",
router,
property: { "custom property": "custom value" },
IConfig: {
disableTelemetry: false,
disableAjaxTracking: true
}
});