How to use the applicationinsights.start function in applicationinsights

To help you get started, we’ve selected a few applicationinsights examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotFramework-Emulator / packages / app / main / src / telemetry / telemetryService.ts View on Github external
private static startup(): void {
    if (!this._hasStarted) {
      AppInsights.setup(INSTRUMENTATION_KEY)
        // turn off extra instrumentation
        .setAutoCollectConsole(false)
        .setAutoCollectDependencies(false)
        .setAutoCollectExceptions(false)
        .setAutoCollectPerformance(false)
        .setAutoCollectRequests(false)
        // Fix for zonejs / restify conflict (https://github.com/Microsoft/ApplicationInsights-node.js/issues/460)
        .setAutoDependencyCorrelation(false);
      // do not collect the user's machine name
      AppInsights.defaultClient.context.tags[AppInsights.defaultClient.context.keys.cloudRoleInstance] = '';
      AppInsights.start();

      this._client = AppInsights.defaultClient;
      this._hasStarted = true;
    }
  }
}
github CatalystCode / project-fortis / project-fortis-services / src / clients / appinsights / AppInsightsClient.js View on Github external
function setup() {
  if (appinsightsInstrumentationkey) {
    const appInsights = require('applicationinsights');
    appInsights.setup(appinsightsInstrumentationkey);
    appInsights.start();
    client = appInsights.getClient(appinsightsInstrumentationkey);
    console.log = trackTrace(TRACE_LEVEL_INFO, consoleLog);
    console.warn = trackTrace(TRACE_LEVEL_WARNING, consoleWarn);
    console.error = trackTrace(TRACE_LEVEL_ERROR, consoleError);
  }
}