applicationinsights
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -180,6 +180,3 @@ "use strict"; | ||
function getCorrelationContext() { | ||
if (exports.defaultClient.config.enableAutoDependencyCorrelation) { | ||
return CorrelationContextManager.CorrelationContextManager.getCurrentContext(); | ||
} | ||
return null; | ||
return CorrelationContextManager.CorrelationContextManager.getCurrentContext(); | ||
} | ||
@@ -226,6 +223,8 @@ exports.getCorrelationContext = getCorrelationContext; | ||
if (collectConsoleLog === void 0) { collectConsoleLog = false; } | ||
exports.defaultClient.config.enableAutoCollectExternalLoggers = value; | ||
exports.defaultClient.config.enableAutoCollectConsole = collectConsoleLog; | ||
if (_isStarted) { | ||
_console.enable(value, collectConsoleLog); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectExternalLoggers = value; | ||
exports.defaultClient.config.enableAutoCollectConsole = collectConsoleLog; | ||
if (_isStarted) { | ||
_console.enable(value, collectConsoleLog); | ||
} | ||
} | ||
@@ -240,5 +239,7 @@ return Configuration; | ||
Configuration.setAutoCollectExceptions = function (value) { | ||
exports.defaultClient.config.enableAutoCollectExceptions = value; | ||
if (_isStarted) { | ||
_exceptions.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectExceptions = value; | ||
if (_isStarted) { | ||
_exceptions.enable(value); | ||
} | ||
} | ||
@@ -255,8 +256,10 @@ return Configuration; | ||
if (collectExtendedMetrics === void 0) { collectExtendedMetrics = true; } | ||
exports.defaultClient.config.enableAutoCollectPerformance = value; | ||
var extendedMetricsConfig = NativePerformance_1.AutoCollectNativePerformance.parseEnabled(collectExtendedMetrics, exports.defaultClient.config); | ||
exports.defaultClient.config.enableAutoCollectExtendedMetrics = extendedMetricsConfig.isEnabled; | ||
if (_isStarted) { | ||
_performance.enable(value); | ||
_nativePerformance.enable(exports.defaultClient.config.enableAutoCollectExtendedMetrics, extendedMetricsConfig.disabledMetrics); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectPerformance = value; | ||
var extendedMetricsConfig = NativePerformance_1.AutoCollectNativePerformance.parseEnabled(collectExtendedMetrics, exports.defaultClient.config); | ||
exports.defaultClient.config.enableAutoCollectExtendedMetrics = extendedMetricsConfig.isEnabled; | ||
if (_isStarted) { | ||
_performance.enable(value); | ||
_nativePerformance.enable(exports.defaultClient.config.enableAutoCollectExtendedMetrics, extendedMetricsConfig.disabledMetrics); | ||
} | ||
} | ||
@@ -271,5 +274,7 @@ return Configuration; | ||
Configuration.setAutoCollectPreAggregatedMetrics = function (value) { | ||
exports.defaultClient.config.enableAutoCollectPreAggregatedMetrics = value; | ||
if (_isStarted) { | ||
_preAggregatedMetrics.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectPreAggregatedMetrics = value; | ||
if (_isStarted) { | ||
_preAggregatedMetrics.enable(value); | ||
} | ||
} | ||
@@ -284,5 +289,7 @@ return Configuration; | ||
Configuration.setAutoCollectHeartbeat = function (value) { | ||
exports.defaultClient.config.enableAutoCollectHeartbeat = value; | ||
if (_isStarted) { | ||
_heartbeat.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectHeartbeat = value; | ||
if (_isStarted) { | ||
_heartbeat.enable(value); | ||
} | ||
} | ||
@@ -299,6 +306,8 @@ return Configuration; | ||
Configuration.enableAutoWebSnippetInjection = function (value, webSnippetConnectionString) { | ||
exports.defaultClient.config.enableWebInstrumentation = value; | ||
exports.defaultClient.config.webInstrumentationConnectionString = webSnippetConnectionString; | ||
if (_isStarted) { | ||
_webSnippet.enable(exports.defaultClient.config.enableAutoWebSnippetInjection, exports.defaultClient.config.webSnippetConnectionString); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableWebInstrumentation = value; | ||
exports.defaultClient.config.webInstrumentationConnectionString = webSnippetConnectionString; | ||
if (_isStarted) { | ||
_webSnippet.enable(exports.defaultClient.config.enableAutoWebSnippetInjection, exports.defaultClient.config.webSnippetConnectionString); | ||
} | ||
} | ||
@@ -314,6 +323,8 @@ return Configuration; | ||
Configuration.enableWebInstrumentation = function (value, webSnippetConnectionString) { | ||
exports.defaultClient.config.enableWebInstrumentation = value; | ||
exports.defaultClient.config.webInstrumentationConnectionString = webSnippetConnectionString; | ||
if (_isStarted) { | ||
_webSnippet.enable(exports.defaultClient.config.enableWebInstrumentation, exports.defaultClient.config.webInstrumentationConnectionString); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableWebInstrumentation = value; | ||
exports.defaultClient.config.webInstrumentationConnectionString = webSnippetConnectionString; | ||
if (_isStarted) { | ||
_webSnippet.enable(exports.defaultClient.config.enableWebInstrumentation, exports.defaultClient.config.webInstrumentationConnectionString); | ||
} | ||
} | ||
@@ -328,5 +339,7 @@ return Configuration; | ||
Configuration.setAutoCollectRequests = function (value) { | ||
exports.defaultClient.config.enableAutoCollectRequests = value; | ||
if (_isStarted) { | ||
_serverRequests.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectRequests = value; | ||
if (_isStarted) { | ||
_serverRequests.enable(value); | ||
} | ||
} | ||
@@ -341,5 +354,7 @@ return Configuration; | ||
Configuration.setAutoCollectDependencies = function (value) { | ||
exports.defaultClient.config.enableAutoCollectDependencies = value; | ||
if (_isStarted) { | ||
_clientRequests.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectDependencies = value; | ||
if (_isStarted) { | ||
_clientRequests.enable(value); | ||
} | ||
} | ||
@@ -355,6 +370,8 @@ return Configuration; | ||
Configuration.setAutoDependencyCorrelation = function (value, useAsyncHooks) { | ||
exports.defaultClient.config.enableAutoDependencyCorrelation = value; | ||
exports.defaultClient.config.enableUseAsyncHooks = useAsyncHooks; | ||
if (_isStarted) { | ||
_serverRequests.useAutoCorrelation(value, useAsyncHooks); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoDependencyCorrelation = value; | ||
exports.defaultClient.config.enableUseAsyncHooks = useAsyncHooks; | ||
if (_isStarted) { | ||
_serverRequests.useAutoCorrelation(value, useAsyncHooks); | ||
} | ||
} | ||
@@ -374,7 +391,9 @@ return Configuration; | ||
Configuration.setUseDiskRetryCaching = function (value, resendInterval, maxBytesOnDisk) { | ||
exports.defaultClient.config.enableUseDiskRetryCaching = value; | ||
exports.defaultClient.config.enableResendInterval = resendInterval; | ||
exports.defaultClient.config.enableMaxBytesOnDisk = maxBytesOnDisk; | ||
if (exports.defaultClient && exports.defaultClient.channel) { | ||
exports.defaultClient.channel.setUseDiskRetryCaching(exports.defaultClient.config.enableUseDiskRetryCaching, exports.defaultClient.config.enableResendInterval, exports.defaultClient.config.enableMaxBytesOnDisk); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableUseDiskRetryCaching = value; | ||
exports.defaultClient.config.enableResendInterval = resendInterval; | ||
exports.defaultClient.config.enableMaxBytesOnDisk = maxBytesOnDisk; | ||
if (exports.defaultClient.channel) { | ||
exports.defaultClient.channel.setUseDiskRetryCaching(exports.defaultClient.config.enableUseDiskRetryCaching, exports.defaultClient.config.enableResendInterval, exports.defaultClient.config.enableMaxBytesOnDisk); | ||
} | ||
} | ||
@@ -402,5 +421,7 @@ return Configuration; | ||
Configuration.setAutoCollectIncomingRequestAzureFunctions = function (value) { | ||
exports.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions = value; | ||
if (_isStarted) { | ||
_azureFunctions.enable(value); | ||
if (exports.defaultClient) { | ||
exports.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions = value; | ||
if (_isStarted) { | ||
_azureFunctions.enable(value); | ||
} | ||
} | ||
@@ -407,0 +428,0 @@ return Configuration; |
import Contracts = require("./Contracts"); | ||
export declare const APPLICATION_INSIGHTS_SDK_VERSION = "2.8.0"; | ||
export declare const APPLICATION_INSIGHTS_SDK_VERSION = "2.9.0"; | ||
export declare const DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com"; | ||
@@ -4,0 +4,0 @@ export declare const DEFAULT_LIVEMETRICS_ENDPOINT = "https://rt.services.visualstudio.com"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
exports.WEB_INSTRUMENTATION_DEPRECATED_SOURCE = exports.WEB_INSTRUMENTATION_DEFAULT_SOURCE = exports.TIME_SINCE_ENQUEUED = exports.ENQUEUED_TIME = exports.MessageBusDestination = exports.MicrosoftEventHub = exports.AzNamespace = exports.HttpRequestCookieNames = exports.StatsbeatNetworkCategory = exports.StatsbeatFeatureType = exports.StatsbeatInstrumentation = exports.StatsbeatFeature = exports.StatsbeatCounter = exports.StatsbeatAttach = exports.StatsbeatResourceProvider = exports.StatsbeatTelemetryName = exports.HeartBeatMetricName = exports.DependencyTypeName = exports.TelemetryTypeStringToQuickPulseDocumentType = exports.TelemetryTypeStringToQuickPulseType = exports.QuickPulseType = exports.QuickPulseDocumentType = exports.PerformanceToQuickPulseCounter = exports.MetricId = exports.PerformanceCounter = exports.QuickPulseCounter = exports.DEFAULT_LIVEMETRICS_HOST = exports.DEFAULT_LIVEMETRICS_ENDPOINT = exports.DEFAULT_BREEZE_ENDPOINT = exports.APPLICATION_INSIGHTS_SDK_VERSION = void 0; | ||
exports.APPLICATION_INSIGHTS_SDK_VERSION = "2.8.0"; | ||
exports.APPLICATION_INSIGHTS_SDK_VERSION = "2.9.0"; | ||
exports.DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com"; | ||
@@ -8,0 +8,0 @@ exports.DEFAULT_LIVEMETRICS_ENDPOINT = "https://rt.services.visualstudio.com"; |
@@ -37,3 +37,5 @@ import { Domain } from "./Generated"; | ||
endpointsuffix?: string; | ||
aadaudience?: string; | ||
authorization?: string; | ||
} | ||
export declare type ConnectionStringKey = "instrumentationkey" | "ingestionendpoint" | "liveendpoint" | "location" | "endpointsuffix"; | ||
export declare type ConnectionStringKey = "instrumentationkey" | "ingestionendpoint" | "liveendpoint" | "location" | "endpointsuffix" | "aadaudience" | "authorization"; |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
private _azureTokenPolicy; | ||
constructor(credential: azureCoreAuth.TokenCredential); | ||
constructor(credential: azureCoreAuth.TokenCredential, aadAudience?: string); | ||
/** | ||
@@ -10,0 +10,0 @@ * Applies the Bearer token to the request through the Authorization header. |
@@ -44,4 +44,4 @@ "use strict"; | ||
var AuthorizationHandler = /** @class */ (function () { | ||
function AuthorizationHandler(credential) { | ||
var scopes = [applicationInsightsResource]; | ||
function AuthorizationHandler(credential, aadAudience) { | ||
var scopes = aadAudience ? [aadAudience] : [applicationInsightsResource]; | ||
this._azureTokenPolicy = azureCore.bearerTokenAuthenticationPolicy({ credential: credential, scopes: scopes }); | ||
@@ -48,0 +48,0 @@ } |
@@ -27,2 +27,3 @@ /// <reference types="node" /> | ||
aadTokenCredential?: azureCoreAuth.TokenCredential; | ||
aadAudience?: string; | ||
enableAutoCollectConsole: boolean; | ||
@@ -29,0 +30,0 @@ enableLoggerErrorToTrace: boolean; |
@@ -54,2 +54,3 @@ "use strict"; | ||
} | ||
this.aadAudience = csCode.aadaudience || csEnv.aadaudience; | ||
} | ||
@@ -56,0 +57,0 @@ Object.defineProperty(Config.prototype, "profileQueryEndpoint", { |
@@ -169,3 +169,3 @@ "use strict"; | ||
Logging.info(TelemetryClient.TAG, "Adding authorization handler"); | ||
this.authorizationHandler = new AuthorizationHandler(config.aadTokenCredential); | ||
this.authorizationHandler = new AuthorizationHandler(config.aadTokenCredential, config.aadAudience); | ||
} | ||
@@ -172,0 +172,0 @@ return this.authorizationHandler; |
@@ -6,3 +6,3 @@ { | ||
"bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "Microsoft Application Insights module for Node.js", | ||
@@ -9,0 +9,0 @@ "repository": { |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1590120
14586