@instana/collector
Advanced tools
Comparing version 2.21.1 to 2.22.0
@@ -6,2 +6,20 @@ # Change Log | ||
# [2.22.0](https://github.com/instana/nodejs/compare/v2.21.1...v2.22.0) (2023-05-09) | ||
### Bug Fixes | ||
* **announce:** remove obsolete check for Server header ([7d6a05b](https://github.com/instana/nodejs/commit/7d6a05bc24e3b85df4bfee831f0a6e495ae7dedd)) | ||
* **collector:** keep EOL events open instead of recreating them ([6de9965](https://github.com/instana/nodejs/commit/6de9965c5fb667027a3b84fbd15aec3f591f32d5)) | ||
### Features | ||
* **mongodb:** add support for mongodb v4, v5 & mongoose v6 & v7 ([4e80a26](https://github.com/instana/nodejs/commit/4e80a2680d3a438280aefa1ab8623e36ca17c290)) | ||
* **w3c:** support W3C trace context level 2 ([62e0f99](https://github.com/instana/nodejs/commit/62e0f99710fe3299f6c9825358221f5d065be50d)) | ||
## [2.21.1](https://github.com/instana/nodejs/compare/v2.21.0...v2.21.1) (2023-05-02) | ||
@@ -8,0 +26,0 @@ |
{ | ||
"name": "@instana/collector", | ||
"version": "2.21.1", | ||
"version": "2.22.0", | ||
"description": "The Instana Node.js metrics and trace data collector", | ||
@@ -138,4 +138,4 @@ "author": { | ||
"dependencies": { | ||
"@instana/core": "2.21.1", | ||
"@instana/shared-metrics": "2.21.1", | ||
"@instana/core": "2.22.0", | ||
"@instana/shared-metrics": "2.22.0", | ||
"bunyan": "^1.8.15", | ||
@@ -146,3 +146,3 @@ "semver": "7.3.3", | ||
"optionalDependencies": { | ||
"@instana/autoprofile": "2.21.1" | ||
"@instana/autoprofile": "2.22.0" | ||
}, | ||
@@ -157,3 +157,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "8a2dd3f98de2b29b9c8faf145cec0dd471c98c2d" | ||
"gitHead": "c04cea9b1b34bed622a3a8a63d4b009b3be4aab4" | ||
} |
@@ -52,3 +52,3 @@ /* | ||
/** | ||
* @typedef {Object} AgentConnectionEvent | ||
* @typedef {Object} Event | ||
* @property {string} [title] | ||
@@ -58,2 +58,3 @@ * @property {string} [text] | ||
* @property {number} [pid] | ||
* @property {string} [path] | ||
* @property {number} [id] | ||
@@ -299,3 +300,3 @@ * @property {string} [code] | ||
/** | ||
* @param {AgentConnectionEvent} eventData | ||
* @param {Event} eventData | ||
* @param {(...args: *) => *} cb | ||
@@ -317,3 +318,3 @@ */ | ||
exports.sendAgentMonitoringEvent = function sendAgentMonitoringEvent(code, category, cb) { | ||
/** @type {AgentConnectionEvent} */ | ||
/** @type {Event} */ | ||
const event = { | ||
@@ -320,0 +321,0 @@ plugin: 'com.instana.forge.infrastructure.runtime.nodejs.NodeJsRuntimePlatform', |
@@ -30,3 +30,2 @@ /* | ||
const expectedServerHeader = 'Instana Agent'; | ||
const requestTimeout = 5000; | ||
@@ -129,3 +128,3 @@ const retryTimeoutMillis = 60 * 1000; | ||
res => { | ||
if (res.headers.server === expectedServerHeader) { | ||
if (res.statusCode >= 200 && res.statusCode < 300) { | ||
cb(null); | ||
@@ -135,5 +134,4 @@ } else { | ||
new Error( | ||
`The attempt to connect to the Instana host agent on ${host}:${agentOpts.port} has failed, the ` + | ||
`response did not contain the expected "Server" header. Expected ${expectedServerHeader}, ` + | ||
`but received: ${res.headers.server}` | ||
`The attempt to connect to the Instana host agent on ${host}:${agentOpts.port} has failed with an ` + | ||
`unexpected status code. Expected HTTP 200 but received: ${res.statusCode}` | ||
) | ||
@@ -140,0 +138,0 @@ ); |
@@ -27,4 +27,5 @@ /* | ||
const ELEVEN_MINUTES = 11 * 60 * 1000; | ||
const TEN_MINUTES = 10 * 60 * 1000; | ||
const ONE_MINUTE = 60 * 1000; | ||
const EOL_EVENT_REFRESH_INTERVAL = 6 * 60 * ONE_MINUTE; // 6 hours | ||
const EOL_EVENT_DURATION = 6 * 60 * ONE_MINUTE + ONE_MINUTE; // 6 hours + 1 minute | ||
@@ -190,2 +191,3 @@ /** @type {*} */ | ||
function sendEOLEvent() { | ||
const pid = pidStore.getEntityId(); | ||
agentConnection.sendEvent( | ||
@@ -200,6 +202,7 @@ { | ||
plugin: 'com.instana.forge.infrastructure.runtime.nodejs.NodeJsRuntimePlatform', | ||
id: pidStore && typeof pidStore.getEntityId === 'function' ? pidStore.getEntityId() : undefined, | ||
id: pid, | ||
timestamp: Date.now(), | ||
duration: ELEVEN_MINUTES, | ||
severity: agentConnection.AgentEventSeverity.WARNING | ||
duration: EOL_EVENT_DURATION, | ||
severity: agentConnection.AgentEventSeverity.WARNING, | ||
path: `${agentOpts.agentUuid}/${pid}/nodejs-eol` | ||
}, | ||
@@ -216,4 +219,5 @@ err => { | ||
* Sends an issue event to the agent when the Node.js version has reached end of life. | ||
* It will work for non serverless environments where an agent is present. | ||
* Also, currently the serverless-acceptor does not have support for events. | ||
* It will work for non-serverless environments where an agent is present. | ||
* (At the time of writing, the backend service that our serverless in-process collectors send data to does not have | ||
* support for events.) | ||
*/ | ||
@@ -224,5 +228,5 @@ function detectEOLNodeVersion() { | ||
sendEOLEvent(); | ||
setInterval(sendEOLEvent, TEN_MINUTES).unref(); | ||
setInterval(sendEOLEvent, EOL_EVENT_REFRESH_INTERVAL).unref(); | ||
}, 2000); | ||
} | ||
} |
@@ -119,3 +119,3 @@ /* | ||
* @param {Error} reason | ||
* @returns {import('../agentConnection').AgentConnectionEvent} | ||
* @returns {import('../agentConnection').Event} | ||
*/ | ||
@@ -131,3 +131,3 @@ function createEventForUnhandledRejection(reason) { | ||
* @param {boolean} isPromiseRejection | ||
* @returns {import('../agentConnection').AgentConnectionEvent} | ||
* @returns {import('../agentConnection').Event} | ||
*/ | ||
@@ -134,0 +134,0 @@ function createEvent(error, title, severity, isPromiseRejection) { |
@@ -13,7 +13,7 @@ /* | ||
* You can check active versions in https://nodejs.org/en/about/releases/. | ||
* It's also possible to test the semver match here: https://semver.npmjs.com/ | ||
* | ||
* @returns {boolean} | ||
*/ | ||
exports.isNodeVersionEOL = function () { | ||
return satisfies(process.versions.node, '<12 || 15 || 13'); | ||
return satisfies(process.versions.node, '<16 || 17'); | ||
}; |
123320
2746
+ Added@instana/autoprofile@2.22.0(transitive)
+ Added@instana/core@2.22.0(transitive)
+ Added@instana/shared-metrics@2.22.0(transitive)
- Removed@instana/autoprofile@2.21.1(transitive)
- Removed@instana/core@2.21.1(transitive)
- Removed@instana/shared-metrics@2.21.1(transitive)
Updated@instana/core@2.22.0