diff --git a/.github/workflows/node.js-linux-arm64.yml b/.github/workflows/node.js-linux-arm64.yml index 1d44342c..fea8bded 100644 --- a/.github/workflows/node.js-linux-arm64.yml +++ b/.github/workflows/node.js-linux-arm64.yml @@ -39,8 +39,10 @@ jobs: # Install build tools needed for native modules apk add --no-cache python3 make g++ - # Install and run tests - npm run clean + # Clean out directory only (preserve node_modules for fresh install) + rm -rf ./out + + # Install dependencies and run tests npm i npm run build --if-present npm run lint diff --git a/.github/workflows/node.js-windows-arm64.yml b/.github/workflows/node.js-windows-arm64.yml index 098b94ad..77d1777b 100644 --- a/.github/workflows/node.js-windows-arm64.yml +++ b/.github/workflows/node.js-windows-arm64.yml @@ -45,8 +45,10 @@ jobs: # Install build dependencies for native modules apk add --no-cache python3 make g++ - # Run tests - npm run clean + # Clean out directory only (preserve node_modules for fresh install) + rm -rf ./out + + # Install dependencies and run tests npm i npm run build --if-present npm run lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 577ef4c5..3e49292e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +### 3.13.0 (2026-01-16) + +#### Other Changes + +- Add OpenTelemetry global detection to the agent. +- Add functionality for the TelemetryClient to not use global providers. +- Resolve vulnerabilities in dependencies. + ### 3.12.1 (2025-11-10) #### Other Changes diff --git a/package-lock.json b/package-lock.json index 058cdedd..a3433960 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,20 @@ { "name": "applicationinsights", - "version": "3.12.1", + "version": "3.13.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "applicationinsights", - "version": "3.12.1", + "version": "3.13.0", "license": "MIT", "dependencies": { "@azure/core-auth": "^1.9.0", "@azure/functions": "^4.6.0", "@azure/functions-old": "npm:@azure/functions@3.5.1", "@azure/identity": "^4.6.0", - "@azure/monitor-opentelemetry": "^1.14.2", - "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.36", + "@azure/monitor-opentelemetry": "^1.15.1", + "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.38", "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.7", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.208.0", @@ -205,16 +205,16 @@ } }, "node_modules/@azure/monitor-opentelemetry": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry/-/monitor-opentelemetry-1.14.2.tgz", - "integrity": "sha512-IhDnnPglEoS6pVKU939E02CEbkLw8irtELKsonLFyFZ6Uayo1i8mgHJjJ3fvxD3AtY9dCgVhKSz29USoKf2m+g==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry/-/monitor-opentelemetry-1.15.1.tgz", + "integrity": "sha512-Ybr8BfypmSt0L3TObjMFxv37B6qYI7TTX/fs9V0hi86LI75ZG2bvPAFr9Dt/L2LaNXaLck3fNVQ/ocuMJid7hQ==", "license": "MIT", "dependencies": { "@azure/core-auth": "^1.10.1", "@azure/core-client": "^1.10.1", "@azure/core-rest-pipeline": "^1.22.2", "@azure/logger": "^1.3.0", - "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.36", + "@azure/monitor-opentelemetry-exporter": "1.0.0-beta.38", "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.9", "@microsoft/applicationinsights-web-snippet": "^1.2.3", "@opentelemetry/api": "^1.9.0", @@ -244,9 +244,9 @@ } }, "node_modules/@azure/monitor-opentelemetry-exporter": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry-exporter/-/monitor-opentelemetry-exporter-1.0.0-beta.36.tgz", - "integrity": "sha512-2mdI+5AVDWhMTzj2iwurTf5HFIsbo0bniI/PXKZTH0jgqyZl+lq6LZD089xZ7os8Nes1aIEBFsuERrWbwJsD4Q==", + "version": "1.0.0-beta.38", + "resolved": "https://registry.npmjs.org/@azure/monitor-opentelemetry-exporter/-/monitor-opentelemetry-exporter-1.0.0-beta.38.tgz", + "integrity": "sha512-lzY9XpgRwWC94lzeAf2I1YXrP7oMx1B/vn83zoYA5RKW2ZBPzXZ+LUJjYCo/ItzLfT4eMQC80VL4lQC/VknIMA==", "license": "MIT", "dependencies": { "@azure/core-auth": "^1.9.0", @@ -441,6 +441,7 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -1059,6 +1060,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -2064,6 +2066,7 @@ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", @@ -2252,6 +2255,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2474,6 +2478,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001737", "electron-to-chromium": "^1.5.211", @@ -2808,6 +2813,7 @@ "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz", "integrity": "sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==", "license": "MIT", + "peer": true, "dependencies": { "semver": "^7.5.3" } @@ -2915,6 +2921,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5882,6 +5889,7 @@ "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 49edba95..e54a39d5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "author": "Microsoft Application Insights Team", "license": "MIT", "bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues", - "version": "3.12.1", + "version": "3.13.0", "description": "Microsoft Application Insights module for Node.js", "repository": { "type": "git", @@ -68,8 +68,8 @@ "@azure/functions": "^4.6.0", "@azure/functions-old": "npm:@azure/functions@3.5.1", "@azure/identity": "^4.6.0", - "@azure/monitor-opentelemetry": "^1.14.2", - "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.36", + "@azure/monitor-opentelemetry": "^1.15.1", + "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.38", "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.7", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.208.0", diff --git a/src/types.ts b/src/types.ts index 3a68884f..70918dcd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,7 +10,7 @@ import { MetricReader } from "@opentelemetry/sdk-metrics"; import { OTLPExporterNodeConfigBase } from "@opentelemetry/otlp-exporter-base"; -export const APPLICATION_INSIGHTS_OPENTELEMETRY_VERSION = "3.12.1"; +export const APPLICATION_INSIGHTS_OPENTELEMETRY_VERSION = "3.13.0"; export const DEFAULT_ROLE_NAME = "Web"; export const AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES"; diff --git a/test/unitTests/agent/aksLoader.tests.ts b/test/unitTests/agent/aksLoader.tests.ts index a7db3c18..4c03daa5 100644 --- a/test/unitTests/agent/aksLoader.tests.ts +++ b/test/unitTests/agent/aksLoader.tests.ts @@ -53,7 +53,8 @@ describe("agent/AKSLoader", () => { let meterProvider = metrics.getMeterProvider() as any; assert.equal(meterProvider.constructor.name, "MeterProvider"); assert.equal(meterProvider["_sharedState"]["metricCollectors"].length, 1); - assert.equal(meterProvider["_sharedState"]["metricCollectors"][0]["_metricReader"]["_exporter"].constructor.name, "AzureMonitorMetricExporter"); + const exporterName = meterProvider["_sharedState"]["metricCollectors"][0]["_metricReader"]["_exporter"].constructor.name; + assert.ok(exporterName.startsWith("AzureMonitorMetricExporter"), `Expected exporter name to start with 'AzureMonitorMetricExporter', but got '${exporterName}'`); let tracerProvider = ((trace.getTracerProvider() as ProxyTracerProvider).getDelegate()) as any; assert.equal(tracerProvider.constructor.name, "NodeTracerProvider"); @@ -177,9 +178,9 @@ describe("agent/AKSLoader", () => { const metricCollectors = meterProvider["_sharedState"]["metricCollectors"]; assert.ok(metricCollectors.length >= 1, "Should have at least one metric collector (Azure Monitor)"); - // Check that we have at least one Azure Monitor exporter + // Check that we have at least one Azure Monitor exporter (name may be AzureMonitorMetricExporter or AzureMonitorMetricExporterWithAggregation) const azureMonitorExporters = metricCollectors.filter((collector: any) => - collector["_metricReader"]["_exporter"].constructor.name === "AzureMonitorMetricExporter" + collector["_metricReader"]["_exporter"].constructor.name.startsWith("AzureMonitorMetricExporter") ); assert.equal(azureMonitorExporters.length, 1, "Should have exactly one Azure Monitor metric exporter"); });