Socket
Socket
Sign inDemoInstall

applicationinsights

Package Overview
Dependencies
111
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.9.4 to 2.9.5

18

out/AutoCollection/CorrelationContextManager.js

@@ -147,3 +147,10 @@ "use strict";

}
CorrelationContextManager.session = this.cls.createNamespace("AI-CLS-Session");
try {
CorrelationContextManager.session = this.cls.createNamespace("AI-CLS-Session");
}
catch (error) {
Logging.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost", Util.dumpObj(error));
this.enabled = false;
return;
}
DiagChannel.registerContextPreservation(function (cb) {

@@ -234,3 +241,10 @@ try {

CorrelationContextManager.session = null;
CorrelationContextManager.session = this.cls.createNamespace("AI-CLS-Session");
try {
CorrelationContextManager.session = this.cls.createNamespace("AI-CLS-Session");
}
catch (error) {
Logging.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost", Util.dumpObj(error));
this.enabled = false;
return;
}
}

@@ -237,0 +251,0 @@ };

5

out/Bootstrap/Default.d.ts

@@ -12,7 +12,2 @@ import * as azureCoreAuth from "@azure/core-auth";

export declare function setLogger(logger: DiagnosticLogger): DiagnosticLogger;
/**
* Sets the string which is prefixed to the existing sdkVersion, e.g. `ad_`, `alr_`
* @param prefix string prefix, including underscore. Defaults to `ud_`
*/
export declare function setUsagePrefix(prefix: string): void;
export declare function setStatusLogger(statusLogger: StatusLogger): void;

@@ -19,0 +14,0 @@ /**

@@ -33,3 +33,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.setupAndStart = exports.setStatusLogger = exports.setUsagePrefix = exports.setLogger = exports.defaultConfig = void 0;
exports.setupAndStart = exports.setStatusLogger = exports.setLogger = exports.defaultConfig = void 0;
var Helpers = __importStar(require("./Helpers"));

@@ -42,6 +42,8 @@ var Constants = require("../Declarations/Constants");

var PrefixHelpers = __importStar(require("../Library/PrefixHelper"));
var Context = require("../Library/Context");
// Private configuration vars
var _appInsights;
var _prefix = "ud_"; // Unknown, Default
exports.defaultConfig = new Config(); // Will read env variables, expose for Agent initialization
var _prefix = "" + PrefixHelpers.getResourceProvider() + PrefixHelpers.getOsPrefix() + Constants.AttachTypePrefix.INTEGRATED_AUTO + "_";
var _fullSdkVersion = _prefix + "node:" + Context.sdkVersion;
var _instrumentationKey = exports.defaultConfig.instrumentationKey;

@@ -60,10 +62,2 @@ var _logger = new DiagnosticLogger_1.DiagnosticLogger(console, _instrumentationKey);

exports.setLogger = setLogger;
/**
* Sets the string which is prefixed to the existing sdkVersion, e.g. `ad_`, `alr_`
* @param prefix string prefix, including underscore. Defaults to `ud_`
*/
function setUsagePrefix(prefix) {
_prefix = prefix;
}
exports.setUsagePrefix = setUsagePrefix;
function setStatusLogger(statusLogger) {

@@ -109,9 +103,5 @@ _statusLogger = statusLogger;

var prefixInternalSdkVersion = function (envelope, _contextObjects) {
if (_prefix === "ud_") {
// If SDK version prefix is not set - set it using {RP}{OS}{Attach Type}_ pattern
_prefix = "" + PrefixHelpers.getResourceProvider() + PrefixHelpers.getOsPrefix() + Constants.AttachTypePrefix.INTEGRATED_AUTO + "_";
}
// If SDK version prefix is not set - set it using {RP}{OS}{Attach Type}_ pattern
try {
var appInsightsSDKVersion = _appInsights.defaultClient.context.keys.internalSdkVersion;
envelope.tags[appInsightsSDKVersion] = _prefix + envelope.tags[appInsightsSDKVersion];
envelope.tags[appInsightsSDKVersion_1] = _fullSdkVersion;
}

@@ -140,3 +130,5 @@ catch (e) {

// Instrument the SDK
Context.sdkPrefix = _prefix;
_appInsights.setup();
var appInsightsSDKVersion_1 = _appInsights.defaultClient.context.keys.internalSdkVersion;
// Azure Functions

@@ -212,2 +204,4 @@ if (isAzureFunction) {

_appInsights.start();
// Set the SDK verison in the context
_appInsights.defaultClient.context.tags[appInsightsSDKVersion_1] = _fullSdkVersion;
// Add attach flag in Statsbeat

@@ -214,0 +208,0 @@ var statsbeat = _appInsights.defaultClient.getStatsbeat();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sdkAlreadyExists = void 0;
var PrefixHelper_1 = require("../Library/PrefixHelper");
var DataModel_1 = require("./DataModel");
var LINUX_USER_APPLICATION_INSIGHTS_PATH = "/node_modules/applicationinsights/out/applicationinsights.js";
function sdkAlreadyExists(_logger) {

@@ -17,4 +19,9 @@ try {

}
// If loaded instance is in Azure machine home path do not attach the SDK, this means customer already instrumented their app
if (appInstance.indexOf("home") > -1) {
/**
* If loaded instance is in Azure machine home path do not attach the SDK, this means customer already instrumented their app.
* Linux App Service doesn't append the full cwd to the require.resolve, so we need to check for the relative path we expect
* if application insights is being imported in the user app code.
*/
if (appInstance.indexOf("home") > -1 ||
(appInstance === LINUX_USER_APPLICATION_INSIGHTS_PATH && PrefixHelper_1.isLinux())) {
var diagnosticLog = {

@@ -21,0 +28,0 @@ message: "Application Insights SDK already exists. Module is already installed in this application; not re-attaching. Installed SDK location: " + appInstance,

@@ -6,4 +6,2 @@ "use strict";

var appInsightsLoader = require("./Default");
var Constants_1 = require("../Declarations/Constants");
appInsightsLoader.setUsagePrefix("al" + Constants_1.AttachTypePrefix.INTEGRATED_AUTO + "_"); // App Services Linux Auto Attach
// Set Status.json logger

@@ -10,0 +8,0 @@ appInsightsLoader.setStatusLogger(new StatusLogger_1.StatusLogger(new NoopLogger_1.NoopLogger()));

import Contracts = require("./Contracts");
export declare const APPLICATION_INSIGHTS_SDK_VERSION = "2.9.4";
export declare const APPLICATION_INSIGHTS_SDK_VERSION = "2.9.5";
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.AttachTypePrefix = 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.9.4";
exports.APPLICATION_INSIGHTS_SDK_VERSION = "2.9.5";
exports.DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com";

@@ -8,0 +8,0 @@ exports.DEFAULT_LIVEMETRICS_ENDPOINT = "https://rt.services.visualstudio.com";

@@ -12,2 +12,3 @@ import Contracts = require("../Declarations/Contracts");

static sdkVersion: string;
static sdkPrefix: string;
constructor(packageJsonPath?: string);

@@ -14,0 +15,0 @@ private _loadApplicationContext;

@@ -72,8 +72,11 @@ "use strict";

Context.prototype._loadInternalContext = function () {
Context.sdkVersion = Constants_1.APPLICATION_INSIGHTS_SDK_VERSION;
this.tags[this.keys.internalSdkVersion] = "" + PrefixHelpers.getResourceProvider() + PrefixHelpers.getOsPrefix() + Constants.AttachTypePrefix.MANUAL + "_node:" + Context.sdkVersion;
// If Context is already set in the bootstrap, don't set it here
if (!Context.sdkPrefix) {
this.tags[this.keys.internalSdkVersion] = "" + PrefixHelpers.getResourceProvider() + PrefixHelpers.getOsPrefix() + Constants.AttachTypePrefix.MANUAL + "_node:" + Context.sdkVersion;
}
};
Context.DefaultRoleName = "Web";
Context.appVersion = {};
Context.sdkVersion = null;
Context.sdkVersion = Constants_1.APPLICATION_INSIGHTS_SDK_VERSION;
Context.sdkPrefix = null;
return Context;

@@ -80,0 +83,0 @@ }());

@@ -6,3 +6,3 @@ {

"bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues",
"version": "2.9.4",
"version": "2.9.5",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc