Skip to content

Commit 8af259e

Browse files
authored
Release 3.14.0 (#1492)
* Release 3.14.0 * Update ingestion.js * Update sampling. * Update tests. * Update ingestion.js * Update integration.yml * Fix integration tests.
1 parent f1af803 commit 8af259e

8 files changed

Lines changed: 85 additions & 46 deletions

File tree

.github/workflows/integration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
# TODO: Enable Node 14.x when we update the pipeline to support AbortController
1716
node-version: [18.x]
1817

1918
steps:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
### 3.13.1 ()
3+
### 3.14.0 (2026-02-24)
44

55
#### Other Changes
66

package-lock.json

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Microsoft Application Insights Team",
44
"license": "MIT",
55
"bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues",
6-
"version": "3.13.0",
6+
"version": "3.14.0",
77
"description": "Microsoft Application Insights module for Node.js",
88
"repository": {
99
"type": "git",
@@ -68,8 +68,8 @@
6868
"@azure/functions": "^4.11.2",
6969
"@azure/functions-old": "npm:@azure/functions@3.5.1",
7070
"@azure/identity": "^4.6.0",
71-
"@azure/monitor-opentelemetry": "^1.15.1",
72-
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.38",
71+
"@azure/monitor-opentelemetry": "^1.16.0",
72+
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.39",
7373
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.7",
7474
"@opentelemetry/api": "^1.9.0",
7575
"@opentelemetry/api-logs": "^0.208.0",

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { MetricReader } from "@opentelemetry/sdk-metrics";
1010
import { OTLPExporterNodeConfigBase } from "@opentelemetry/otlp-exporter-base";
1111

1212

13-
export const APPLICATION_INSIGHTS_OPENTELEMETRY_VERSION = "3.13.0";
13+
export const APPLICATION_INSIGHTS_OPENTELEMETRY_VERSION = "3.14.0";
1414
export const DEFAULT_ROLE_NAME = "Web";
1515
export const AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES";
1616

test/functionalTests/runner/ingestion.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ class Ingestion {
3737
.on('error', () => null)
3838
.on('end', (d) => {
3939
data += (d || "");
40-
let items = data.split("\n");
40+
let items = data.split("\n").filter(item => item.trim() !== "");
4141
items.forEach(function (item) {
42-
item = JSON.parse(item);
43-
if (!Array.isArray(item)) {
44-
item = [item];
42+
try {
43+
item = JSON.parse(item);
44+
if (!Array.isArray(item)) {
45+
item = [item];
46+
}
47+
item.forEach((subItem) => {
48+
self.processItem(subItem);
49+
});
50+
} catch (e) {
51+
console.warn("INGESTION: Failed to parse item:", e.message);
4552
}
46-
item.forEach((subItem) => {
47-
self.processItem(subItem);
48-
});
4953
}, self);
5054
response.end(JSON.stringify({
5155
itemsRecieved: items.length,

test/functionalTests/testApp/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (testconfig.AppInsightsEnabled) {
99
connectionString:`InstrumentationKey=${testconfig.InstrumentationKey};IngestionEndpoint=${testconfig.EndpointBaseAddress}`
1010
},
1111
samplingRatio: parseFloat(testconfig.SampleRate),
12+
tracesPerSecond: 0, // Disable rate limiting so all test traces are captured
1213
instrumentationOptions: {
1314
azureSdk: {
1415
enabled: true

test/unitTests/shim/telemetryClient.tests.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ describe("shim/TelemetryClient", () => {
169169
});
170170

171171
describe("#manual track APIs", () => {
172+
// Allow rate limiter to recover between tests so each span-creating test
173+
// gets a fresh budget from the default RateLimitedSampler (5 traces/sec)
174+
beforeEach(async () => {
175+
await new Promise(resolve => setTimeout(resolve, 250));
176+
});
177+
172178
it("trackDependency http", async () => {
173179
const telemetry: DependencyTelemetry = {
174180
name: "TestName",
@@ -565,6 +571,35 @@ describe("shim/TelemetryClient", () => {
565571
});
566572
});
567573

574+
describe("#rate limiting behavior", () => {
575+
it("should rate limit spans when creating many rapidly", async () => {
576+
// Wait for rate limiter to fully recover
577+
await new Promise(resolve => setTimeout(resolve, 500));
578+
testProcessor.spansProcessed = [];
579+
580+
const totalSpans = 20;
581+
// Create many spans as fast as possible (far exceeding 5/sec default)
582+
for (let i = 0; i < totalSpans; i++) {
583+
client.trackDependency({
584+
name: `RateLimitTest-${i}`,
585+
duration: 100,
586+
resultCode: "200",
587+
data: "http://test.com",
588+
dependencyTypeName: "HTTP",
589+
success: true,
590+
});
591+
}
592+
await tracerProvider.forceFlush();
593+
const sampledCount = testProcessor.spansProcessed.length;
594+
595+
// Rate limiter should allow some but not all spans through
596+
assert.ok(sampledCount >= 1,
597+
`Expected at least 1 span to be sampled, got ${sampledCount}`);
598+
assert.ok(sampledCount < totalSpans,
599+
`Expected rate limiting to drop some spans when creating ${totalSpans} rapidly, but all ${sampledCount} were sampled`);
600+
});
601+
});
602+
568603
describe("initialization modes", () => {
569604
it("does not call useAzureMonitor for isolated clients", async () => {
570605
const useAzureMonitorStub = sandbox.stub(main, "useAzureMonitor");

0 commit comments

Comments
 (0)