Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions AISKU/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ See [Breaking Changes](https://microsoft.github.io/ApplicationInsights-JS/upgrad
| Version | Full Size | Raw Minified | GZip Size
|---------|-----------|--------------|-------------
| [<nightly3>](https://github.com/microsoft/ApplicationInsights-JS/tree/main/AISKU) | [![full size size](https://js.monitor.azure.com/nightly/ai.3-nightly3.js.svg)](https://js.monitor.azure.com/nightly/ai.3-nightly3.js.svg)| ![minified size size](https://js.monitor.azure.com/nightly/ai.3-nightly3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/nightly/ai.3-nightly3.min.js.gzip.svg)
| 3.4.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.5.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.4.5.min.js.gzip.svg)
| 3.4.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.4.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.4.4.min.js.gzip.svg)
| 3.4.3: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.3.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.3.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.3.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.4.3.min.js.gzip.svg)
| 3.4.2: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.4.2.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.4.2.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.4.2.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.4.2.min.js.gzip.svg)
Expand All @@ -58,11 +59,6 @@ See [Breaking Changes](https://microsoft.github.io/ApplicationInsights-JS/upgrad
| 3.1.1: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.1.1.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.1.1.min.js.gzip.svg)
| 3.1.0: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.1.0.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.1.0.min.js.gzip.svg)
| 3.0.9: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.9.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.9.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.9.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.gzip.svg)
| 3.0.8: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.8.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.8.min.js.gzip.svg)
| 3.0.7: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.7.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.7.min.js.gzip.svg)
| 3.0.6: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.6.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.6.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.6.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.gzip.svg)
| 3.0.5: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.5.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.5.min.js.gzip.svg)
| 3.0.4: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.0.4.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.0.4.min.js.gzip.svg)
| [<nightly>](https://github.com/microsoft/ApplicationInsights-JS/tree/master/AISKU) | [![full size size](https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg)](https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg)| ![minified size size](https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.svg) | ![gzip size](https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.gzip.svg)
| 2.8.18: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.18.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.18.min.js.gzip.svg)
| 2.8.17: | [![full size size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.js.svg)](https://js.monitor.azure.com/scripts/b/ai.2.8.17.js.svg)| ![minified size size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.min.js.svg) | ![gzip size](https://js.monitor.azure.com/scripts/b/ai.2.8.17.min.js.gzip.svg)
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Perf/src/AISKUPerf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AppInsightsInitPerfTestClass {
* should update version after new release
* version with doperf(): after 2.5.6
* */
var defaultVer = "3.4.4";
var defaultVer = "3.4.5";
this.version = ver? ver:this._getQueryParameterVersion(defaultVer);
this.perfEventsBuffer = [];
this.perfEventWaitBuffer = [];
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/AISKUSize.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AISKUSizeCheck extends AITestClass {
private readonly MAX_BUNDLE_DEFLATE_SIZE = 74;
private readonly rawFilePath = "../dist/es5/applicationinsights-web.min.js";
// Automatically updated by version scripts
private readonly currentVer = "3.4.4";
private readonly currentVer = "3.4.5";
private readonly prodFilePath = `../browser/es5/ai.${this.currentVer[0]}.min.js`;

public testInitialize() {
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/CdnPackaging.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const enum CdnFormat {

export class CdnPackagingChecks extends AITestClass {
// Automatically updated by version scripts
private readonly currentVer = "3.4.4";
private readonly currentVer = "3.4.5";

public testInitialize() {
}
Expand Down
6 changes: 3 additions & 3 deletions AISKU/Tests/es6-module-type-check/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@microsoft/applicationinsights-test-module-type-check",
"author": "Microsoft Application Insights Team and Contributors",
"version": "3.4.4",
"version": "3.4.5",
"description": "Microsoft Application Insights ES6 Module and Type check Example",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"keywords": [
Expand Down Expand Up @@ -32,7 +32,7 @@
"tslib": ">= 1.0.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-web": "3.4.4"
"@microsoft/applicationinsights-core-js": "3.4.5",
"@microsoft/applicationinsights-web": "3.4.5"
}
}
16 changes: 8 additions & 8 deletions AISKU/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web",
"version": "3.4.4",
"version": "3.4.5",
"description": "Microsoft Application Insights JavaScript SDK - Web",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@microsoft/ai-test-framework": "0.0.1",
"@microsoft/applicationinsights-offlinechannel-js": "0.4.4",
"@microsoft/applicationinsights-offlinechannel-js": "0.4.5",
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
"sinon": "^7.3.1",
Expand Down Expand Up @@ -71,12 +71,12 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-analytics-js": "3.4.4",
"@microsoft/applicationinsights-channel-js": "3.4.4",
"@microsoft/applicationinsights-cfgsync-js": "3.4.4",
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-dependencies-js": "3.4.4",
"@microsoft/applicationinsights-properties-js": "3.4.4",
"@microsoft/applicationinsights-analytics-js": "3.4.5",
"@microsoft/applicationinsights-channel-js": "3.4.5",
"@microsoft/applicationinsights-cfgsync-js": "3.4.5",
"@microsoft/applicationinsights-core-js": "3.4.5",
"@microsoft/applicationinsights-dependencies-js": "3.4.5",
"@microsoft/applicationinsights-properties-js": "3.4.5",
"@nevware21/ts-utils": ">= 0.14.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 0.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion AISKULight/Tests/Unit/src/AISKULightSize.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class AISKULightSizeCheck extends AITestClass {
private readonly MAX_RAW_DEFLATE_SIZE = 44;
private readonly MAX_BUNDLE_DEFLATE_SIZE = 44;
private readonly rawFilePath = "../dist/es5/applicationinsights-web-basic.min.js";
private readonly currentVer = "3.4.4";
private readonly currentVer = "3.4.5";
private readonly prodFilePath = `../browser/es5/aib.${this.currentVer[0]}.min.js`;

public testInitialize() {
Expand Down
6 changes: 3 additions & 3 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web-basic",
"version": "3.4.4",
"version": "3.4.5",
"description": "Microsoft Application Insights JavaScript SDK - Web Basic",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -65,8 +65,8 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-channel-js": "3.4.4",
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-channel-js": "3.4.5",
"@microsoft/applicationinsights-core-js": "3.4.5",
"@nevware21/ts-utils": ">= 0.14.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 0.6.0"
},
Expand Down
23 changes: 23 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@

<!-- ## Unreleased Changes -->

## 3.4.5 (October 5th, 2026)

This release enables internal SDK network statistics and routes them to a dedicated SDK Stats ingestion endpoint. The `@microsoft/1ds-post-js` channel is numbered 4.4.5 and requires v3.4.5.

### Significant Changes (since 3.4.4)

- **Internal SDK Stats**: The full SDK now records request successes, failures, retries, throttling, and request duration. Counters are persisted in session storage by customer instrumentation key and endpoint, with a default collection interval of one hour (`stats.shrtInt`, in seconds).
- **Dedicated Ingestion and Dynamic Configuration**: Internal SDK Stats use a separate core and sender, rather than the customer's telemetry pipeline. Sending requires `stats.cfgUrl`, `stats.iKey`, and an enabled remote configuration that supplies the destination host. EU customer endpoints use the EU-prefixed configuration host. Configuration and sampling can be updated at runtime, and counters are retained while remote configuration is unavailable.
- **Feature Throttling**: Added `ThrottleMgr.useFeature()` and string-keyed `throttleMgrCfg` entries for feature operations. Internal SDK Stats have a dedicated daily throttle, separate from internal diagnostic messages. Throttle sampling now honors a zero rate, interval rules are evaluated per configuration, and long-lived instances can send again on the next eligible UTC day.
- **Sender Unload Reliability**: Late network responses no longer access the cleared core configuration when looking up internal SDK Stats after unload.

### Potential behavioral changes

The internal SDK Stats manager is enabled by default, but it does not send statistics until the required local or CDN-delivered configuration is available and the remote configuration enables sending. Disable this feature with `featureOptIn: { sdkStats: { mode: FeatureOptInMode.disable } }`. The lowercase `sdkStats` feature is separate from the existing customer-facing `SdkStats` feature and its `sdkStats.int` collection interval.

Internal SDK Stats bypass customer telemetry initializers and plugins. Applications that use those hooks to inspect, modify, or filter customer telemetry should use the internal SDK Stats feature flag to opt out instead.

### Changelog

- [#2741](https://github.com/microsoft/ApplicationInsights-JS/pull/2741) Enable SDK Stats and route to the SDK Stats ingestion endpoint

**Full Changelog**: https://github.com/microsoft/ApplicationInsights-JS/compare/3.4.4...3.4.5

## 3.4.4 (September 8th, 2026)

This is a maintenance release for the 3.4.x version line containing runtime reliability and bundler compatibility fixes, build tooling and dependency security hardening, documentation corrections, and a test reliability fix. There are no SDK API changes. The `@microsoft/1ds-post-js` channel is numbered 4.4.4 and requires v3.4.4.
Expand Down
4 changes: 2 additions & 2 deletions channels/1ds-post-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/1ds-post-js",
"version": "4.4.4",
"version": "4.4.5",
"description": "Microsoft Application Insights JavaScript SDK - 1ds-post-channel-js",
"author": "Microsoft Application Insights Team",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
Expand All @@ -27,7 +27,7 @@
"dependencies": {
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-core-js": "3.4.5",
"@nevware21/ts-utils": ">= 0.14.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 0.6.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework";
import {
AppInsightsCore, createStatsMgr, FeatureOptInMode, IAppInsightsCore, IConfiguration, IInternalSdkStatsState,
IStatsMgr, ITelemetryItem, TransportType
isBeaconsSupported, IStatsMgr, ITelemetryItem, TransportType
} from "@microsoft/applicationinsights-core-js";
import { Sender } from "../../../src/Sender";
import { objDefine } from "@nevware21/ts-utils";
import { SinonSpy } from "sinon";
import { Sender } from "../../../src/Sender";
import { ISenderConfig } from "../../../types/applicationinsights-channel-js";
import { isBeaconsSupported } from "@microsoft/applicationinsights-core-js";

const STATS_TEST_CFG_URL = "https://tst-data.stats.monitor.azure.com/cfg/v1.json";
const STATS_TEST_HOST = "tst-data.stats.monitor.azure.com";
Expand Down Expand Up @@ -243,6 +243,44 @@ export class InternalSdkStatsTests extends AITestClass {
});


this.testCase({
name: "SDK Stats ignores pending XHR responses after core unload",
useFakeTimers: true,
useFakeServer: true,
fakeServerAutoRespond: false,
test: () => {
const config = this.createSenderConfig(TransportType.Xhr);
const { core, sender } = this.initializeCoreAndSender(config, "000e0000-e000-0000-a000-000000000000");
const getStatsSpy = this.sandbox.spy(core, "getSdkStats");
const successSpy = this.sandbox.spy(sender, "_onSuccess");
const telemetryItem: ITelemetryItem = {
name: "pending item",
baseType: "EventData",
baseData: { name: "pending item" }
};

this.processTelemetryAndFlush(sender, telemetryItem);
this.processTelemetryAndFlush(sender, telemetryItem);
const requests = this.activeXhrRequests;
Assert.equal(2, requests.length, "Two XHR requests should be pending");
for (let lp = 0; lp < requests.length; lp++) {
objDefine(requests[lp], "responseURL", { v: config.endpointUrl });
}

sender.pause();
sender._buffer.clear();
core.unload(false);
Assert.equal(null, sender.core, "The sender core should be cleared during unload");

// The first late response restores the endpoint, so the second reaches the SDK Stats lookup.
requests[0].respond(200, {}, "");
requests[1].respond(200, {}, "");
Assert.equal(2, successSpy.callCount, "Both late responses should complete without throwing");
Assert.equal(0, getStatsSpy.callCount, "Late responses should not access the unloaded stats manager");
Assert.equal(0, this.internalSdkStatsCountSpy.callCount, "Late responses should not record SDK Stats");
}
});

this.testCase({
name: "SDK Stats increments success count for xhr sender",
useFakeTimers: true,
Expand Down
4 changes: 2 additions & 2 deletions channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-channel-js",
"version": "3.4.4",
"version": "3.4.5",
"description": "Microsoft Application Insights JavaScript SDK Channel",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -64,7 +64,7 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-core-js": "3.4.5",
"@nevware21/ts-utils": ">= 0.14.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 0.6.0"
},
Expand Down
25 changes: 14 additions & 11 deletions channels/applicationinsights-channel-js/src/Sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,19 +675,22 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControls {
}

function _getSdkStats() {
let statsCfg = _self.core.config.stats;
let snp = statsCfg && statsCfg.snp;
let internalSdkStatsConfig: IInternalSdkStatsState = {
cKey: _self._senderConfig.instrumentationKey,
endpoint: _endpointUrl,
sdkVer: "javascript:" + EnvelopeCreator.Version + (snp ? ":snp" + snp : "")
};

let core = _self.core;

// During page unload the core may have been cleared and some async events may not have been sent yet
// resulting in the core being null. In this case we don't want to create a SDK Stats instance
return core && core.getSdkStats ? core.getSdkStats(internalSdkStatsConfig) : null;
// Async send responses can arrive after teardown has cleared the core.
if (core && core.getSdkStats) {
let statsCfg = core.config.stats;
let snp = statsCfg && statsCfg.snp;
let internalSdkStatsConfig: IInternalSdkStatsState = {
cKey: _self._senderConfig.instrumentationKey,
endpoint: _endpointUrl,
sdkVer: "javascript:" + EnvelopeCreator.Version + (snp ? ":snp" + snp : "")
};

return core.getSdkStats(internalSdkStatsConfig);
}

return null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions channels/offline-channel-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-offlinechannel-js",
"version": "0.4.4",
"version": "0.4.5",
"description": "Microsoft Application Insights JavaScript SDK Offline Channel",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-core-js": "3.4.4",
"@microsoft/applicationinsights-core-js": "3.4.5",
"@nevware21/ts-utils": ">= 0.14.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 0.6.0"
},
Expand Down
Loading
Loading