diff --git a/providers/logging/insights.js b/providers/logging/insights.js index 7d194f99..98b4410f 100644 --- a/providers/logging/insights.js +++ b/providers/logging/insights.js @@ -4,19 +4,19 @@ const appInsights = require('applicationinsights') class Insights { - constructor(tattoos, client = null, echo = true) { + constructor(options, client = null, echo = false) { this.client = client - this.tattoos = tattoos + this.options = options this.echo = echo } - static setup(tattoos, key = 'mock', echo = true) { + static setup(options, key = 'mock', echo = false) { // exit if we are already setup if (appInsights.defaultClient instanceof Insights) return - if (!key || key === 'mock') appInsights.defaultClient = new Insights(tattoos, null, echo) + if (!key || key === 'mock') appInsights.defaultClient = new Insights(options, null, echo) else { appInsights.setup(key).setAutoCollectPerformance(false).setAutoCollectDependencies(false).start() - appInsights.defaultClient = new Insights(tattoos, appInsights.defaultClient, echo) + appInsights.defaultClient = new Insights(options, appInsights.defaultClient, echo) } } @@ -43,7 +43,7 @@ class Insights { } tattoo(telemetry) { - telemetry.properties = { ...(telemetry.properties || {}), ...this.tattoos } + telemetry.properties = { ...(telemetry.properties || {}), ...this.options } } } module.exports = Insights diff --git a/providers/logging/logger.js b/providers/logging/logger.js index 147880e5..c01ce68e 100644 --- a/providers/logging/logger.js +++ b/providers/logging/logger.js @@ -7,8 +7,8 @@ const aiLogger = require('winston-azure-application-insights').AzureApplicationI const winston = require('winston') const insights = require('./insights') -function factory(tattoos) { - insights.setup(tattoos, config.get('CRAWLER_INSIGHTS_KEY'), config.get('CRAWLER_ECHO')) +function factory(options) { + insights.setup(options, config.get('CRAWLER_INSIGHTS_KEY'), config.get('CRAWLER_ECHO')) const result = new winston.Logger() result.add(aiLogger, { insights: appInsights,