applicationinsights
Version:
Microsoft Application Insights module for Node.js
1 lines • 31.8 kB
Source Map (JSON)
{"version":3,"file":"shim-config.js","sourceRoot":"","sources":["../../../src/shim/shim-config.ts"],"names":[],"mappings":";AAKA,4CAA0C;AAE1C,mCAAiI;AACjI,uDAAmD;AAGnD,MAAM,eAAe,GAAG,aAAa,CAAC,CAAC,sDAAsD;AAC7F,MAAM,QAAQ,GAAG,gCAAgC,CAAC,CAAC,qCAAqC;AACxF,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAC1D,MAAM,wBAAwB,GAAG,oCAAoC,CAAC;AACtE,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AACzD,MAAM,2BAA2B,GAAG,mDAAmD,CAAC;AACxF,MAAM,0BAA0B,GAAG,8CAA8C,CAAC;AAClF,MAAM,MAAM;IAkDR;;;KAGC;IACD,YAAY,WAAoB,EAAE,cAAyB;QACvD,8DAA8D;QAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC;QACtE,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,kCAAkC,IAAI,EAAE,CAAC;QACxF,IAAI,CAAC,eAAe,GAAG,cAAc,IAAI,EAAE,CAAC;IAChD,CAAC;IAEO,YAAY;QAChB,MAAM,UAAU,GAAG,gCAAc,CAAC,WAAW,EAAE,CAAC;QAChD,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,gCAAgC,GAAG,UAAU,CAAC,gCAAgC,CAAC;QACpF,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC;QACxD,IAAI,CAAC,sBAAsB,GA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EAAE;YACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,yEAAyE,uBAAe,EAAE,CAAC,CAAC;SACzH;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,iBAAS,MAAM,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license. See LICENSE file in the project root for details.\r\nimport http = require(\"http\");\r\nimport https = require(\"https\");\r\nimport azureCoreAuth = require(\"@azure/core-auth\");\r\nimport { diag } from \"@opentelemetry/api\";\r\nimport { HttpInstrumentationConfig } from \"@opentelemetry/instrumentation-http\";\r\nimport { DistributedTracingModes, IConfig, IDisabledExtendedMetrics, IWebInstrumentationConfig, UNSUPPORTED_MSG } from \"./types\";\r\nimport { ShimJsonConfig } from \"./shim-jsonConfig\";\r\nimport { AzureMonitorOpenTelemetryOptions, InstrumentationOptions, InstrumentationOptionsType } from \"../types\";\r\n\r\nconst ENV_azurePrefix = \"APPSETTING_\"; // Azure adds this prefix to all environment variables\r\nconst ENV_iKey = \"APPINSIGHTS_INSTRUMENTATIONKEY\"; // This key is provided in the readme\r\nconst legacy_ENV_iKey = \"APPINSIGHTS_INSTRUMENTATION_KEY\";\r\nconst ENV_profileQueryEndpoint = \"APPINSIGHTS_PROFILE_QUERY_ENDPOINT\";\r\nconst ENV_quickPulseHost = \"APPINSIGHTS_QUICKPULSE_HOST\";\r\nconst ENV_nativeMetricsDisableAll = \"APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS\";\r\nconst ENV_nativeMetricsDisablers = \"APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC\";\r\nclass Config implements IConfig {\r\n public connectionString: string;\r\n public endpointUrl: string;\r\n public maxBatchSize: number;\r\n public maxBatchIntervalMs: number;\r\n public disableAppInsights: boolean;\r\n public samplingPercentage: number;\r\n public correlationHeaderExcludedDomains: string[];\r\n public proxyHttpUrl: string;\r\n public proxyHttpsUrl: string;\r\n public httpAgent: http.Agent;\r\n public httpsAgent: https.Agent;\r\n public ignoreLegacyHeaders: boolean;\r\n public aadTokenCredential?: azureCoreAuth.TokenCredential;\r\n public enableAutoCollectConsole: boolean;\r\n public enableLoggerErrorToTrace: boolean;\r\n public enableAutoCollectExceptions: boolean;\r\n public enableAutoCollectPerformance: boolean;\r\n public enableAutoCollectExternalLoggers: boolean;\r\n public enableAutoCollectPreAggregatedMetrics: boolean;\r\n public enableAutoCollectHeartbeat: boolean;\r\n public enableAutoCollectRequests: boolean;\r\n public enableAutoCollectDependencies: boolean;\r\n public enableAutoDependencyCorrelation: boolean;\r\n public enableAutoCollectIncomingRequestAzureFunctions: boolean;\r\n public enableSendLiveMetrics: boolean;\r\n public enableUseDiskRetryCaching: boolean;\r\n public enableUseAsyncHooks: boolean;\r\n public distributedTracingMode: DistributedTracingModes;\r\n\r\n public enableAutoCollectExtendedMetrics: boolean | IDisabledExtendedMetrics;\r\n public enableResendInterval: number;\r\n public enableMaxBytesOnDisk: number;\r\n public enableInternalDebugLogging: boolean;\r\n public enableInternalWarningLogging: boolean;\r\n public disableAllExtendedMetrics: boolean;\r\n public extendedMetricDisablers: string;\r\n public quickPulseHost: string;\r\n public enableWebInstrumentation: boolean;\r\n public webInstrumentationConfig: IWebInstrumentationConfig[];\r\n public webInstrumentationSrc: string;\r\n public webInstrumentationConnectionString?: string;\r\n public noPatchModules: string;\r\n public noDiagnosticChannel: boolean;\r\n\r\n // Expose Distro config for further customization, other conflicting configs will take precedence over this.\r\n public azureMonitorOpenTelemetryOptions : AzureMonitorOpenTelemetryOptions;\r\n\r\n private _configWarnings: string[];\r\n\r\n /**\r\n * Creates a new Config instance\r\n * @param setupString Connection String, instrumentationKey is no longer supported here\r\n */\r\n constructor(setupString?: string, configWarnings?: string[]){\r\n // Load config values from env variables and JSON if available\r\n this._mergeConfig();\r\n this.connectionString = setupString;\r\n this.webInstrumentationConfig = this.webInstrumentationConfig || null;\r\n this.ignoreLegacyHeaders = true;\r\n this.webInstrumentationConnectionString = this.webInstrumentationConnectionString || \"\";\r\n this._configWarnings = configWarnings || [];\r\n }\r\n\r\n private _mergeConfig() {\r\n const jsonConfig = ShimJsonConfig.getInstance();\r\n this.connectionString = jsonConfig.connectionString;\r\n this.correlationHeaderExcludedDomains = jsonConfig.correlationHeaderExcludedDomains;\r\n this.disableAllExtendedMetrics = jsonConfig.disableAllExtendedMetrics;\r\n this.disableAppInsights = jsonConfig.disableAppInsights;\r\n this.distributedTracingMode = jsonConfig.distributedTracingMode;\r\n this.enableAutoCollectConsole = jsonConfig.enableAutoCollectConsole;\r\n this.enableLoggerErrorToTrace = jsonConfig.enableLoggerErrorToTrace;\r\n this.enableAutoCollectDependencies = jsonConfig.enableAutoCollectDependencies;\r\n this.enableAutoCollectIncomingRequestAzureFunctions = jsonConfig.enableAutoCollectIncomingRequestAzureFunctions;\r\n this.enableAutoCollectExceptions = jsonConfig.enableAutoCollectExceptions;\r\n this.enableAutoCollectExtendedMetrics = jsonConfig.enableAutoCollectExtendedMetrics;\r\n this.enableAutoCollectExternalLoggers = jsonConfig.enableAutoCollectExternalLoggers;\r\n this.enableAutoCollectHeartbeat = jsonConfig.enableAutoCollectHeartbeat;\r\n this.enableAutoCollectPerformance = jsonConfig.enableAutoCollectPerformance;\r\n this.enableAutoCollectPreAggregatedMetrics = jsonConfig.enableAutoCollectPreAggregatedMetrics;\r\n this.enableAutoCollectRequests = jsonConfig.enableAutoCollectRequests;\r\n this.enableAutoDependencyCorrelation = jsonConfig.enableAutoDependencyCorrelation;\r\n this.enableInternalDebugLogging = jsonConfig.enableInternalDebugLogging;\r\n this.enableInternalWarningLogging = jsonConfig.enableInternalWarningLogging;\r\n this.enableResendInterval = jsonConfig.enableResendInterval;\r\n this.enableMaxBytesOnDisk = jsonConfig.enableMaxBytesOnDisk;\r\n this.enableSendLiveMetrics = jsonConfig.enableSendLiveMetrics;\r\n this.enableUseAsyncHooks = jsonConfig.enableUseAsyncHooks;\r\n this.enableUseDiskRetryCaching = jsonConfig.enableUseDiskRetryCaching;\r\n this.endpointUrl = jsonConfig.endpointUrl;\r\n this.extendedMetricDisablers = jsonConfig.extendedMetricDisablers;\r\n this.ignoreLegacyHeaders = jsonConfig.ignoreLegacyHeaders;\r\n this.maxBatchIntervalMs = jsonConfig.maxBatchIntervalMs;\r\n this.maxBatchSize = jsonConfig.maxBatchSize;\r\n this.proxyHttpUrl = jsonConfig.proxyHttpUrl;\r\n this.proxyHttpsUrl = jsonConfig.proxyHttpsUrl;\r\n this.quickPulseHost = jsonConfig.quickPulseHost;\r\n this.samplingPercentage = jsonConfig.samplingPercentage;\r\n this.enableWebInstrumentation = jsonConfig.enableWebInstrumentation;\r\n this.webInstrumentationConnectionString = jsonConfig.webInstrumentationConnectionString;\r\n this.webInstrumentationConfig = jsonConfig.webInstrumentationConfig;\r\n this.webInstrumentationSrc = jsonConfig.webInstrumentationSrc;\r\n this.noPatchModules = jsonConfig.noPatchModules;\r\n this.noDiagnosticChannel = jsonConfig.noDiagnosticChannel\r\n }\r\n\r\n /**\r\n * Parse the config property to set the appropriate values on the AzureMonitorOpenTelemetryOptions\r\n */\r\n public parseConfig(): AzureMonitorOpenTelemetryOptions {\r\n const options: AzureMonitorOpenTelemetryOptions = Object.assign(\r\n {\r\n azureMonitorExporterOptions: {\r\n connectionString: this.connectionString,\r\n disableOfflineStorage: false,\r\n },\r\n enableAutoCollectPerformance: true,\r\n enableAutoCollectExceptions: true,\r\n instrumentationOptions: {\r\n http: { enabled: true },\r\n azureSdk: { enabled: true },\r\n mongoDb: { enabled: true },\r\n mySql: { enabled: true },\r\n redis: { enabled: true },\r\n redis4: { enabled: true },\r\n postgreSql: { enabled: true },\r\n bunyan: { enabled: true },\r\n winston: { enabled: true },\r\n },\r\n otlpTraceExporterConfig: {},\r\n otlpMetricExporterConfig: {},\r\n otlpLogExporterConfig: {},\r\n enableLiveMetrics: true,\r\n },\r\n this.azureMonitorOpenTelemetryOptions\r\n );\r\n\r\n (options.instrumentationOptions as InstrumentationOptions) = {\r\n ...options.instrumentationOptions,\r\n console: { enabled: false },\r\n };\r\n // If samplingPercentage is not defined, default to 100%\r\n const samplingRatio = this.samplingPercentage !== undefined ? this.samplingPercentage / 100 : 1;\r\n if (samplingRatio >= 0 && samplingRatio <= 1) {\r\n options.samplingRatio = samplingRatio;\r\n } else {\r\n options.samplingRatio = 1;\r\n this._configWarnings.push(\"Sampling percentage should be between 0 and 100. Defaulting to 100.\");\r\n }\r\n options.instrumentationOptions = {\r\n ...options.instrumentationOptions,\r\n http: {\r\n ...options.instrumentationOptions?.http,\r\n } as HttpInstrumentationConfig,\r\n }\r\n if (this.aadTokenCredential) {\r\n options.azureMonitorExporterOptions.credential = this.aadTokenCredential;\r\n }\r\n if (typeof (this.enableAutoCollectConsole) === \"boolean\") {\r\n const setting: boolean = this.enableAutoCollectConsole;\r\n (options.instrumentationOptions as InstrumentationOptions) = {\r\n ...options.instrumentationOptions,\r\n console: { enabled: setting },\r\n };\r\n }\r\n if (typeof (this.enableAutoCollectExceptions) === \"boolean\") {\r\n options.enableAutoCollectExceptions = this.enableAutoCollectExceptions;\r\n }\r\n\r\n if (this.enableAutoCollectDependencies === false && this.enableAutoCollectRequests === false) {\r\n options.instrumentationOptions.http.enabled = false;\r\n }\r\n else {\r\n if (this.enableAutoCollectDependencies === false) {\r\n options.instrumentationOptions = {\r\n ...options.instrumentationOptions,\r\n http: {\r\n ...options.instrumentationOptions?.http,\r\n enabled: true,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n ignoreOutgoingRequestHook: (request: http.RequestOptions) => true,\r\n } as HttpInstrumentationConfig\r\n };\r\n }\r\n if (this.enableAutoCollectRequests === false) {\r\n options.instrumentationOptions = {\r\n ...options.instrumentationOptions,\r\n http: {\r\n ...options.instrumentationOptions?.http,\r\n enabled: true,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n ignoreIncomingRequestHook: (request: http.RequestOptions) => true,\r\n } as HttpInstrumentationConfig\r\n };\r\n }\r\n }\r\n if (typeof (this.enableAutoCollectPerformance) === \"boolean\") {\r\n options.enableAutoCollectPerformance = this.enableAutoCollectPerformance;\r\n }\r\n if (typeof (this.enableAutoCollectExternalLoggers) === \"boolean\") {\r\n (options.instrumentationOptions as InstrumentationOptions) = {\r\n ...options.instrumentationOptions,\r\n winston: { enabled: this.enableAutoCollectExternalLoggers },\r\n bunyan: { enabled: this.enableAutoCollectExternalLoggers },\r\n };\r\n }\r\n if (this.enableUseDiskRetryCaching === false) {\r\n options.azureMonitorExporterOptions.disableOfflineStorage = true;\r\n }\r\n if (this.proxyHttpUrl || this.proxyHttpsUrl) {\r\n try {\r\n const proxyUrl = new URL(this.proxyHttpsUrl || this.proxyHttpUrl);\r\n options.azureMonitorExporterOptions.proxyOptions = {\r\n host: proxyUrl.hostname,\r\n port: Number(proxyUrl.port),\r\n };\r\n }\r\n catch (err) {\r\n diag.warn(\"failed to parse proxy URL.\");\r\n }\r\n }\r\n if (this.maxBatchIntervalMs) {\r\n options.otlpTraceExporterConfig = { ...options.otlpTraceExporterConfig, timeoutMillis: this.maxBatchIntervalMs };\r\n options.otlpMetricExporterConfig = { ...options.otlpMetricExporterConfig, timeoutMillis: this.maxBatchIntervalMs };\r\n options.otlpLogExporterConfig = { ...options.otlpLogExporterConfig, timeoutMillis: this.maxBatchIntervalMs };\r\n }\r\n if (this.enableInternalWarningLogging === true) {\r\n // Do not override env variable if present\r\n if (!process.env[\"APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL\"]) {\r\n process.env[\"APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL\"] = \"WARN\";\r\n }\r\n\r\n }\r\n if (this.enableInternalDebugLogging === true) {\r\n // Do not override env variable if present\r\n if (!process.env[\"APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL\"]) {\r\n process.env[\"APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL\"] = \"DEBUG\";\r\n }\r\n }\r\n if (this.enableAutoCollectPreAggregatedMetrics === false) {\r\n // Do not override env variable if present\r\n if (!process.env[\"APPLICATION_INSIGHTS_NO_STANDARD_METRICS\"]) {\r\n process.env[\"APPLICATION_INSIGHTS_NO_STANDARD_METRICS\"] = \"disable\";\r\n }\r\n }\r\n\r\n if (this.noDiagnosticChannel === true) {\r\n // Disable all instrumentations except http to conform with AppInsights 2.x behavior\r\n for (const mod in options.instrumentationOptions) {\r\n if (mod !== \"http\") {\r\n (options.instrumentationOptions as InstrumentationOptionsType)[mod] = { enabled: false };\r\n }\r\n }\r\n }\r\n\r\n if (this.noPatchModules && this.noDiagnosticChannel !== true) {\r\n const unpatchedModules: string[] = this.noPatchModules.split(\",\");\r\n // Convert module names not supported by new InstrumentationOptions\r\n for (let i = 0; i < unpatchedModules.length; i++) {\r\n if (unpatchedModules[i] === \"pg-pool\" || unpatchedModules[i] === \"pg\") {\r\n unpatchedModules[i] = \"postgresql\";\r\n } else if (unpatchedModules[i] === \"mongodb-core\") {\r\n unpatchedModules[i] = \"mongodb\";\r\n } else if (unpatchedModules[i] === \"redis\") {\r\n unpatchedModules.push(\"redis4\")\r\n }\r\n }\r\n\r\n // Disable instrumentation for unpatched modules\r\n for (const mod in options.instrumentationOptions) {\r\n if (unpatchedModules.indexOf(mod.toLowerCase()) !== -1) {\r\n (options.instrumentationOptions as InstrumentationOptionsType)[mod] = { enabled: false };\r\n }\r\n }\r\n }\r\n\r\n if (typeof (this.enableSendLiveMetrics) === \"boolean\") {\r\n options.enableLiveMetrics = this.enableSendLiveMetrics;\r\n }\r\n\r\n // BROWSER SDK LOADER\r\n if (this.enableWebInstrumentation === true) {\r\n options.browserSdkLoaderOptions = {\r\n enabled: this.enableWebInstrumentation,\r\n connectionString: this.webInstrumentationConnectionString,\r\n }\r\n }\r\n\r\n // NOT SUPPORTED CONFIGURATION OPTIONS\r\n if (\r\n this.enableAutoCollectExtendedMetrics === true ||\r\n typeof(this.enableAutoCollectExtendedMetrics) === \"object\" && Object.keys(this.enableAutoCollectExtendedMetrics).length > 0 ||\r\n typeof(this.disableAllExtendedMetrics) === \"boolean\" ||\r\n process.env[ENV_nativeMetricsDisableAll] ||\r\n process.env[ENV_nativeMetricsDisablers] ||\r\n this.extendedMetricDisablers\r\n ) {\r\n this._configWarnings.push(`Extended metrics are no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.disableAppInsights) {\r\n this._configWarnings.push(`disableAppInsights configuration no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableAutoCollectHeartbeat === true) {\r\n this._configWarnings.push(`Heartbeat metrics are no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableAutoDependencyCorrelation === false) {\r\n this._configWarnings.push(`Auto dependency correlation cannot be turned off anymore. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (typeof (this.enableAutoCollectIncomingRequestAzureFunctions) === \"boolean\") {\r\n this._configWarnings.push(`Auto request generation in Azure Functions is no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableUseAsyncHooks === false) {\r\n this._configWarnings.push(`The use of non async hooks is no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.distributedTracingMode === DistributedTracingModes.AI) {\r\n this._configWarnings.push(`AI only distributed tracing mode is no longer supported. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableResendInterval) {\r\n this._configWarnings.push(`The resendInterval configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableMaxBytesOnDisk) {\r\n this._configWarnings.push(`The maxBytesOnDisk configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.ignoreLegacyHeaders === false) {\r\n this._configWarnings.push(`LegacyHeaders are not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.maxBatchSize) {\r\n this._configWarnings.push(`The maxBatchSize configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.enableLoggerErrorToTrace) {\r\n this._configWarnings.push(`The enableLoggerErrorToTrace configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.httpAgent || this.httpsAgent) {\r\n this._configWarnings.push(`The httpAgent and httpsAgent configuration options are not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (\r\n this.webInstrumentationConfig || this.webInstrumentationSrc\r\n ) {\r\n this._configWarnings.push(`The webInstrumentation config and src options are not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.quickPulseHost) {\r\n this._configWarnings.push(`The quickPulseHost configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (this.correlationHeaderExcludedDomains) {\r\n this._configWarnings.push(`The correlationHeaderExcludedDomains configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (\r\n process.env[ENV_iKey] ||\r\n process.env[legacy_ENV_iKey] ||\r\n process.env[ENV_azurePrefix + ENV_iKey] ||\r\n process.env[ENV_azurePrefix + legacy_ENV_iKey]\r\n ) {\r\n this._configWarnings.push(`The iKey configuration option is not supported by the shim. Please configure the the connection string instead. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (process.env[ENV_profileQueryEndpoint]) {\r\n this._configWarnings.push(`The profileQueryEndpoint configuration option is not supported by the shim. ${UNSUPPORTED_MSG}`);\r\n }\r\n if (process.env[ENV_quickPulseHost]) {\r\n this._configWarnings.push(`Please configure the quickPulseHost in the connection string instead. ${UNSUPPORTED_MSG}`);\r\n }\r\n return options;\r\n }\r\n}\r\n\r\nexport = Config;"]}