From 7a5da5a648f5c087f58a8b89278da4b84b651a47 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Thu, 9 Apr 2026 12:21:56 +0200 Subject: [PATCH 01/23] chore: playground done --- example-apps/collector/.env | 2 +- example-apps/collector/src/index.js | 2 + packages/collector/src/agentConnection.js | 47 ++-- packages/collector/src/otlpTransformer.js | 304 ++++++++++++++++++++++ 4 files changed, 338 insertions(+), 17 deletions(-) create mode 100644 packages/collector/src/otlpTransformer.js diff --git a/example-apps/collector/.env b/example-apps/collector/.env index f94dabfe58..00dccf7bf8 100644 --- a/example-apps/collector/.env +++ b/example-apps/collector/.env @@ -1,6 +1,6 @@ # All default settings defined here can be overridden by environment variables. -# MODE=npm +MODE=local APP_PORT=2807 SENSOR_ENABLED=true TRACING_ENABLED=true diff --git a/example-apps/collector/src/index.js b/example-apps/collector/src/index.js index f2f27aa497..481bdf2fb3 100644 --- a/example-apps/collector/src/index.js +++ b/example-apps/collector/src/index.js @@ -19,6 +19,8 @@ if (config.mode === 'npm') { packageToRequire = '@instana/collector'; } +process.env.INSTANA_OTLP_FORMAT = 'true'; + if (config.collectorEnabled) { console.log(`enabling @instana/collector (requiring ${packageToRequire})`); require(packageToRequire)({ diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index 7ca47d69c5..352377fb75 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -10,7 +10,7 @@ const pathUtil = require('path'); const circularReferenceRemover = require('./util/removeCircular'); const agentOpts = require('./agent/opts'); const cmdline = require('./cmdline'); - +const otlpTransformer = require('./otlpTransformer'); /** @typedef {import('@instana/core/src/core').InstanaBaseSpan} InstanaBaseSpan */ /** @type {import('@instana/core/src/core').GenericLogger} */ @@ -307,6 +307,9 @@ function checkWhetherResponseForPathIsOkay(path, cb) { exports.sendMetrics = function sendMetrics(data, cb) { cb = util.atMostOnce('callback for sendMetrics', cb); + cb(); + + /* sendData(`/com.instana.plugin.nodejs.${pidStore.pid}`, data, (err, body) => { if (err) { cb(err, null); @@ -323,6 +326,7 @@ exports.sendMetrics = function sendMetrics(data, cb) { cb(null, body); } }); + */ }; /** @@ -425,7 +429,8 @@ exports.sendTracingMetricsToAgent = function sendTracingMetricsToAgent(tracingMe cb(err); }); - sendData('/tracermetrics', tracingMetrics, callback); + // sendData('/tracermetrics', tracingMetrics, callback); + cb(); }; /** @@ -438,7 +443,15 @@ exports.sendTracingMetricsToAgent = function sendTracingMetricsToAgent(tracingMe function sendData(path, data, cb, ignore404 = false) { cb = util.atMostOnce(`callback for sendData: ${path}`, cb); - const payloadAsString = JSON.stringify(data, circularReferenceRemover()); + path = '/v1/traces'; + + console.log(JSON.stringify(data)); + // Transform Instana format to OTLP format + const otlpFormat = otlpTransformer(data); + + console.log(JSON.stringify(otlpFormat)); + + const payloadAsString = JSON.stringify(otlpFormat, circularReferenceRemover()); if (typeof logger.trace === 'function') { logger.trace(`Sending data to ${path}.`); } else { @@ -455,7 +468,7 @@ function sendData(path, data, cb, ignore404 = false) { const req = http.request( { host: agentOpts.host, - port: agentOpts.port, + port: 4318, path, method: 'POST', agent: http.agent, @@ -465,24 +478,26 @@ function sendData(path, data, cb, ignore404 = false) { } }, res => { - if (res.statusCode < 200 || res.statusCode >= 300) { - if (res.statusCode !== 404 || !ignore404) { - const statusCodeError = new Error( - `Failed to send data to agent via POST ${path}. Got status code ${res.statusCode}.` - ); - // @ts-ignore - statusCodeError.statusCode = res.statusCode; - cb(statusCodeError); - return; - } - } - res.setEncoding('utf8'); let responseBody = ''; res.on('data', chunk => { responseBody += chunk; }); res.on('end', () => { + console.log(responseBody); + + if (res.statusCode < 200 || res.statusCode >= 300) { + if (res.statusCode !== 404 || !ignore404) { + const statusCodeError = new Error( + `Failed to send data to agent via POST ${path}. Got status code ${res.statusCode}.` + ); + // @ts-ignore + statusCodeError.statusCode = res.statusCode; + cb(statusCodeError); + return; + } + } + cb(null, responseBody); }); } diff --git a/packages/collector/src/otlpTransformer.js b/packages/collector/src/otlpTransformer.js new file mode 100644 index 0000000000..cbca39e4a2 --- /dev/null +++ b/packages/collector/src/otlpTransformer.js @@ -0,0 +1,304 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +/** + * Transformiert Instana Traces Format zu OpenTelemetry Format + * + * OTEL Format Beispiel: + * { + * "resourceSpans": [ + * { + * "resource": { + * "attributes": [ + * { "key": "service.name", "value": { "stringValue": "checkout-service" } }, + * { "key": "service.version", "value": { "stringValue": "1.2.3" } }, + * { "key": "host.name", "value": { "stringValue": "node-1" } } + * ] + * }, + * "scopeSpans": [ + * { + * "scope": { + * "name": "io.opentelemetry.http", + * "version": "1.0.1" + * }, + * "spans": [ + * { + * "traceId": "5b8e1005739815c1054b4f575459392c", + * "spanId": "eed258b6641e17d9", + * "parentSpanId": "6513c7a9c141094d", + * "name": "/calculate-tax", + * "kind": 2, + * "startTimeUnixNano": "1678901234000000000", + * "endTimeUnixNano": "1678901234500000000", + * "attributes": [ + * { "key": "http.method", "value": { "stringValue": "POST" } }, + * { "key": "http.status_code", "value": { "intValue": 200 } } + * ], + * "status": { "code": 1 } + * } + * ] + * } + * ] + * } + * ] + * } + * + * INSTANA Format Beispiel: + * [{ + * "t": "b94dae370181cbd5", // trace ID + * "s": "3c84e4b658761152", // span ID + * "p": "parent_span_id", // parent span ID (optional) + * "n": "node.http.server", // span name + * "k": 1, // span kind (1=SERVER, 2=CLIENT, 3=PRODUCER, 4=CONSUMER, 5=INTERNAL) + * "f": { // from (resource attributes) + * "e": "74662", // entity ID + * "h": "7e:0d:24:ff:fe:aa:33:af" // host ID + * }, + * "ec": 0, // error count + * "ts": 1775729099820, // timestamp in milliseconds + * "d": 8, // duration in milliseconds + * "stack": [], + * "data": { // span attributes + * "http": { + * "path_tpl": "/", + * "status": 304, + * "method": "GET", + * "url": "/", + * "host": "localhost:2807" + * } + * } + * }] + */ + +/** + * Konvertiert Instana Span Kind zu OTEL Span Kind + * @param {number} instanaKind - Instana span kind + * @returns {number} OTEL span kind + */ +function convertSpanKind(instanaKind) { + // Instana: 1=ENTRY/SERVER, 2=EXIT/CLIENT, 3=INTERMEDIATE/INTERNAL + // OTEL: 0=UNSPECIFIED, 1=INTERNAL, 2=SERVER, 3=CLIENT, 4=PRODUCER, 5=CONSUMER + switch (instanaKind) { + case 1: // ENTRY -> SERVER + return 2; + case 2: // EXIT -> CLIENT + return 3; + case 3: // INTERMEDIATE -> INTERNAL + return 1; + default: + return 0; // UNSPECIFIED + } +} + +/** + * Konvertiert Millisekunden zu Nanosekunden (als String) + * @param {number} ms - Millisekunden + * @returns {string} Nanosekunden als String + */ +function msToNano(ms) { + return String(ms * 1000000); +} + +/** + * Erstellt OTEL Attribute aus Instana Span Data + * @param {Object} data - Instana span data + * @returns {Array} OTEL attributes array + */ +function createAttributes(data) { + const attributes = []; + + if (!data) { + return attributes; + } + + // HTTP Attribute + if (data.http) { + if (data.http.method) { + attributes.push({ + key: 'http.method', + value: { stringValue: data.http.method } + }); + } + if (data.http.status) { + attributes.push({ + key: 'http.status_code', + value: { intValue: data.http.status } + }); + } + if (data.http.url) { + attributes.push({ + key: 'http.url', + value: { stringValue: data.http.url } + }); + } + if (data.http.host) { + attributes.push({ + key: 'http.host', + value: { stringValue: data.http.host } + }); + } + if (data.http.path_tpl) { + attributes.push({ + key: 'http.target', + value: { stringValue: data.http.path_tpl } + }); + } + } + + // Weitere Datenfelder können hier hinzugefügt werden + // z.B. data.db, data.service, etc. + + return attributes; +} + +/** + * Erstellt Resource Attributes aus Instana "from" Feld + * @param {Object} from - Instana from object + * @returns {Array} OTEL resource attributes + */ +function createResourceAttributes(from) { + const attributes = []; + + // Standard OTEL Resource Attributes + attributes.push({ + key: 'telemetry.sdk.language', + value: { stringValue: 'nodejs' } + }); + + attributes.push({ + key: 'telemetry.sdk.name', + value: { stringValue: '@instana/collector' } + }); + + // Service Name - verwende process.title oder einen Default + const serviceName = 'dummy'; + attributes.push({ + key: 'service.name', + value: { stringValue: serviceName } + }); + + if (!from) { + return attributes; + } + + // Service Instance ID und Process PID aus Instana "from.e" (entity ID / PID) + if (from.e) { + attributes.push({ + key: 'service.instance.id', + value: { stringValue: from.e } + }); + + attributes.push({ + key: 'process.pid', + value: { intValue: parseInt(from.e, 10) } + }); + } + + // Host ID aus Instana "from.h" + if (from.h) { + attributes.push({ + key: 'host.id', + value: { stringValue: from.h } + }); + } + + return attributes; +} + +/** + * Bestimmt den Status Code basierend auf Error Count + * @param {number} errorCount - Instana error count + * @returns {Object} OTEL status object + */ +function createStatus(errorCount) { + // OTEL Status Code: 0=UNSET, 1=OK, 2=ERROR + if (errorCount > 0) { + return { code: 2 }; // ERROR + } + return { code: 1 }; // OK +} + +/** + * Transformiert einen einzelnen Instana Span zu OTEL Span + * @param {Object} instanaSpan - Instana span object + * @returns {Object} OTEL span object + */ +function transformSpan(instanaSpan) { + const otelSpan = { + traceId: instanaSpan.t, + spanId: instanaSpan.s, + name: instanaSpan.n || 'unknown', + kind: convertSpanKind(instanaSpan.k), + startTimeUnixNano: msToNano(instanaSpan.ts), + endTimeUnixNano: msToNano(instanaSpan.ts + instanaSpan.d), + attributes: createAttributes(instanaSpan.data), + status: createStatus(instanaSpan.ec || 0) + }; + + // Parent Span ID ist optional + if (instanaSpan.p) { + otelSpan.parentSpanId = instanaSpan.p; + } + + return otelSpan; +} + +/** + * Transformiert Instana Traces zu OTEL Format + * @param {Array} instanaTraces - Array von Instana spans + * @returns {Object} OTEL traces object + */ +function transform(instanaTraces) { + if (!Array.isArray(instanaTraces) || instanaTraces.length === 0) { + return { + resourceSpans: [] + }; + } + + // Gruppiere Spans nach Resource (from field) + const spansByResource = new Map(); + + instanaTraces.forEach(function (instanaSpan) { + const resourceKey = JSON.stringify(instanaSpan.f || {}); + + if (!spansByResource.has(resourceKey)) { + spansByResource.set(resourceKey, { + resource: instanaSpan.f, + spans: [] + }); + } + + spansByResource.get(resourceKey).spans.push(instanaSpan); + }); + + // Erstelle OTEL ResourceSpans + const resourceSpans = Array.from(spansByResource.values()).map(function (group) { + const otelSpans = group.spans.map(transformSpan); + + return { + resource: { + attributes: createResourceAttributes(group.resource) + }, + scopeSpans: [ + { + scope: { + name: '@instana/collector', + version: '1.0.0' + }, + spans: otelSpans + } + ] + }; + }); + + return { + resourceSpans: resourceSpans + }; +} + +module.exports = transform; + +// Made with Bob From a046abcffc0440a8b7454a4c946e3e52b9f79f80 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Thu, 9 Apr 2026 13:45:53 +0200 Subject: [PATCH 02/23] chore: infra cor --- example-apps/collector/src/index.js | 1 + packages/collector/src/agentConnection.js | 144 ++++++++-- packages/collector/src/otlpTransformer.js | 328 ++++++++++++++++++---- 3 files changed, 405 insertions(+), 68 deletions(-) diff --git a/example-apps/collector/src/index.js b/example-apps/collector/src/index.js index 481bdf2fb3..4aec420fd6 100644 --- a/example-apps/collector/src/index.js +++ b/example-apps/collector/src/index.js @@ -19,6 +19,7 @@ if (config.mode === 'npm') { packageToRequire = '@instana/collector'; } +process.env.INSTANA_METRICS_TRANSMISSION_DELAY = 5000; process.env.INSTANA_OTLP_FORMAT = 'true'; if (config.collectorEnabled) { diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index 352377fb75..a45a6eee9a 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -307,26 +307,57 @@ function checkWhetherResponseForPathIsOkay(path, cb) { exports.sendMetrics = function sendMetrics(data, cb) { cb = util.atMostOnce('callback for sendMetrics', cb); - cb(); + // Zeige nur die ersten 2 Keys für Debugging + const dataKeys = Object.keys(data); + const firstTwoKeys = {}; + for (let i = 0; i < Math.min(2, dataKeys.length); i++) { + firstTwoKeys[dataKeys[i]] = data[dataKeys[i]]; + } + + logger.debug(`sendMetrics called with data (first 2 keys): ${JSON.stringify(firstTwoKeys)}`); + + // Transform Instana metrics to OTLP format + const otlpMetrics = otlpTransformer.transformMetrics(data); + + // Zeige nur die ersten 2 Metriken für Debugging + let otlpPreview = otlpMetrics; + if (otlpMetrics.resourceMetrics && otlpMetrics.resourceMetrics.length > 0) { + const firstResource = otlpMetrics.resourceMetrics[0]; + if (firstResource.scopeMetrics && firstResource.scopeMetrics.length > 0) { + const metrics = firstResource.scopeMetrics[0].metrics; + if (metrics && metrics.length > 2) { + otlpPreview = { + resourceMetrics: [ + { + ...firstResource, + scopeMetrics: [ + { + ...firstResource.scopeMetrics[0], + metrics: metrics.slice(0, 2) + } + ] + } + ], + totalMetrics: metrics.length + }; + } + } + } + + logger.debug(`Transformed to OTLP (first 2 metrics) ${JSON.stringify(otlpPreview)}`); - /* - sendData(`/com.instana.plugin.nodejs.${pidStore.pid}`, data, (err, body) => { + // Send directly without using sendData (which would transform again) + sendOtlpData('/v1/metrics', otlpMetrics, err => { if (err) { + logger.error('Error sending metrics:', err); cb(err, null); } else { - try { - // 2016-09-11 - // Older sensor versions will not repond with a JSON - // structure. Support a smooth update path. - body = JSON.parse(body); - } catch (e) { - body = []; - } - - cb(null, body); + logger.debug('Metrics sent successfully'); + // OTLP endpoints don't return requests like the old Instana endpoint + // Always return empty array for compatibility + cb(null, []); } }); - */ }; /** @@ -348,7 +379,7 @@ exports.sendSpans = function sendSpans(spans, cb) { cb(err); }); - sendData(`/com.instana.plugin.nodejs/traces.${pidStore.pid}`, spans, callback, true); + sendData('/v1/traces', spans, callback, true); }; /** @@ -442,9 +473,6 @@ exports.sendTracingMetricsToAgent = function sendTracingMetricsToAgent(tracingMe */ function sendData(path, data, cb, ignore404 = false) { cb = util.atMostOnce(`callback for sendData: ${path}`, cb); - - path = '/v1/traces'; - console.log(JSON.stringify(data)); // Transform Instana format to OTLP format const otlpFormat = otlpTransformer(data); @@ -524,6 +552,86 @@ function sendData(path, data, cb, ignore404 = false) { req.end(); } +/** + * Sendet bereits transformierte OTLP-Daten an den Agent + * @param {string} path - API path + * @param {Object} otlpData - Already transformed OTLP data + * @param {(...args: *) => *} cb - Callback + * @param {boolean} [ignore404] + */ +function sendOtlpData(path, otlpData, cb, ignore404 = false) { + cb = util.atMostOnce(`callback for sendOtlpData: ${path}`, cb); + + const payloadAsString = JSON.stringify(otlpData, circularReferenceRemover()); + if (typeof logger.trace === 'function') { + logger.trace(`Sending OTLP data to ${path}.`); + } else { + logger.debug(`Sending OTLP data to ${path}, ${agentOpts}`); + } + + // Convert payload to a buffer to correctly identify content-length ahead of time. + const payload = Buffer.from(payloadAsString, 'utf8'); + if (payload.length > maxContentLength) { + const error = new PayloadTooLargeError(`Request payload is too large. Will not send data to agent. (POST ${path})`); + return setImmediate(cb.bind(null, error)); + } + + const req = http.request( + { + host: agentOpts.host, + port: 4318, + path, + method: 'POST', + agent: http.agent, + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + 'Content-Length': payload.length + } + }, + res => { + res.setEncoding('utf8'); + let responseBody = ''; + res.on('data', chunk => { + responseBody += chunk; + }); + res.on('end', () => { + if (res.statusCode < 200 || res.statusCode >= 300) { + if (ignore404 && res.statusCode === 404) { + return cb(null, responseBody); + } + return cb( + new Error( + `Failed to send data to agent via POST ${path}. ` + + `Got status code ${res.statusCode}. Response: ${responseBody}` + ), + responseBody + ); + } + cb(null, responseBody); + }); + } + ); + + req.setTimeout(agentOpts.requestTimeout, function onTimeout() { + if (req.destroyed) { + return; + } + + req.destroy(new Error(`Sending data to agent via POST ${path}. Request timeout.`)); + }); + + req.on('error', err => { + if (req.destroyed) { + return; + } + + cb(new Error(`Send OTLP data to agent via POST ${path}. Request failed: ${err.message}`)); + }); + + req.write(payload); + req.end(); +} + exports.isConnected = function () { return isConnected; }; diff --git a/packages/collector/src/otlpTransformer.js b/packages/collector/src/otlpTransformer.js index cbca39e4a2..28e74a2647 100644 --- a/packages/collector/src/otlpTransformer.js +++ b/packages/collector/src/otlpTransformer.js @@ -4,46 +4,61 @@ 'use strict'; +// Gespeicherte Resource-Informationen für Metrics (wenn kein "from" Feld vorhanden) +let cachedHostId = null; +let cachedPid = null; + +/** + * Setzt die Host-ID für Resource Attributes + * @param {string} hostId - Host ID + */ +function setHostId(hostId) { + cachedHostId = hostId; +} + +/** + * Setzt die PID für Resource Attributes + * @param {string|number} pid - Process ID + */ +function setPid(pid) { + cachedPid = String(pid); +} + /** * Transformiert Instana Traces Format zu OpenTelemetry Format * * OTEL Format Beispiel: * { - * "resourceSpans": [ - * { - * "resource": { - * "attributes": [ - * { "key": "service.name", "value": { "stringValue": "checkout-service" } }, - * { "key": "service.version", "value": { "stringValue": "1.2.3" } }, - * { "key": "host.name", "value": { "stringValue": "node-1" } } - * ] - * }, - * "scopeSpans": [ - * { - * "scope": { - * "name": "io.opentelemetry.http", - * "version": "1.0.1" - * }, - * "spans": [ - * { - * "traceId": "5b8e1005739815c1054b4f575459392c", - * "spanId": "eed258b6641e17d9", - * "parentSpanId": "6513c7a9c141094d", - * "name": "/calculate-tax", - * "kind": 2, - * "startTimeUnixNano": "1678901234000000000", - * "endTimeUnixNano": "1678901234500000000", - * "attributes": [ - * { "key": "http.method", "value": { "stringValue": "POST" } }, - * { "key": "http.status_code", "value": { "intValue": 200 } } - * ], - * "status": { "code": 1 } - * } - * ] - * } + * "resourceSpans": [{ + * "resource": { + * "attributes": [ + * {"key": "service.name", "value": {"stringValue": "demoService"}}, + * {"key": "process.pid", "value": {"intValue": 12345}}, + * {"key": "host.name", "value": {"stringValue": "My Fancy Host"}} * ] - * } - * ] + * }, + * "scopeSpans": [{ + * "scope": { + * "name": "@instana/collector", + * "version": "1.0.0" + * }, + * "spans": [{ + * "traceId": "0a0b0c0d010203040506070809008081", + * "spanId": "010203040a0b0c0d", + * "parentSpanId": "0d0c0b0a04030201", + * "name": "some span", + * "kind": 3, + * "startTimeUnixNano": "1775732779960000000", + * "endTimeUnixNano": "1775732779969000000", + * "attributes": [ + * {"key": "http.method", "value": {"stringValue": "GET"}}, + * {"key": "http.status_code", "value": {"intValue": 200}}, + * {"key": "http.url", "value": {"stringValue": "/"}} + * ], + * "status": {"code": 1} + * }] + * }] + * }] * } * * INSTANA Format Beispiel: @@ -73,6 +88,35 @@ * }] */ +/** + * OTEL Metrics Format Beispiel: + * { + * "resourceMetrics": [{ + * "resource": { + * "attributes": [ + * {"key": "service.name", "value": {"stringValue": "metricsService"}}, + * {"key": "process.pid", "value": {"intValue": 4711}}, + * {"key": "host.name", "value": {"stringValue": "My Lame Host"}} + * ] + * }, + * "scopeMetrics": [{ + * "scope": { + * "name": "instrumentationScope", + * "version": "13.2" + * }, + * "metrics": [{ + * "name": "sumMetricName", + * "sum": { + * "dataPoints": [{ + * "asDouble": 42.42 + * }] + * } + * }] + * }] + * }] + * } + */ + /** * Konvertiert Instana Span Kind zu OTEL Span Kind * @param {number} instanaKind - Instana span kind @@ -174,34 +218,29 @@ function createResourceAttributes(from) { }); // Service Name - verwende process.title oder einen Default - const serviceName = 'dummy'; + const serviceName = process.env.SERVICE_NAME; attributes.push({ key: 'service.name', value: { stringValue: serviceName } }); - if (!from) { - return attributes; - } - - // Service Instance ID und Process PID aus Instana "from.e" (entity ID / PID) - if (from.e) { - attributes.push({ - key: 'service.instance.id', - value: { stringValue: from.e } - }); + // Verwende "from" Feld wenn vorhanden, sonst cached Werte + const pid = from && from.e ? from.e : cachedPid; + const hostId = from && from.h ? from.h : cachedHostId; + // Process PID + if (pid) { attributes.push({ key: 'process.pid', - value: { intValue: parseInt(from.e, 10) } + value: { intValue: parseInt(pid, 10) } }); } - // Host ID aus Instana "from.h" - if (from.h) { + // Host Name + if (hostId) { attributes.push({ - key: 'host.id', - value: { stringValue: from.h } + key: 'host.name', + value: { stringValue: hostId } }); } @@ -262,6 +301,16 @@ function transform(instanaTraces) { const spansByResource = new Map(); instanaTraces.forEach(function (instanaSpan) { + // Cache PID und Host-ID aus dem ersten Span für Metrics + if (instanaSpan.f) { + if (instanaSpan.f.e && !cachedPid) { + setPid(instanaSpan.f.e); + } + if (instanaSpan.f.h && !cachedHostId) { + setHostId(instanaSpan.f.h); + } + } + const resourceKey = JSON.stringify(instanaSpan.f || {}); if (!spansByResource.has(resourceKey)) { @@ -299,6 +348,185 @@ function transform(instanaTraces) { }; } +/** + * Flacht verschachtelte Objekte zu einem flachen Objekt mit Punkt-Notation + * @param {Object} obj - Verschachteltes Objekt + * @param {string} prefix - Prefix für die Keys + * @returns {Object} Flaches Objekt + */ +function flattenObject(obj, prefix) { + prefix = prefix || ''; + const flattened = {}; + + for (const key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + + const value = obj[key]; + const newKey = prefix ? `${prefix}.${key}` : key; + + if (value === null || value === undefined) { + continue; + } + + if (typeof value === 'object' && !Array.isArray(value)) { + // Rekursiv verschachtelte Objekte flach machen + const nested = flattenObject(value, newKey); + for (const nestedKey in nested) { + if (nested.hasOwnProperty(nestedKey)) { + flattened[nestedKey] = nested[nestedKey]; + } + } + } else if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') { + // Nur primitive Werte übernehmen + flattened[newKey] = value; + } + } + + return flattened; +} + +/** + * Transformiert Instana Metrics zu OTEL Format + * @param {Array} instanaMetrics - Array von Instana metrics + * @returns {Object} OTEL metrics object + */ +function transformMetrics(instanaMetrics) { + // Wenn es ein Objekt ist, konvertiere die Werte zu einem Array + let metricsArray = instanaMetrics; + + if (!Array.isArray(instanaMetrics)) { + if (!instanaMetrics || typeof instanaMetrics !== 'object') { + return { + resourceMetrics: [] + }; + } + + // Flache das verschachtelte Objekt + const flattenedMetrics = flattenObject(instanaMetrics); + + // Konvertiere flaches Objekt zu Array von Metrics + metricsArray = Object.keys(flattenedMetrics).map(function (key) { + const value = flattenedMetrics[key]; + return { + name: key, + value: value, + timestamp: Date.now(), + unit: '', + from: instanaMetrics.from + }; + }); + } + + if (metricsArray.length === 0) { + return { + resourceMetrics: [] + }; + } + + // Gruppiere Metrics nach Resource + const metricsByResource = new Map(); + + metricsArray.forEach(function (instanaMetric) { + const resourceKey = JSON.stringify(instanaMetric.from || {}); + + if (!metricsByResource.has(resourceKey)) { + metricsByResource.set(resourceKey, { + resource: instanaMetric.from, + metrics: [] + }); + } + + metricsByResource.get(resourceKey).metrics.push(instanaMetric); + }); + + // Erstelle OTEL ResourceMetrics + const resourceMetrics = Array.from(metricsByResource.values()).map(function (group) { + const otelMetrics = group.metrics.map(function (metric) { + // Bestimme den Metrik-Typ basierend auf dem Wert + let metricData; + if (typeof metric.value === 'number') { + metricData = { + sum: { + dataPoints: [ + { + asDouble: metric.value + } + ] + } + }; + } else if (typeof metric.value === 'string') { + // Strings als Gauge mit String-Wert (nicht standard OTLP, aber für Debugging) + metricData = { + gauge: { + dataPoints: [ + { + asDouble: 0, + attributes: [ + { + key: 'value', + value: { stringValue: metric.value } + } + ] + } + ] + } + }; + } else if (typeof metric.value === 'boolean') { + metricData = { + gauge: { + dataPoints: [ + { + asDouble: metric.value ? 1 : 0 + } + ] + } + }; + } else { + // Fallback für unbekannte Typen + metricData = { + sum: { + dataPoints: [ + { + asDouble: 0 + } + ] + } + }; + } + + return { + name: metric.name || 'unknown.metric', + ...metricData + }; + }); + + return { + resource: { + attributes: createResourceAttributes(group.resource) + }, + scopeMetrics: [ + { + scope: { + name: 'instrumentationScope', + version: '13.2' + }, + metrics: otelMetrics + } + ] + }; + }); + + return { + resourceMetrics: resourceMetrics + }; +} + module.exports = transform; +module.exports.transformTraces = transform; +module.exports.transformMetrics = transformMetrics; +module.exports.setHostId = setHostId; +module.exports.setPid = setPid; // Made with Bob From 378f1172f51a3c139a4f486f928c75e713861a9f Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 4 May 2026 23:36:54 +0530 Subject: [PATCH 03/23] chore: phase 1 --- packages/collector/src/agentConnection.js | 4 +- packages/core/src/tracing/otelConverter.js | 151 +++++++++++++++++++++ packages/core/src/tracing/spanBuffer.js | 30 +++- 3 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 packages/core/src/tracing/otelConverter.js diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index a45a6eee9a..2f7aff8e15 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -314,7 +314,7 @@ exports.sendMetrics = function sendMetrics(data, cb) { firstTwoKeys[dataKeys[i]] = data[dataKeys[i]]; } - logger.debug(`sendMetrics called with data (first 2 keys): ${JSON.stringify(firstTwoKeys)}`); + // logger.debug(`sendMetrics called with data (first 2 keys): ${JSON.stringify(firstTwoKeys)}`); // Transform Instana metrics to OTLP format const otlpMetrics = otlpTransformer.transformMetrics(data); @@ -352,7 +352,7 @@ exports.sendMetrics = function sendMetrics(data, cb) { logger.error('Error sending metrics:', err); cb(err, null); } else { - logger.debug('Metrics sent successfully'); + // logger.debug('Metrics sent successfully'); // OTLP endpoints don't return requests like the old Instana endpoint // Always return empty array for compatibility cb(null, []); diff --git a/packages/core/src/tracing/otelConverter.js b/packages/core/src/tracing/otelConverter.js new file mode 100644 index 0000000000..6ce21ac60a --- /dev/null +++ b/packages/core/src/tracing/otelConverter.js @@ -0,0 +1,151 @@ +/* + * (c) Copyright IBM Corp. 2024 + */ + +'use strict'; + +/** + * Simple converter from Instana span format to OTLP format + * Only converts HTTP spans for now + */ + +/** + * Convert Instana span to OTLP format + * @param {Object} span - Instana span + * @returns {Object} OTLP span + */ +function convertToOTLP(span) { + // Only convert HTTP spans + if (span.n !== 'node.http.server' && span.n !== 'node.http.client') { + return span; // Return as-is for non-HTTP spans + } + + // Build OTLP span + const otlpSpan = { + traceId: span.t.padStart(32, '0'), + spanId: span.s.padStart(16, '0'), + name: span.n, + kind: convertKind(span.k), + startTimeUnixNano: String(span.ts * 1000000), + endTimeUnixNano: String((span.ts + span.d) * 1000000), + attributes: convertAttributes(span), + status: convertStatus(span), + events: [], + links: [] + }; + + // Add parent if exists + if (span.p) { + otlpSpan.parentSpanId = span.p.padStart(16, '0'); + } + + return otlpSpan; +} + +/** + * Convert span kind + */ +function convertKind(k) { + const kinds = { + 1: 'SPAN_KIND_SERVER', + 2: 'SPAN_KIND_CLIENT', + 3: 'SPAN_KIND_INTERNAL' + }; + return kinds[k] || 'SPAN_KIND_INTERNAL'; +} + +/** + * Convert attributes + */ +function convertAttributes(span) { + const attributes = []; + + // Add HTTP-specific attributes with correct mappings + if (span.data && span.data.http) { + const http = span.data.http; + + if (http.method) { + attributes.push({ key: 'http.method', value: { stringValue: http.method } }); + } + + // url → target + if (http.url) { + attributes.push({ key: 'http.target', value: { stringValue: http.url } }); + } + + // path_tps → route (same as url) + if (http.path_tps) { + attributes.push({ key: 'http.route', value: { stringValue: http.path_tps } }); + } else if (http.path) { + attributes.push({ key: 'http.route', value: { stringValue: http.path } }); + } + + // status → status_code + if (http.status) { + attributes.push({ key: 'http.status_code', value: { intValue: String(http.status) } }); + } + + // host → host + if (http.host) { + attributes.push({ key: 'http.host', value: { stringValue: http.host } }); + } + + // Add status text if available + if (http.status_text) { + attributes.push({ key: 'http.status_text', value: { stringValue: http.status_text } }); + } + + // Add error message if available + if (http.error) { + attributes.push({ key: 'http.error', value: { stringValue: http.error } }); + } + } + + // Add service name + if (span.data && span.data.service) { + attributes.push({ key: 'service.name', value: { stringValue: span.data.service } }); + } + + // Add all other data fields as attributes + if (span.data) { + Object.keys(span.data).forEach(key => { + if (key !== 'http' && key !== 'service') { + const value = span.data[key]; + if (value !== null && value !== undefined) { + // Convert objects to JSON strings, primitives to strings + const stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value); + attributes.push({ key, value: { stringValue } }); + } + } + }); + } + + return attributes; +} + +/** + * Convert status + */ +function convertStatus(span) { + // ec > 0 means error + if (span.ec > 0) { + return { code: 2 }; // ERROR + } + + // Check HTTP status + if (span.data && span.data.http && span.data.http.status) { + const status = span.data.http.status; + if (status >= 400) { + return { code: 2 }; // ERROR + } + if (status >= 200 && status < 400) { + return { code: 1 }; // OK + } + } + + return { code: 0 }; // UNSET +} + +module.exports = { convertToOTLP }; + +// Made with Bob diff --git a/packages/core/src/tracing/spanBuffer.js b/packages/core/src/tracing/spanBuffer.js index f6bf5b19b9..ed9b69f954 100644 --- a/packages/core/src/tracing/spanBuffer.js +++ b/packages/core/src/tracing/spanBuffer.js @@ -7,6 +7,7 @@ const tracingMetrics = require('./metrics'); const { transform } = require('./backend_mappers'); +const { convertToOTLP } = require('./otelConverter'); /** @type {import('../core').GenericLogger} */ let logger; @@ -456,10 +457,13 @@ function transmitSpans() { spans = []; batchingBuckets.clear(); + // Convert spans if OTel format is configured + const processedSpans = convertSpansIfNeeded(spansToSend); + // We restore the content of the spans array if sending them downstream was not successful. We do not restore // batchingBuckets, though. This is deliberate. In the worst case, we might miss some batching opportunities, but // since sending spans downstream will take a few milliseconds, even that will be rare (and it is acceptable). - downstreamConnection.sendSpans(spansToSend, function sendSpans(/** @type {Error} */ error) { + downstreamConnection.sendSpans(processedSpans, function sendSpans(/** @type {Error} */ error) { if (error) { logger.warn(`Failed to transmit spans, will retry in ${transmissionDelay} ms. ${error?.message} ${error?.stack}`); spans = spans.concat(spansToSend); @@ -473,6 +477,30 @@ function transmitSpans() { }); } +/** + * Convert spans to configured format if needed + * + * @param {Array.} spansToConvert - Spans to convert + * @returns {Array.<*>} Converted spans + */ +function convertSpansIfNeeded(spansToConvert) { + // Check if OTLP format is configured + // set to otel for now + const spanFormat = 'otel' || process.env.INSTANA_OTLP_FORMAT === 'true'; + + if (spanFormat === 'otel' || spanFormat === 'otlp') { + logger.debug(`[spanBuffer] Converting ${spansToConvert.length} spans to OTLP format`); + // Convert to OTLP format + return spansToConvert.map(span => { + const transformedSpan = transform(span); + return convertToOTLP(transformedSpan); + }); + } + + // Default: use Instana format with backend mapper transformation + return spansToConvert.map(span => transform(span)); +} + /** * Synchronously returns the spans that are scheduled for transmission and resets the internal span buffer to an empty * array. From c1ef77d4d4449235640d068879c3389398800ed3 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 4 May 2026 23:37:02 +0530 Subject: [PATCH 04/23] chore: phase 2 --- packages/collector/src/otlpTransformer.js | 15 +++++++++++++++ packages/core/src/tracing/otelConverter.js | 12 ++++++++++-- packages/core/src/tracing/spanBuffer.js | 17 ++--------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/packages/collector/src/otlpTransformer.js b/packages/collector/src/otlpTransformer.js index 28e74a2647..af7066fed9 100644 --- a/packages/collector/src/otlpTransformer.js +++ b/packages/collector/src/otlpTransformer.js @@ -266,6 +266,21 @@ function createStatus(errorCount) { * @returns {Object} OTEL span object */ function transformSpan(instanaSpan) { + // Validate required fields + if (typeof instanaSpan.ts !== 'number' || typeof instanaSpan.d !== 'number') { + // Return a minimal valid span if timestamps are missing + return { + traceId: instanaSpan.t || '0', + spanId: instanaSpan.s || '0', + name: instanaSpan.n || 'unknown', + kind: 0, + startTimeUnixNano: '0', + endTimeUnixNano: '0', + attributes: [], + status: { code: 1 } + }; + } + const otelSpan = { traceId: instanaSpan.t, spanId: instanaSpan.s, diff --git a/packages/core/src/tracing/otelConverter.js b/packages/core/src/tracing/otelConverter.js index 6ce21ac60a..e6e98fa2eb 100644 --- a/packages/core/src/tracing/otelConverter.js +++ b/packages/core/src/tracing/otelConverter.js @@ -11,10 +11,17 @@ /** * Convert Instana span to OTLP format - * @param {Object} span - Instana span + * Note: Assumes span has already been transformed by backend_mappers + * @param {Object} span - Instana span (already transformed) * @returns {Object} OTLP span */ function convertToOTLP(span) { + // Validate required fields - if missing, return original span + if (typeof span.ts !== 'number' || typeof span.d !== 'number') { + // Skip OTLP conversion for spans with invalid timestamps + return span; + } + // Only convert HTTP spans if (span.n !== 'node.http.server' && span.n !== 'node.http.client') { return span; // Return as-is for non-HTTP spans @@ -31,7 +38,8 @@ function convertToOTLP(span) { attributes: convertAttributes(span), status: convertStatus(span), events: [], - links: [] + links: [], + parentSpanId: undefined }; // Add parent if exists diff --git a/packages/core/src/tracing/spanBuffer.js b/packages/core/src/tracing/spanBuffer.js index ed9b69f954..965a411690 100644 --- a/packages/core/src/tracing/spanBuffer.js +++ b/packages/core/src/tracing/spanBuffer.js @@ -7,7 +7,6 @@ const tracingMetrics = require('./metrics'); const { transform } = require('./backend_mappers'); -const { convertToOTLP } = require('./otelConverter'); /** @type {import('../core').GenericLogger} */ let logger; @@ -484,20 +483,8 @@ function transmitSpans() { * @returns {Array.<*>} Converted spans */ function convertSpansIfNeeded(spansToConvert) { - // Check if OTLP format is configured - // set to otel for now - const spanFormat = 'otel' || process.env.INSTANA_OTLP_FORMAT === 'true'; - - if (spanFormat === 'otel' || spanFormat === 'otlp') { - logger.debug(`[spanBuffer] Converting ${spansToConvert.length} spans to OTLP format`); - // Convert to OTLP format - return spansToConvert.map(span => { - const transformedSpan = transform(span); - return convertToOTLP(transformedSpan); - }); - } - - // Default: use Instana format with backend mapper transformation + // Don't convert to OTLP here - agentConnection.js will handle OTLP conversion + // Just apply backend mapper transformation return spansToConvert.map(span => transform(span)); } From d261bc5b0f36d537a2bca930bd6087222c2e3de1 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 14:45:41 +0530 Subject: [PATCH 05/23] chore: phase 3 --- packages/collector/src/agentConnection.js | 2 +- .../src/tracing/backend_mappers/mapper.js | 30 +++ packages/core/src/tracing/otelConverter.js | 159 ------------ .../src/tracing}/otlpTransformer.js | 240 ++++++------------ 4 files changed, 109 insertions(+), 322 deletions(-) delete mode 100644 packages/core/src/tracing/otelConverter.js rename packages/{collector/src => core/src/tracing}/otlpTransformer.js (60%) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index 2f7aff8e15..0ef88fe91a 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -10,7 +10,7 @@ const pathUtil = require('path'); const circularReferenceRemover = require('./util/removeCircular'); const agentOpts = require('./agent/opts'); const cmdline = require('./cmdline'); -const otlpTransformer = require('./otlpTransformer'); +const otlpTransformer = require('@instana/core/src/tracing/otlpTransformer'); /** @typedef {import('@instana/core/src/core').InstanaBaseSpan} InstanaBaseSpan */ /** @type {import('@instana/core/src/core').GenericLogger} */ diff --git a/packages/core/src/tracing/backend_mappers/mapper.js b/packages/core/src/tracing/backend_mappers/mapper.js index 3e5ede3272..118775ccb2 100644 --- a/packages/core/src/tracing/backend_mappers/mapper.js +++ b/packages/core/src/tracing/backend_mappers/mapper.js @@ -40,6 +40,36 @@ const fieldMappings = { } }; +/** + * OTLP attribute mappings for different span types. + * Maps Instana span data fields to OTLP semantic convention attributes. + * + * @type {Object>} + */ +const otlpAttributeMappings = { + http: { + method: 'http.method', + url: 'http.target', + path_tpl: 'http.route', + path: 'http.route', + status: 'http.status_code', + host: 'http.host', + status_text: 'http.status_text', + error: 'http.error' + }, + service: { + name: 'service.name' + } +}; + +/** + * Get OTLP attribute mappings + * @returns {Object>} + */ +module.exports.getOtlpAttributeMappings = function () { + return otlpAttributeMappings; +}; + /** * Transforms span data fields to match the backend format. * diff --git a/packages/core/src/tracing/otelConverter.js b/packages/core/src/tracing/otelConverter.js deleted file mode 100644 index e6e98fa2eb..0000000000 --- a/packages/core/src/tracing/otelConverter.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2024 - */ - -'use strict'; - -/** - * Simple converter from Instana span format to OTLP format - * Only converts HTTP spans for now - */ - -/** - * Convert Instana span to OTLP format - * Note: Assumes span has already been transformed by backend_mappers - * @param {Object} span - Instana span (already transformed) - * @returns {Object} OTLP span - */ -function convertToOTLP(span) { - // Validate required fields - if missing, return original span - if (typeof span.ts !== 'number' || typeof span.d !== 'number') { - // Skip OTLP conversion for spans with invalid timestamps - return span; - } - - // Only convert HTTP spans - if (span.n !== 'node.http.server' && span.n !== 'node.http.client') { - return span; // Return as-is for non-HTTP spans - } - - // Build OTLP span - const otlpSpan = { - traceId: span.t.padStart(32, '0'), - spanId: span.s.padStart(16, '0'), - name: span.n, - kind: convertKind(span.k), - startTimeUnixNano: String(span.ts * 1000000), - endTimeUnixNano: String((span.ts + span.d) * 1000000), - attributes: convertAttributes(span), - status: convertStatus(span), - events: [], - links: [], - parentSpanId: undefined - }; - - // Add parent if exists - if (span.p) { - otlpSpan.parentSpanId = span.p.padStart(16, '0'); - } - - return otlpSpan; -} - -/** - * Convert span kind - */ -function convertKind(k) { - const kinds = { - 1: 'SPAN_KIND_SERVER', - 2: 'SPAN_KIND_CLIENT', - 3: 'SPAN_KIND_INTERNAL' - }; - return kinds[k] || 'SPAN_KIND_INTERNAL'; -} - -/** - * Convert attributes - */ -function convertAttributes(span) { - const attributes = []; - - // Add HTTP-specific attributes with correct mappings - if (span.data && span.data.http) { - const http = span.data.http; - - if (http.method) { - attributes.push({ key: 'http.method', value: { stringValue: http.method } }); - } - - // url → target - if (http.url) { - attributes.push({ key: 'http.target', value: { stringValue: http.url } }); - } - - // path_tps → route (same as url) - if (http.path_tps) { - attributes.push({ key: 'http.route', value: { stringValue: http.path_tps } }); - } else if (http.path) { - attributes.push({ key: 'http.route', value: { stringValue: http.path } }); - } - - // status → status_code - if (http.status) { - attributes.push({ key: 'http.status_code', value: { intValue: String(http.status) } }); - } - - // host → host - if (http.host) { - attributes.push({ key: 'http.host', value: { stringValue: http.host } }); - } - - // Add status text if available - if (http.status_text) { - attributes.push({ key: 'http.status_text', value: { stringValue: http.status_text } }); - } - - // Add error message if available - if (http.error) { - attributes.push({ key: 'http.error', value: { stringValue: http.error } }); - } - } - - // Add service name - if (span.data && span.data.service) { - attributes.push({ key: 'service.name', value: { stringValue: span.data.service } }); - } - - // Add all other data fields as attributes - if (span.data) { - Object.keys(span.data).forEach(key => { - if (key !== 'http' && key !== 'service') { - const value = span.data[key]; - if (value !== null && value !== undefined) { - // Convert objects to JSON strings, primitives to strings - const stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value); - attributes.push({ key, value: { stringValue } }); - } - } - }); - } - - return attributes; -} - -/** - * Convert status - */ -function convertStatus(span) { - // ec > 0 means error - if (span.ec > 0) { - return { code: 2 }; // ERROR - } - - // Check HTTP status - if (span.data && span.data.http && span.data.http.status) { - const status = span.data.http.status; - if (status >= 400) { - return { code: 2 }; // ERROR - } - if (status >= 200 && status < 400) { - return { code: 1 }; // OK - } - } - - return { code: 0 }; // UNSET -} - -module.exports = { convertToOTLP }; - -// Made with Bob diff --git a/packages/collector/src/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js similarity index 60% rename from packages/collector/src/otlpTransformer.js rename to packages/core/src/tracing/otlpTransformer.js index af7066fed9..fb41673325 100644 --- a/packages/collector/src/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -4,12 +4,14 @@ 'use strict'; -// Gespeicherte Resource-Informationen für Metrics (wenn kein "from" Feld vorhanden) +const { getOtlpAttributeMappings } = require('./backend_mappers/mapper'); + +// Cached Resource information for Metrics (when no "from" field is present) let cachedHostId = null; let cachedPid = null; /** - * Setzt die Host-ID für Resource Attributes + * Sets the Host-ID for Resource Attributes * @param {string} hostId - Host ID */ function setHostId(hostId) { @@ -17,7 +19,7 @@ function setHostId(hostId) { } /** - * Setzt die PID für Resource Attributes + * Sets the PID for Resource Attributes * @param {string|number} pid - Process ID */ function setPid(pid) { @@ -25,100 +27,7 @@ function setPid(pid) { } /** - * Transformiert Instana Traces Format zu OpenTelemetry Format - * - * OTEL Format Beispiel: - * { - * "resourceSpans": [{ - * "resource": { - * "attributes": [ - * {"key": "service.name", "value": {"stringValue": "demoService"}}, - * {"key": "process.pid", "value": {"intValue": 12345}}, - * {"key": "host.name", "value": {"stringValue": "My Fancy Host"}} - * ] - * }, - * "scopeSpans": [{ - * "scope": { - * "name": "@instana/collector", - * "version": "1.0.0" - * }, - * "spans": [{ - * "traceId": "0a0b0c0d010203040506070809008081", - * "spanId": "010203040a0b0c0d", - * "parentSpanId": "0d0c0b0a04030201", - * "name": "some span", - * "kind": 3, - * "startTimeUnixNano": "1775732779960000000", - * "endTimeUnixNano": "1775732779969000000", - * "attributes": [ - * {"key": "http.method", "value": {"stringValue": "GET"}}, - * {"key": "http.status_code", "value": {"intValue": 200}}, - * {"key": "http.url", "value": {"stringValue": "/"}} - * ], - * "status": {"code": 1} - * }] - * }] - * }] - * } - * - * INSTANA Format Beispiel: - * [{ - * "t": "b94dae370181cbd5", // trace ID - * "s": "3c84e4b658761152", // span ID - * "p": "parent_span_id", // parent span ID (optional) - * "n": "node.http.server", // span name - * "k": 1, // span kind (1=SERVER, 2=CLIENT, 3=PRODUCER, 4=CONSUMER, 5=INTERNAL) - * "f": { // from (resource attributes) - * "e": "74662", // entity ID - * "h": "7e:0d:24:ff:fe:aa:33:af" // host ID - * }, - * "ec": 0, // error count - * "ts": 1775729099820, // timestamp in milliseconds - * "d": 8, // duration in milliseconds - * "stack": [], - * "data": { // span attributes - * "http": { - * "path_tpl": "/", - * "status": 304, - * "method": "GET", - * "url": "/", - * "host": "localhost:2807" - * } - * } - * }] - */ - -/** - * OTEL Metrics Format Beispiel: - * { - * "resourceMetrics": [{ - * "resource": { - * "attributes": [ - * {"key": "service.name", "value": {"stringValue": "metricsService"}}, - * {"key": "process.pid", "value": {"intValue": 4711}}, - * {"key": "host.name", "value": {"stringValue": "My Lame Host"}} - * ] - * }, - * "scopeMetrics": [{ - * "scope": { - * "name": "instrumentationScope", - * "version": "13.2" - * }, - * "metrics": [{ - * "name": "sumMetricName", - * "sum": { - * "dataPoints": [{ - * "asDouble": 42.42 - * }] - * } - * }] - * }] - * }] - * } - */ - -/** - * Konvertiert Instana Span Kind zu OTEL Span Kind + * Converts Instana Span Kind to OTEL Span Kind * @param {number} instanaKind - Instana span kind * @returns {number} OTEL span kind */ @@ -138,68 +47,71 @@ function convertSpanKind(instanaKind) { } /** - * Konvertiert Millisekunden zu Nanosekunden (als String) - * @param {number} ms - Millisekunden - * @returns {string} Nanosekunden als String + * Converts milliseconds to nanoseconds (as String) + * @param {number} ms - Milliseconds + * @returns {string} Nanoseconds as String */ function msToNano(ms) { return String(ms * 1000000); } /** - * Erstellt OTEL Attribute aus Instana Span Data + * Creates OTEL Attributes from Instana Span Data using mapper schema * @param {Object} data - Instana span data * @returns {Array} OTEL attributes array */ function createAttributes(data) { const attributes = []; + const mappings = getOtlpAttributeMappings(); if (!data) { return attributes; } - // HTTP Attribute - if (data.http) { - if (data.http.method) { - attributes.push({ - key: 'http.method', - value: { stringValue: data.http.method } - }); - } - if (data.http.status) { - attributes.push({ - key: 'http.status_code', - value: { intValue: data.http.status } - }); - } - if (data.http.url) { - attributes.push({ - key: 'http.url', - value: { stringValue: data.http.url } - }); - } - if (data.http.host) { - attributes.push({ - key: 'http.host', - value: { stringValue: data.http.host } - }); - } - if (data.http.path_tpl) { - attributes.push({ - key: 'http.target', - value: { stringValue: data.http.path_tpl } - }); + // Process each data section (http, service, etc.) + Object.keys(data).forEach(dataKey => { + const dataSection = data[dataKey]; + const sectionMappings = mappings[dataKey]; + + if (!sectionMappings || typeof dataSection !== 'object') { + // If no mappings exist for this section, add as-is + if (dataSection !== null && dataSection !== undefined) { + const stringValue = typeof dataSection === 'object' ? JSON.stringify(dataSection) : String(dataSection); + attributes.push({ key: dataKey, value: { stringValue } }); + } + return; } - } - // Weitere Datenfelder können hier hinzugefügt werden - // z.B. data.db, data.service, etc. + // Apply mappings for this section + Object.keys(dataSection).forEach(field => { + const value = dataSection[field]; + if (value === null || value === undefined) { + return; + } + + const otlpKey = sectionMappings[field] || `${dataKey}.${field}`; + + // Determine value type and format + if (otlpKey === 'http.status_code' && typeof value === 'number') { + attributes.push({ key: otlpKey, value: { intValue: value } }); + } else if (typeof value === 'string') { + attributes.push({ key: otlpKey, value: { stringValue: value } }); + } else if (typeof value === 'number') { + attributes.push({ key: otlpKey, value: { intValue: value } }); + } else if (typeof value === 'boolean') { + attributes.push({ key: otlpKey, value: { boolValue: value } }); + } else { + // Convert objects to JSON strings + attributes.push({ key: otlpKey, value: { stringValue: JSON.stringify(value) } }); + } + }); + }); return attributes; } /** - * Erstellt Resource Attributes aus Instana "from" Feld + * Creates Resource Attributes from Instana "from" field * @param {Object} from - Instana from object * @returns {Array} OTEL resource attributes */ @@ -217,14 +129,14 @@ function createResourceAttributes(from) { value: { stringValue: '@instana/collector' } }); - // Service Name - verwende process.title oder einen Default + // Service Name - use process.title or a default const serviceName = process.env.SERVICE_NAME; attributes.push({ key: 'service.name', value: { stringValue: serviceName } }); - // Verwende "from" Feld wenn vorhanden, sonst cached Werte + // Use "from" field if present, otherwise cached values const pid = from && from.e ? from.e : cachedPid; const hostId = from && from.h ? from.h : cachedHostId; @@ -248,7 +160,7 @@ function createResourceAttributes(from) { } /** - * Bestimmt den Status Code basierend auf Error Count + * Determines the status code based on Error Count * @param {number} errorCount - Instana error count * @returns {Object} OTEL status object */ @@ -261,7 +173,7 @@ function createStatus(errorCount) { } /** - * Transformiert einen einzelnen Instana Span zu OTEL Span + * Transforms a single Instana Span to OTEL Span * @param {Object} instanaSpan - Instana span object * @returns {Object} OTEL span object */ @@ -292,7 +204,7 @@ function transformSpan(instanaSpan) { status: createStatus(instanaSpan.ec || 0) }; - // Parent Span ID ist optional + // Parent Span ID is optional if (instanaSpan.p) { otelSpan.parentSpanId = instanaSpan.p; } @@ -301,8 +213,11 @@ function transformSpan(instanaSpan) { } /** - * Transformiert Instana Traces zu OTEL Format - * @param {Array} instanaTraces - Array von Instana spans + * Transforms Instana Traces to OTEL Format + * Similar to the transform pattern in mapper.js, this function processes + * Instana spans and converts them to OpenTelemetry format. + * + * @param {Array} instanaTraces - Array of Instana spans * @returns {Object} OTEL traces object */ function transform(instanaTraces) { @@ -312,11 +227,11 @@ function transform(instanaTraces) { }; } - // Gruppiere Spans nach Resource (from field) + // Group Spans by Resource (from field) const spansByResource = new Map(); instanaTraces.forEach(function (instanaSpan) { - // Cache PID und Host-ID aus dem ersten Span für Metrics + // Cache PID and Host-ID from the first span for Metrics if (instanaSpan.f) { if (instanaSpan.f.e && !cachedPid) { setPid(instanaSpan.f.e); @@ -338,7 +253,7 @@ function transform(instanaTraces) { spansByResource.get(resourceKey).spans.push(instanaSpan); }); - // Erstelle OTEL ResourceSpans + // Create OTEL ResourceSpans const resourceSpans = Array.from(spansByResource.values()).map(function (group) { const otelSpans = group.spans.map(transformSpan); @@ -364,10 +279,10 @@ function transform(instanaTraces) { } /** - * Flacht verschachtelte Objekte zu einem flachen Objekt mit Punkt-Notation - * @param {Object} obj - Verschachteltes Objekt - * @param {string} prefix - Prefix für die Keys - * @returns {Object} Flaches Objekt + * Flattens nested objects to a flat object with dot notation + * @param {Object} obj - Nested object + * @param {string} prefix - Prefix for the keys + * @returns {Object} Flat object */ function flattenObject(obj, prefix) { prefix = prefix || ''; @@ -386,7 +301,7 @@ function flattenObject(obj, prefix) { } if (typeof value === 'object' && !Array.isArray(value)) { - // Rekursiv verschachtelte Objekte flach machen + // Recursively flatten nested objects const nested = flattenObject(value, newKey); for (const nestedKey in nested) { if (nested.hasOwnProperty(nestedKey)) { @@ -394,7 +309,7 @@ function flattenObject(obj, prefix) { } } } else if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') { - // Nur primitive Werte übernehmen + // Only take primitive values flattened[newKey] = value; } } @@ -403,12 +318,12 @@ function flattenObject(obj, prefix) { } /** - * Transformiert Instana Metrics zu OTEL Format - * @param {Array} instanaMetrics - Array von Instana metrics + * Transforms Instana Metrics to OTEL Format + * @param {Array|Object} instanaMetrics - Array or object of Instana metrics * @returns {Object} OTEL metrics object */ function transformMetrics(instanaMetrics) { - // Wenn es ein Objekt ist, konvertiere die Werte zu einem Array + // If it's an object, convert the values to an array let metricsArray = instanaMetrics; if (!Array.isArray(instanaMetrics)) { @@ -418,10 +333,10 @@ function transformMetrics(instanaMetrics) { }; } - // Flache das verschachtelte Objekt + // Flatten the nested object const flattenedMetrics = flattenObject(instanaMetrics); - // Konvertiere flaches Objekt zu Array von Metrics + // Convert flat object to array of Metrics metricsArray = Object.keys(flattenedMetrics).map(function (key) { const value = flattenedMetrics[key]; return { @@ -440,7 +355,7 @@ function transformMetrics(instanaMetrics) { }; } - // Gruppiere Metrics nach Resource + // Group Metrics by Resource const metricsByResource = new Map(); metricsArray.forEach(function (instanaMetric) { @@ -456,10 +371,10 @@ function transformMetrics(instanaMetrics) { metricsByResource.get(resourceKey).metrics.push(instanaMetric); }); - // Erstelle OTEL ResourceMetrics + // Create OTEL ResourceMetrics const resourceMetrics = Array.from(metricsByResource.values()).map(function (group) { const otelMetrics = group.metrics.map(function (metric) { - // Bestimme den Metrik-Typ basierend auf dem Wert + // Determine the metric type based on the value let metricData; if (typeof metric.value === 'number') { metricData = { @@ -472,7 +387,7 @@ function transformMetrics(instanaMetrics) { } }; } else if (typeof metric.value === 'string') { - // Strings als Gauge mit String-Wert (nicht standard OTLP, aber für Debugging) + // Strings as Gauge with String value (not standard OTLP, but for debugging) metricData = { gauge: { dataPoints: [ @@ -499,7 +414,7 @@ function transformMetrics(instanaMetrics) { } }; } else { - // Fallback für unbekannte Typen + // Fallback for unknown types metricData = { sum: { dataPoints: [ @@ -539,6 +454,7 @@ function transformMetrics(instanaMetrics) { } module.exports = transform; +module.exports.transform = transform; module.exports.transformTraces = transform; module.exports.transformMetrics = transformMetrics; module.exports.setHostId = setHostId; From 17710d005f6136a7047e0ab713ff651b99952969 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 18:18:06 +0530 Subject: [PATCH 06/23] chore: cleanup --- packages/collector/src/agentConnection.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index 0ef88fe91a..bb6dcea3d5 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -10,7 +10,7 @@ const pathUtil = require('path'); const circularReferenceRemover = require('./util/removeCircular'); const agentOpts = require('./agent/opts'); const cmdline = require('./cmdline'); -const otlpTransformer = require('@instana/core/src/tracing/otlpTransformer'); +const otlpTransformer = require('@_local/core/src/tracing/otlpTransformer'); /** @typedef {import('@instana/core/src/core').InstanaBaseSpan} InstanaBaseSpan */ /** @type {import('@instana/core/src/core').GenericLogger} */ @@ -475,11 +475,11 @@ function sendData(path, data, cb, ignore404 = false) { cb = util.atMostOnce(`callback for sendData: ${path}`, cb); console.log(JSON.stringify(data)); // Transform Instana format to OTLP format - const otlpFormat = otlpTransformer(data); + // const otlpFormat = otlpTransformer(data); - console.log(JSON.stringify(otlpFormat)); + // console.log(JSON.stringify(otlpFormat)); - const payloadAsString = JSON.stringify(otlpFormat, circularReferenceRemover()); + const payloadAsString = JSON.stringify(data, circularReferenceRemover()); if (typeof logger.trace === 'function') { logger.trace(`Sending data to ${path}.`); } else { From 0a6ec17a43e3a37e394221d6a5b53e168c0c6b9a Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 18:30:19 +0530 Subject: [PATCH 07/23] chore: rewrite --- .../core/src/tracing/backend_mappers/index.js | 26 +++++-- .../src/tracing/backend_mappers/mapper.js | 30 -------- .../src/tracing/backend_mappers/otlpMapper.js | 72 +++++++++++++++++++ packages/core/src/tracing/otlpTransformer.js | 2 +- packages/core/src/tracing/spanBuffer.js | 27 +++---- 5 files changed, 103 insertions(+), 54 deletions(-) create mode 100644 packages/core/src/tracing/backend_mappers/otlpMapper.js diff --git a/packages/core/src/tracing/backend_mappers/index.js b/packages/core/src/tracing/backend_mappers/index.js index 940a974797..9d7afd52de 100644 --- a/packages/core/src/tracing/backend_mappers/index.js +++ b/packages/core/src/tracing/backend_mappers/index.js @@ -5,14 +5,26 @@ 'use strict'; const mapper = require('./mapper'); +const otlpMapper = require('./otlpMapper'); + +/** + * @param {(span: import('../../core').InstanaBaseSpan) => import('../../core').InstanaBaseSpan} transformer + */ +function createSafeTransform(transformer) { + return (/** @type {import('../../core').InstanaBaseSpan} */ span) => { + try { + return transformer(span); + } catch (error) { + return span; + } + }; +} + module.exports = { get transform() { - return (/** @type {import('../../core').InstanaBaseSpan} */ span) => { - try { - return mapper.transform(span); - } catch (error) { - return span; - } - }; + return createSafeTransform(mapper.transform); + }, + get otlpTransform() { + return createSafeTransform(otlpMapper.transform); } }; diff --git a/packages/core/src/tracing/backend_mappers/mapper.js b/packages/core/src/tracing/backend_mappers/mapper.js index 118775ccb2..3e5ede3272 100644 --- a/packages/core/src/tracing/backend_mappers/mapper.js +++ b/packages/core/src/tracing/backend_mappers/mapper.js @@ -40,36 +40,6 @@ const fieldMappings = { } }; -/** - * OTLP attribute mappings for different span types. - * Maps Instana span data fields to OTLP semantic convention attributes. - * - * @type {Object>} - */ -const otlpAttributeMappings = { - http: { - method: 'http.method', - url: 'http.target', - path_tpl: 'http.route', - path: 'http.route', - status: 'http.status_code', - host: 'http.host', - status_text: 'http.status_text', - error: 'http.error' - }, - service: { - name: 'service.name' - } -}; - -/** - * Get OTLP attribute mappings - * @returns {Object>} - */ -module.exports.getOtlpAttributeMappings = function () { - return otlpAttributeMappings; -}; - /** * Transforms span data fields to match the backend format. * diff --git a/packages/core/src/tracing/backend_mappers/otlpMapper.js b/packages/core/src/tracing/backend_mappers/otlpMapper.js new file mode 100644 index 0000000000..f12387aa36 --- /dev/null +++ b/packages/core/src/tracing/backend_mappers/otlpMapper.js @@ -0,0 +1,72 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +/** + * OTLP attribute mappings for different span types. + * Maps Instana span data fields to OTLP semantic convention attributes. + * + * @type {Object>} + */ +const otlpAttributeMappings = { + http: { + method: 'http.method', + url: 'http.target', + path_tpl: 'http.route', + path: 'http.route', + status: 'http.status_code', + host: 'http.host', + status_text: 'http.status_text', + error: 'http.error' + }, + + // resource but added for ui view, without this .. ? + service: { + name: 'service.name' + } +}; + +/** + * Transforms span data fields to OTLP attribute naming while keeping + * the mapper logic separate from the backend field mapping. + * + * @param {import('../../core').InstanaBaseSpan} span + * @returns {import('../../core').InstanaBaseSpan} The transformed span. + */ +module.exports.transform = span => { + if (!span || !span.data) { + return span; + } + + Object.keys(span.data).forEach(key => { + const mappings = otlpAttributeMappings[key]; + if (!mappings || typeof span.data[key] !== 'object' || span.data[key] === null) { + return; + } + + applyMappings(span.data[key], mappings, key); + }); + + return span; +}; + +/** + * Applies OTLP field mappings to a specific data section. + * + * @param {Record} dataSection + * @param {Object} mappings + * @param {string} sectionKey + */ +function applyMappings(dataSection, mappings, sectionKey) { + Object.keys(dataSection).forEach(internalField => { + const mappedField = mappings[internalField] || `${sectionKey}.${internalField}`; + dataSection[mappedField] = dataSection[internalField]; + delete dataSection[internalField]; + }); +} + +module.exports.getOtlpAttributeMappings = function () { + return otlpAttributeMappings; +}; diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index fb41673325..a4de910f95 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -4,7 +4,7 @@ 'use strict'; -const { getOtlpAttributeMappings } = require('./backend_mappers/mapper'); +const { getOtlpAttributeMappings } = require('./backend_mappers/otlpMapper'); // Cached Resource information for Metrics (when no "from" field is present) let cachedHostId = null; diff --git a/packages/core/src/tracing/spanBuffer.js b/packages/core/src/tracing/spanBuffer.js index 965a411690..c5d460e6b7 100644 --- a/packages/core/src/tracing/spanBuffer.js +++ b/packages/core/src/tracing/spanBuffer.js @@ -6,7 +6,7 @@ 'use strict'; const tracingMetrics = require('./metrics'); -const { transform } = require('./backend_mappers'); +const { transform, otlpTransform } = require('./backend_mappers'); /** @type {import('../core').GenericLogger} */ let logger; @@ -457,12 +457,12 @@ function transmitSpans() { batchingBuckets.clear(); // Convert spans if OTel format is configured - const processedSpans = convertSpansIfNeeded(spansToSend); + // const processedSpans = spansToSend; // We restore the content of the spans array if sending them downstream was not successful. We do not restore // batchingBuckets, though. This is deliberate. In the worst case, we might miss some batching opportunities, but // since sending spans downstream will take a few milliseconds, even that will be rare (and it is acceptable). - downstreamConnection.sendSpans(processedSpans, function sendSpans(/** @type {Error} */ error) { + downstreamConnection.sendSpans(spansToSend, function sendSpans(/** @type {Error} */ error) { if (error) { logger.warn(`Failed to transmit spans, will retry in ${transmissionDelay} ms. ${error?.message} ${error?.stack}`); spans = spans.concat(spansToSend); @@ -476,18 +476,6 @@ function transmitSpans() { }); } -/** - * Convert spans to configured format if needed - * - * @param {Array.} spansToConvert - Spans to convert - * @returns {Array.<*>} Converted spans - */ -function convertSpansIfNeeded(spansToConvert) { - // Don't convert to OTLP here - agentConnection.js will handle OTLP conversion - // Just apply backend mapper transformation - return spansToConvert.map(span => transform(span)); -} - /** * Synchronously returns the spans that are scheduled for transmission and resets the internal span buffer to an empty * array. @@ -525,5 +513,12 @@ function removeSpansIfNecessary() { * @returns {import('../core').InstanaBaseSpan} span */ function applySpanTransformation(span) { - return transform(span); + // span is internal format + const transformedForBE = transform(span); + // now it is converted to BE format + if (process.env.INSTANA_OTLP_FORMAT === 'true') { + return otlpTransform(transformedForBE); + } + + return transformedForBE; } From 8a89eefbf096dd32d77a51b2f39d3d9bf74be544 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 18:32:45 +0530 Subject: [PATCH 08/23] chore: test --- .../tracing/backend_mappers/mapper_test.js | 60 ++++++++++++++++++- packages/core/test/tracing/spanBuffer_test.js | 43 +++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/packages/core/test/tracing/backend_mappers/mapper_test.js b/packages/core/test/tracing/backend_mappers/mapper_test.js index eb1ac41715..33836d348d 100644 --- a/packages/core/test/tracing/backend_mappers/mapper_test.js +++ b/packages/core/test/tracing/backend_mappers/mapper_test.js @@ -5,7 +5,7 @@ 'use strict'; const expect = require('chai').expect; -const { transform } = require('../../../src/tracing/backend_mappers'); +const { transform, otlpTransform } = require('../../../src/tracing/backend_mappers'); describe('tracing/backend_mappers', () => { let span; @@ -328,4 +328,62 @@ describe('tracing/backend_mappers', () => { expect(result).to.deep.equal(span); }); }); + describe('OTLP HTTP Mapper', () => { + it('should transform backend-mapped http span fields to OTLP http attributes', () => { + span = { + n: 'node.http.server', + t: '4234567803', + s: '4234567892', + p: '4234567891', + data: { + http: { + operation: 'GET', + endpoints: '/api/users', + connection: 'localhost', + status: 200 + } + } + }; + + const result = otlpTransform(transform(span)); + + expect(result.data.http['http.method']).to.equal('GET'); + expect(result.data.http['http.target']).to.equal('/api/users'); + expect(result.data.http['http.host']).to.equal('localhost'); + expect(result.data.http['http.status_code']).to.equal(200); + + expect(result.data.http).to.not.have.property('operation'); + expect(result.data.http).to.not.have.property('endpoints'); + expect(result.data.http).to.not.have.property('connection'); + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('host'); + expect(result.data.http).to.not.have.property('status'); + }); + + it('should keep unmapped backend http fields as section-prefixed OTLP attributes', () => { + span = { + n: 'node.http.server', + data: { + http: { + method: 'POST', + url: '/orders', + host: 'service.local', + custom_header: 'x-test' + } + } + }; + + const result = otlpTransform(span); + + expect(result.data.http['http.method']).to.equal('POST'); + expect(result.data.http['http.target']).to.equal('/orders'); + expect(result.data.http['http.host']).to.equal('service.local'); + expect(result.data.http['http.custom_header']).to.equal('x-test'); + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('host'); + expect(result.data.http).to.not.have.property('custom_header'); + }); + }); }); diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index aa629b8e30..f1f946c555 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -605,6 +605,49 @@ describe('tracing/spanBuffer', () => { expect(spans).to.have.lengthOf(1); expect(span).to.deep.equal(span); }); + + it('should apply otlp http mapper after backend transformation when INSTANA_OTLP_FORMAT is true', () => { + const previousValue = process.env.INSTANA_OTLP_FORMAT; + process.env.INSTANA_OTLP_FORMAT = 'true'; + + const httpSpan = { + t: '1234567803', + s: '1234567892', + p: '1234567891', + n: 'node.http.server', + k: 1, + data: { + http: { + operation: 'GET', + endpoints: '/orders', + connection: 'localhost', + status: 200 + } + } + }; + + spanBuffer.addSpan(httpSpan); + const spans = spanBuffer.getAndResetSpans(); + + if (previousValue === undefined) { + delete process.env.INSTANA_OTLP_FORMAT; + } else { + process.env.INSTANA_OTLP_FORMAT = previousValue; + } + + expect(spans).to.have.lengthOf(1); + expect(spans[0].data.http['http.method']).to.equal('GET'); + expect(spans[0].data.http['http.target']).to.equal('/orders'); + expect(spans[0].data.http['http.host']).to.equal('localhost'); + expect(spans[0].data.http['http.status_code']).to.equal(200); + expect(spans[0].data.http).to.not.have.property('operation'); + expect(spans[0].data.http).to.not.have.property('endpoints'); + expect(spans[0].data.http).to.not.have.property('connection'); + expect(spans[0].data.http).to.not.have.property('method'); + expect(spans[0].data.http).to.not.have.property('url'); + expect(spans[0].data.http).to.not.have.property('host'); + expect(spans[0].data.http).to.not.have.property('status'); + }); }); }); From c78331ccc0f273fdde1dd09a8df40cf34a209f75 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 18:42:59 +0530 Subject: [PATCH 09/23] chore: a --- packages/collector/src/agentConnection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index bb6dcea3d5..a20913441b 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -10,7 +10,7 @@ const pathUtil = require('path'); const circularReferenceRemover = require('./util/removeCircular'); const agentOpts = require('./agent/opts'); const cmdline = require('./cmdline'); -const otlpTransformer = require('@_local/core/src/tracing/otlpTransformer'); +const otlpTransformer = require('@instana/core/src/tracing/otlpTransformer'); /** @typedef {import('@instana/core/src/core').InstanaBaseSpan} InstanaBaseSpan */ /** @type {import('@instana/core/src/core').GenericLogger} */ @@ -344,7 +344,7 @@ exports.sendMetrics = function sendMetrics(data, cb) { } } - logger.debug(`Transformed to OTLP (first 2 metrics) ${JSON.stringify(otlpPreview)}`); + // logger.debug(`Transformed to OTLP (first 2 metrics) ${JSON.stringify(otlpPreview)}`); // Send directly without using sendData (which would transform again) sendOtlpData('/v1/metrics', otlpMetrics, err => { From bcb034e2ed6300571c2f8f388b1a403f2aaf026a Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 19:59:07 +0530 Subject: [PATCH 10/23] chore: new fields --- packages/collector/src/agentConnection.js | 4 +- .../src/tracing/backend_mappers/otlpMapper.js | 55 ++++++++++++++-- packages/core/src/tracing/otlpTransformer.js | 15 ++++- packages/core/src/tracing/spanBuffer.js | 18 ++---- .../tracing/backend_mappers/mapper_test.js | 53 +++++++++++++-- packages/core/test/tracing/spanBuffer_test.js | 64 ++++++++++++++----- 6 files changed, 162 insertions(+), 47 deletions(-) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index a20913441b..63f9fa2669 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -370,10 +370,10 @@ exports.sendSpans = function sendSpans(spans, cb) { if (err && !maxContentErrorHasBeenLogged && err instanceof PayloadTooLargeError) { logLargeSpans(spans); } else if (err) { - const spanInfo = getSpanLengthInfo(spans); + const spanInfo = spans; logger.debug(`Failed to send: ${JSON.stringify(spanInfo)}`); } else { - const spanInfo = getSpanLengthInfo(spans); + const spanInfo = spans; logger.debug(`Successfully sent: ${JSON.stringify(spanInfo)}`); } cb(err); diff --git a/packages/core/src/tracing/backend_mappers/otlpMapper.js b/packages/core/src/tracing/backend_mappers/otlpMapper.js index f12387aa36..8da3e0030f 100644 --- a/packages/core/src/tracing/backend_mappers/otlpMapper.js +++ b/packages/core/src/tracing/backend_mappers/otlpMapper.js @@ -8,18 +8,59 @@ * OTLP attribute mappings for different span types. * Maps Instana span data fields to OTLP semantic convention attributes. * + * Based on OpenTelemetry Semantic Conventions for HTTP: + * - Common HTTP exit (client) span mapping + * - Common HTTP entry (server) span mapping + * * @type {Object>} */ const otlpAttributeMappings = { http: { - method: 'http.method', - url: 'http.target', - path_tpl: 'http.route', - path: 'http.route', - status: 'http.status_code', - host: 'http.host', + // HTTP method mapping (both client and server) + // Instana: http.method -> OTel: http.request.method + method: 'http.request.method', + + // HTTP status code mapping (both client and server) + // Instana: http.status -> OTel: http.response.status_code + status: 'http.response.status_code', + + // HTTP URL mapping (client spans) + // Instana: http.url -> OTel: url.full + url: 'url.full', + + // HTTP path mapping (server spans) + // Instana: http.path -> OTel: url.path + path: 'url.path', + + // HTTP host mapping (both client and server) + // Instana: http.host -> OTel: server.address (simplified, may need port handling) + host: 'server.address', + + // HTTP protocol mapping + // Instana: http.protocol -> OTel: network.protocol.name (may need version split) + protocol: 'network.protocol.name', + + // HTTP query parameters mapping (both client and server) + // Instana: http.params -> OTel: url.query + params: 'url.query', + + // HTTP path template mapping (both client and server) + // Instana: http.path_tpl -> OTel: url.template + path_tpl: 'url.template', + + // HTTP error mapping (both client and server) + // Instana: http.error -> OTel: error.type + error: 'error.type', + + // Note: http.context_root mapping is not included as it conflicts with http.path + // Both would map to url.path. Context root extraction requires special logic + // and should be implemented separately when needed. + + // Legacy mappings for backward compatibility status_text: 'http.status_text', - error: 'http.error' + + // HTTP route mapping (alternative to path_tpl) + route: 'http.route' }, // resource but added for ui view, without this .. ? diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index a4de910f95..53fa084bca 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -182,7 +182,7 @@ function transformSpan(instanaSpan) { if (typeof instanaSpan.ts !== 'number' || typeof instanaSpan.d !== 'number') { // Return a minimal valid span if timestamps are missing return { - traceId: instanaSpan.t || '0', + traceId: normalizeTraceId(instanaSpan.t || '0'), spanId: instanaSpan.s || '0', name: instanaSpan.n || 'unknown', kind: 0, @@ -194,7 +194,7 @@ function transformSpan(instanaSpan) { } const otelSpan = { - traceId: instanaSpan.t, + traceId: normalizeTraceId(instanaSpan.t), spanId: instanaSpan.s, name: instanaSpan.n || 'unknown', kind: convertSpanKind(instanaSpan.k), @@ -212,6 +212,17 @@ function transformSpan(instanaSpan) { return otelSpan; } +function normalizeTraceId(traceId) { + const normalized = String(traceId || '0'); + if (normalized.length === 32) { + return normalized; + } + if (normalized.length > 32) { + return normalized.slice(-32); + } + return normalized.padStart(32, '0'); +} + /** * Transforms Instana Traces to OTEL Format * Similar to the transform pattern in mapper.js, this function processes diff --git a/packages/core/src/tracing/spanBuffer.js b/packages/core/src/tracing/spanBuffer.js index c5d460e6b7..1014cb445d 100644 --- a/packages/core/src/tracing/spanBuffer.js +++ b/packages/core/src/tracing/spanBuffer.js @@ -6,7 +6,8 @@ 'use strict'; const tracingMetrics = require('./metrics'); -const { transform, otlpTransform } = require('./backend_mappers'); +const { transform } = require('./backend_mappers'); +const otlpTransformer = require('./otlpTransformer'); /** @type {import('../core').GenericLogger} */ let logger; @@ -456,13 +457,13 @@ function transmitSpans() { spans = []; batchingBuckets.clear(); - // Convert spans if OTel format is configured - // const processedSpans = spansToSend; + const processedSpans = + process.env.INSTANA_OTLP_FORMAT === 'true' ? otlpTransformer.transform(spansToSend) : spansToSend; // We restore the content of the spans array if sending them downstream was not successful. We do not restore // batchingBuckets, though. This is deliberate. In the worst case, we might miss some batching opportunities, but // since sending spans downstream will take a few milliseconds, even that will be rare (and it is acceptable). - downstreamConnection.sendSpans(spansToSend, function sendSpans(/** @type {Error} */ error) { + downstreamConnection.sendSpans(processedSpans, function sendSpans(/** @type {Error} */ error) { if (error) { logger.warn(`Failed to transmit spans, will retry in ${transmissionDelay} ms. ${error?.message} ${error?.stack}`); spans = spans.concat(spansToSend); @@ -513,12 +514,5 @@ function removeSpansIfNecessary() { * @returns {import('../core').InstanaBaseSpan} span */ function applySpanTransformation(span) { - // span is internal format - const transformedForBE = transform(span); - // now it is converted to BE format - if (process.env.INSTANA_OTLP_FORMAT === 'true') { - return otlpTransform(transformedForBE); - } - - return transformedForBE; + return transform(span); } diff --git a/packages/core/test/tracing/backend_mappers/mapper_test.js b/packages/core/test/tracing/backend_mappers/mapper_test.js index 33836d348d..cfef5bf52f 100644 --- a/packages/core/test/tracing/backend_mappers/mapper_test.js +++ b/packages/core/test/tracing/backend_mappers/mapper_test.js @@ -347,10 +347,11 @@ describe('tracing/backend_mappers', () => { const result = otlpTransform(transform(span)); - expect(result.data.http['http.method']).to.equal('GET'); - expect(result.data.http['http.target']).to.equal('/api/users'); - expect(result.data.http['http.host']).to.equal('localhost'); - expect(result.data.http['http.status_code']).to.equal(200); + // New OTel semantic conventions + expect(result.data.http['http.request.method']).to.equal('GET'); + expect(result.data.http['url.full']).to.equal('/api/users'); + expect(result.data.http['server.address']).to.equal('localhost'); + expect(result.data.http['http.response.status_code']).to.equal(200); expect(result.data.http).to.not.have.property('operation'); expect(result.data.http).to.not.have.property('endpoints'); @@ -376,14 +377,52 @@ describe('tracing/backend_mappers', () => { const result = otlpTransform(span); - expect(result.data.http['http.method']).to.equal('POST'); - expect(result.data.http['http.target']).to.equal('/orders'); - expect(result.data.http['http.host']).to.equal('service.local'); + // New OTel semantic conventions + expect(result.data.http['http.request.method']).to.equal('POST'); + expect(result.data.http['url.full']).to.equal('/orders'); + expect(result.data.http['server.address']).to.equal('service.local'); expect(result.data.http['http.custom_header']).to.equal('x-test'); expect(result.data.http).to.not.have.property('method'); expect(result.data.http).to.not.have.property('url'); expect(result.data.http).to.not.have.property('host'); expect(result.data.http).to.not.have.property('custom_header'); }); + + it('should map additional HTTP fields according to OTel semantic conventions', () => { + span = { + n: 'node.http.client', + data: { + http: { + method: 'GET', + url: 'https://api.example.com/users?page=1', + path: '/users', + params: 'page=1', + protocol: 'HTTP/1.1', + path_tpl: '/users', + error: 'timeout' + } + } + }; + + const result = otlpTransform(span); + + // Verify all new mappings + expect(result.data.http['http.request.method']).to.equal('GET'); + expect(result.data.http['url.full']).to.equal('https://api.example.com/users?page=1'); + expect(result.data.http['url.path']).to.equal('/users'); + expect(result.data.http['url.query']).to.equal('page=1'); + expect(result.data.http['network.protocol.name']).to.equal('HTTP/1.1'); + expect(result.data.http['url.template']).to.equal('/users'); + expect(result.data.http['error.type']).to.equal('timeout'); + + // Verify old fields are removed + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('path'); + expect(result.data.http).to.not.have.property('params'); + expect(result.data.http).to.not.have.property('protocol'); + expect(result.data.http).to.not.have.property('path_tpl'); + expect(result.data.http).to.not.have.property('error'); + }); }); }); diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index f1f946c555..29e194789b 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -124,12 +124,18 @@ describe('tracing/spanBuffer', () => { }); beforeEach(() => { + delete process.env.INSTANA_OTLP_FORMAT; + spanBuffer.setTransmitImmediate(false); + downstreamConnectionStub.sendSpans.resetHistory(); spanBuffer.activate(); expect(global.setTimeout.called).to.be.true; global.setTimeout.resetHistory(); }); afterEach(() => { + delete process.env.INSTANA_OTLP_FORMAT; + spanBuffer.setTransmitImmediate(false); + downstreamConnectionStub.sendSpans.resetHistory(); spanBuffer.deactivate(); }); @@ -574,9 +580,11 @@ describe('tracing/spanBuffer', () => { }); describe('when applying span transformations', () => { - beforeEach(() => spanBuffer.activate()); + beforeEach(() => { + downstreamConnectionStub.sendSpans.resetHistory(); + }); - afterEach(() => spanBuffer.deactivate()); + afterEach(() => {}); const span = { t: '1234567803', s: '1234567892', @@ -606,9 +614,11 @@ describe('tracing/spanBuffer', () => { expect(span).to.deep.equal(span); }); - it('should apply otlp http mapper after backend transformation when INSTANA_OTLP_FORMAT is true', () => { + it('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { const previousValue = process.env.INSTANA_OTLP_FORMAT; process.env.INSTANA_OTLP_FORMAT = 'true'; + downstreamConnectionStub.sendSpans.resetHistory(); + spanBuffer.setTransmitImmediate(true); const httpSpan = { t: '1234567803', @@ -616,6 +626,13 @@ describe('tracing/spanBuffer', () => { p: '1234567891', n: 'node.http.server', k: 1, + f: { + e: '45543', + h: 'localhost' + }, + ts: timestamp(Date.now()), + d: 25, + ec: 0, data: { http: { operation: 'GET', @@ -627,26 +644,39 @@ describe('tracing/spanBuffer', () => { }; spanBuffer.addSpan(httpSpan); - const spans = spanBuffer.getAndResetSpans(); + expect(downstreamConnectionStub.sendSpans.calledOnce).to.be.true; + const sentPayload = downstreamConnectionStub.sendSpans.getCall(0).args[0]; + const sentSpan = sentPayload.resourceSpans[0].scopeSpans[0].spans[0]; + + expect(sentSpan.traceId).to.have.lengthOf(32); + expect(sentSpan.name).to.equal('node.http.server'); + expect(sentSpan.kind).to.equal(2); + expect(sentSpan.attributes).to.deep.include.members([ + { + key: 'http.request.method', + value: { stringValue: 'GET' } + }, + { + key: 'url.full', + value: { stringValue: '/orders' } + }, + { + key: 'server.address', + value: { stringValue: 'localhost' } + }, + { + key: 'http.response.status_code', + value: { intValue: 200 } + } + ]); + + spanBuffer.setTransmitImmediate(false); if (previousValue === undefined) { delete process.env.INSTANA_OTLP_FORMAT; } else { process.env.INSTANA_OTLP_FORMAT = previousValue; } - - expect(spans).to.have.lengthOf(1); - expect(spans[0].data.http['http.method']).to.equal('GET'); - expect(spans[0].data.http['http.target']).to.equal('/orders'); - expect(spans[0].data.http['http.host']).to.equal('localhost'); - expect(spans[0].data.http['http.status_code']).to.equal(200); - expect(spans[0].data.http).to.not.have.property('operation'); - expect(spans[0].data.http).to.not.have.property('endpoints'); - expect(spans[0].data.http).to.not.have.property('connection'); - expect(spans[0].data.http).to.not.have.property('method'); - expect(spans[0].data.http).to.not.have.property('url'); - expect(spans[0].data.http).to.not.have.property('host'); - expect(spans[0].data.http).to.not.have.property('status'); }); }); }); From 980a1c045fa88ee18dac26830330d66d91816641 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 7 May 2026 20:08:15 +0530 Subject: [PATCH 11/23] chore: test --- packages/core/test/tracing/spanBuffer_test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index 29e194789b..42b97035db 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -614,7 +614,8 @@ describe('tracing/spanBuffer', () => { expect(span).to.deep.equal(span); }); - it('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { + // TODO check + it.skip('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { const previousValue = process.env.INSTANA_OTLP_FORMAT; process.env.INSTANA_OTLP_FORMAT = 'true'; downstreamConnectionStub.sendSpans.resetHistory(); From 5aebc15a6ecb09d01e958451d7d45fd59996a7d1 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Sun, 10 May 2026 17:17:02 +0530 Subject: [PATCH 12/23] test: fixed failing test --- packages/core/test/tracing/spanBuffer_test.js | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index 42b97035db..13483ad268 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -124,18 +124,12 @@ describe('tracing/spanBuffer', () => { }); beforeEach(() => { - delete process.env.INSTANA_OTLP_FORMAT; - spanBuffer.setTransmitImmediate(false); - downstreamConnectionStub.sendSpans.resetHistory(); spanBuffer.activate(); expect(global.setTimeout.called).to.be.true; global.setTimeout.resetHistory(); }); afterEach(() => { - delete process.env.INSTANA_OTLP_FORMAT; - spanBuffer.setTransmitImmediate(false); - downstreamConnectionStub.sendSpans.resetHistory(); spanBuffer.deactivate(); }); @@ -580,11 +574,32 @@ describe('tracing/spanBuffer', () => { }); describe('when applying span transformations', () => { + before(() => { + downstreamConnectionStub = { + sendSpans: sinon.stub() + }; + + spanBuffer.init( + { + logger: testUtils.createFakeLogger(), + tracing: { + maxBufferedSpans: 1000, + forceTransmissionStartingAt: 500, + transmissionDelay: 1000, + spanBatchingEnabled: false + } + }, + downstreamConnectionStub + ); + }); + beforeEach(() => { + spanBuffer.activate(); downstreamConnectionStub.sendSpans.resetHistory(); }); - afterEach(() => {}); + afterEach(() => spanBuffer.deactivate()); + const span = { t: '1234567803', s: '1234567892', @@ -615,7 +630,7 @@ describe('tracing/spanBuffer', () => { }); // TODO check - it.skip('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { + it('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { const previousValue = process.env.INSTANA_OTLP_FORMAT; process.env.INSTANA_OTLP_FORMAT = 'true'; downstreamConnectionStub.sendSpans.resetHistory(); From 8c6cc8889169064298b5d4aa53e8c97f2699363f Mon Sep 17 00:00:00 2001 From: Abhilash Date: Sun, 10 May 2026 17:19:47 +0530 Subject: [PATCH 13/23] chore: cleanup --- packages/collector/src/agentConnection.js | 4 ++-- packages/core/test/tracing/spanBuffer_test.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index 63f9fa2669..a20913441b 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -370,10 +370,10 @@ exports.sendSpans = function sendSpans(spans, cb) { if (err && !maxContentErrorHasBeenLogged && err instanceof PayloadTooLargeError) { logLargeSpans(spans); } else if (err) { - const spanInfo = spans; + const spanInfo = getSpanLengthInfo(spans); logger.debug(`Failed to send: ${JSON.stringify(spanInfo)}`); } else { - const spanInfo = spans; + const spanInfo = getSpanLengthInfo(spans); logger.debug(`Successfully sent: ${JSON.stringify(spanInfo)}`); } cb(err); diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index 13483ad268..ff7bbbdd44 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -629,7 +629,6 @@ describe('tracing/spanBuffer', () => { expect(span).to.deep.equal(span); }); - // TODO check it('should transform http spans before buffering and convert the transmitted batch to OTLP when INSTANA_OTLP_FORMAT is true', () => { const previousValue = process.env.INSTANA_OTLP_FORMAT; process.env.INSTANA_OTLP_FORMAT = 'true'; From c3179eb7ea0e6530e26fbe1e25bbbd5adfe62635 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Wed, 13 May 2026 15:39:27 +0530 Subject: [PATCH 14/23] chore: ui corrected --- .../core/src/tracing/backend_mappers/index.js | 2 +- packages/core/src/tracing/otlpTransformer.js | 45 +++++++++++++++++-- .../otlpMapper.js => otlp_mapper/mapper.js} | 0 3 files changed, 43 insertions(+), 4 deletions(-) rename packages/core/src/tracing/{backend_mappers/otlpMapper.js => otlp_mapper/mapper.js} (100%) diff --git a/packages/core/src/tracing/backend_mappers/index.js b/packages/core/src/tracing/backend_mappers/index.js index 9d7afd52de..6101db0475 100644 --- a/packages/core/src/tracing/backend_mappers/index.js +++ b/packages/core/src/tracing/backend_mappers/index.js @@ -5,7 +5,7 @@ 'use strict'; const mapper = require('./mapper'); -const otlpMapper = require('./otlpMapper'); +const otlpMapper = require('../otlp_mapper/mapper'); /** * @param {(span: import('../../core').InstanaBaseSpan) => import('../../core').InstanaBaseSpan} transformer diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index 53fa084bca..b007cad52a 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -4,7 +4,7 @@ 'use strict'; -const { getOtlpAttributeMappings } = require('./backend_mappers/otlpMapper'); +const { getOtlpAttributeMappings } = require('./otlp_mapper/mapper'); // Cached Resource information for Metrics (when no "from" field is present) let cachedHostId = null; @@ -172,6 +172,43 @@ function createStatus(errorCount) { return { code: 1 }; // OK } +/** + * Generates a descriptive span name based on Instana span data + * @param {Object} instanaSpan - Instana span object + * @returns {string} Descriptive span name + */ +function generateSpanName(instanaSpan) { + const spanType = instanaSpan.n; + const data = instanaSpan.data || {}; + const httpData = data.http || {}; + + // Debug log to trace span name generation + console.log('[DEBUG] generateSpanName - Input:', { + spanType, + httpMethod: httpData.method, + httpUrl: httpData.url, + httpPath: httpData.path_tpl || httpData.url, + fullData: JSON.stringify(data, null, 2) + }); + + // For HTTP server spans: "METHOD path" + if (spanType === 'node.http.server') { + const method = httpData.method || 'HTTP'; + const path = httpData.path_tpl || httpData.url || '/'; + return `${method} ${path}`; + } + + // For HTTP client spans: "METHOD" or "METHOD url" + if (spanType === 'node.http.client') { + const method = httpData.method || 'HTTP'; + // For client spans, just use the method (similar to OTEL "GET") + return method; + } + + // For other span types, use the original name + return spanType || 'unknown'; +} + /** * Transforms a single Instana Span to OTEL Span * @param {Object} instanaSpan - Instana span object @@ -184,7 +221,7 @@ function transformSpan(instanaSpan) { return { traceId: normalizeTraceId(instanaSpan.t || '0'), spanId: instanaSpan.s || '0', - name: instanaSpan.n || 'unknown', + name: generateSpanName(instanaSpan), kind: 0, startTimeUnixNano: '0', endTimeUnixNano: '0', @@ -196,7 +233,7 @@ function transformSpan(instanaSpan) { const otelSpan = { traceId: normalizeTraceId(instanaSpan.t), spanId: instanaSpan.s, - name: instanaSpan.n || 'unknown', + name: generateSpanName(instanaSpan), kind: convertSpanKind(instanaSpan.k), startTimeUnixNano: msToNano(instanaSpan.ts), endTimeUnixNano: msToNano(instanaSpan.ts + instanaSpan.d), @@ -268,6 +305,8 @@ function transform(instanaTraces) { const resourceSpans = Array.from(spansByResource.values()).map(function (group) { const otelSpans = group.spans.map(transformSpan); + console.log('-----------------', JSON.stringify(otelSpans)); + return { resource: { attributes: createResourceAttributes(group.resource) diff --git a/packages/core/src/tracing/backend_mappers/otlpMapper.js b/packages/core/src/tracing/otlp_mapper/mapper.js similarity index 100% rename from packages/core/src/tracing/backend_mappers/otlpMapper.js rename to packages/core/src/tracing/otlp_mapper/mapper.js From 21c211d52e842b6817bb4cebcb44bb0cc798079f Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 14 May 2026 20:25:26 +0530 Subject: [PATCH 15/23] chore: added kafka and pg, generalize --- packages/collector/src/agentConnection.js | 4 +- packages/core/src/tracing/otlpTransformer.js | 130 ++++++++++++++---- .../core/src/tracing/otlp_mapper/mapper.js | 59 +++----- 3 files changed, 123 insertions(+), 70 deletions(-) diff --git a/packages/collector/src/agentConnection.js b/packages/collector/src/agentConnection.js index a20913441b..63f9fa2669 100644 --- a/packages/collector/src/agentConnection.js +++ b/packages/collector/src/agentConnection.js @@ -370,10 +370,10 @@ exports.sendSpans = function sendSpans(spans, cb) { if (err && !maxContentErrorHasBeenLogged && err instanceof PayloadTooLargeError) { logLargeSpans(spans); } else if (err) { - const spanInfo = getSpanLengthInfo(spans); + const spanInfo = spans; logger.debug(`Failed to send: ${JSON.stringify(spanInfo)}`); } else { - const spanInfo = getSpanLengthInfo(spans); + const spanInfo = spans; logger.debug(`Successfully sent: ${JSON.stringify(spanInfo)}`); } cb(err); diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index b007cad52a..061cd86e50 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -26,14 +26,42 @@ function setPid(pid) { cachedPid = String(pid); } +/** + * Span kind mapping rules for special cases + * Maps specific span types to OTEL span kinds based on data context + */ +const spanKindRules = { + kafka: { + dataKey: 'kafka', + resolver: data => { + // OTEL: 4=PRODUCER, 5=CONSUMER + if (data.access === 'send') return 4; + if (data.access === 'consume') return 5; + return null; // Fall back to default mapping + } + } +}; + /** * Converts Instana Span Kind to OTEL Span Kind - * @param {number} instanaKind - Instana span kind + * @param {number} instanaKind - Instana span kind (1=ENTRY, 2=EXIT, 3=INTERMEDIATE) + * @param {string} spanType - Instana span type (e.g., 'node.http.server', 'kafka') + * @param {Object} data - Span data for additional context * @returns {number} OTEL span kind */ -function convertSpanKind(instanaKind) { - // Instana: 1=ENTRY/SERVER, 2=EXIT/CLIENT, 3=INTERMEDIATE/INTERNAL +function convertSpanKind(instanaKind, spanType, data) { // OTEL: 0=UNSPECIFIED, 1=INTERNAL, 2=SERVER, 3=CLIENT, 4=PRODUCER, 5=CONSUMER + + // Check for special span kind rules + const rule = spanKindRules[spanType]; + if (rule && data && data[rule.dataKey]) { + const resolvedKind = rule.resolver(data[rule.dataKey]); + if (resolvedKind !== null) { + return resolvedKind; + } + } + + // Standard Instana kind mapping switch (instanaKind) { case 1: // ENTRY -> SERVER return 2; @@ -55,12 +83,28 @@ function msToNano(ms) { return String(ms * 1000000); } +/** + * System attribute rules for specific span types + * Automatically adds required system attributes based on span type + */ +const systemAttributeRules = { + postgres: { + dataKey: 'pg', + attributes: [{ key: 'db.system', value: 'postgresql' }] + }, + kafka: { + dataKey: 'kafka', + attributes: [{ key: 'messaging.system', value: 'kafka' }] + } +}; + /** * Creates OTEL Attributes from Instana Span Data using mapper schema * @param {Object} data - Instana span data + * @param {string} spanType - Instana span type for context-specific attributes * @returns {Array} OTEL attributes array */ -function createAttributes(data) { +function createAttributes(data, spanType) { const attributes = []; const mappings = getOtlpAttributeMappings(); @@ -68,6 +112,14 @@ function createAttributes(data) { return attributes; } + // Add system-specific attributes based on span type + const systemRule = systemAttributeRules[spanType]; + if (systemRule && data[systemRule.dataKey]) { + systemRule.attributes.forEach(attr => { + attributes.push({ key: attr.key, value: { stringValue: attr.value } }); + }); + } + // Process each data section (http, service, etc.) Object.keys(data).forEach(dataKey => { const dataSection = data[dataKey]; @@ -92,7 +144,7 @@ function createAttributes(data) { const otlpKey = sectionMappings[field] || `${dataKey}.${field}`; // Determine value type and format - if (otlpKey === 'http.status_code' && typeof value === 'number') { + if (otlpKey === 'http.response.status_code' && typeof value === 'number') { attributes.push({ key: otlpKey, value: { intValue: value } }); } else if (typeof value === 'string') { attributes.push({ key: otlpKey, value: { stringValue: value } }); @@ -172,6 +224,42 @@ function createStatus(errorCount) { return { code: 1 }; // OK } +/** + * Span name generation rules configuration + * Each rule defines how to generate a span name for a specific span type + */ +const spanNameRules = { + 'node.http.server': { + dataKey: 'http', + template: data => { + const method = data.method || 'HTTP'; + const path = data.path_tpl || data.url || '/'; + return `${method} ${path}`; + } + }, + 'node.http.client': { + dataKey: 'http', + template: data => data.method || 'HTTP' + }, + postgres: { + dataKey: 'pg', + template: data => { + const stmt = data.stmt || ''; + const operation = stmt.split(' ')[0] || 'query'; + const db = data.db || ''; + return `pg.query:${operation} ${db}`.trim(); + } + }, + kafka: { + dataKey: 'kafka', + template: data => { + const access = data.access || 'process'; + const topic = data.service || 'unknown'; + return `${access} ${topic}`; + } + } +}; + /** * Generates a descriptive span name based on Instana span data * @param {Object} instanaSpan - Instana span object @@ -180,32 +268,14 @@ function createStatus(errorCount) { function generateSpanName(instanaSpan) { const spanType = instanaSpan.n; const data = instanaSpan.data || {}; - const httpData = data.http || {}; - - // Debug log to trace span name generation - console.log('[DEBUG] generateSpanName - Input:', { - spanType, - httpMethod: httpData.method, - httpUrl: httpData.url, - httpPath: httpData.path_tpl || httpData.url, - fullData: JSON.stringify(data, null, 2) - }); - - // For HTTP server spans: "METHOD path" - if (spanType === 'node.http.server') { - const method = httpData.method || 'HTTP'; - const path = httpData.path_tpl || httpData.url || '/'; - return `${method} ${path}`; - } - // For HTTP client spans: "METHOD" or "METHOD url" - if (spanType === 'node.http.client') { - const method = httpData.method || 'HTTP'; - // For client spans, just use the method (similar to OTEL "GET") - return method; + // Check if we have a rule for this span type + const rule = spanNameRules[spanType]; + if (rule && data[rule.dataKey]) { + return rule.template(data[rule.dataKey]); } - // For other span types, use the original name + // Default: use span type return spanType || 'unknown'; } @@ -234,10 +304,10 @@ function transformSpan(instanaSpan) { traceId: normalizeTraceId(instanaSpan.t), spanId: instanaSpan.s, name: generateSpanName(instanaSpan), - kind: convertSpanKind(instanaSpan.k), + kind: convertSpanKind(instanaSpan.k, instanaSpan.n, instanaSpan.data), startTimeUnixNano: msToNano(instanaSpan.ts), endTimeUnixNano: msToNano(instanaSpan.ts + instanaSpan.d), - attributes: createAttributes(instanaSpan.data), + attributes: createAttributes(instanaSpan.data, instanaSpan.n), status: createStatus(instanaSpan.ec || 0) }; diff --git a/packages/core/src/tracing/otlp_mapper/mapper.js b/packages/core/src/tracing/otlp_mapper/mapper.js index 8da3e0030f..93a0bbb3ac 100644 --- a/packages/core/src/tracing/otlp_mapper/mapper.js +++ b/packages/core/src/tracing/otlp_mapper/mapper.js @@ -8,62 +8,45 @@ * OTLP attribute mappings for different span types. * Maps Instana span data fields to OTLP semantic convention attributes. * - * Based on OpenTelemetry Semantic Conventions for HTTP: - * - Common HTTP exit (client) span mapping - * - Common HTTP entry (server) span mapping + * Based on OpenTelemetry Semantic Conventions: + * - HTTP: https://opentelemetry.io/docs/specs/semconv/http/ + * - Database: https://opentelemetry.io/docs/specs/semconv/database/ + * - Messaging: https://opentelemetry.io/docs/specs/semconv/messaging/ * * @type {Object>} */ const otlpAttributeMappings = { + // HTTP Semantic Conventions http: { - // HTTP method mapping (both client and server) - // Instana: http.method -> OTel: http.request.method method: 'http.request.method', - - // HTTP status code mapping (both client and server) - // Instana: http.status -> OTel: http.response.status_code status: 'http.response.status_code', - - // HTTP URL mapping (client spans) - // Instana: http.url -> OTel: url.full url: 'url.full', - - // HTTP path mapping (server spans) - // Instana: http.path -> OTel: url.path path: 'url.path', - - // HTTP host mapping (both client and server) - // Instana: http.host -> OTel: server.address (simplified, may need port handling) host: 'server.address', - - // HTTP protocol mapping - // Instana: http.protocol -> OTel: network.protocol.name (may need version split) protocol: 'network.protocol.name', - - // HTTP query parameters mapping (both client and server) - // Instana: http.params -> OTel: url.query params: 'url.query', - - // HTTP path template mapping (both client and server) - // Instana: http.path_tpl -> OTel: url.template path_tpl: 'url.template', - - // HTTP error mapping (both client and server) - // Instana: http.error -> OTel: error.type error: 'error.type', - - // Note: http.context_root mapping is not included as it conflicts with http.path - // Both would map to url.path. Context root extraction requires special logic - // and should be implemented separately when needed. - - // Legacy mappings for backward compatibility status_text: 'http.status_text', - - // HTTP route mapping (alternative to path_tpl) route: 'http.route' }, - // resource but added for ui view, without this .. ? + // PostgreSQL/Database Semantic Conventions + pg: { + stmt: 'db.statement', + host: 'net.peer.name', + port: 'net.peer.port', + user: 'db.user', + db: 'db.name' + }, + + // Kafka/Messaging Semantic Conventions + kafka: { + service: 'messaging.destination.name', + access: 'messaging.operation.type' + }, + + // Service metadata service: { name: 'service.name' } From fcd7622fac12b228171d3376e981d6011b6bcdd3 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Thu, 14 May 2026 20:30:27 +0530 Subject: [PATCH 16/23] chore: update --- packages/core/src/tracing/otlpTransformer.js | 5 +++-- packages/core/src/tracing/otlp_mapper/mapper.js | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index 061cd86e50..b5cfdab065 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -35,8 +35,9 @@ const spanKindRules = { dataKey: 'kafka', resolver: data => { // OTEL: 4=PRODUCER, 5=CONSUMER - if (data.access === 'send') return 4; - if (data.access === 'consume') return 5; + // Visible in UI after changing to 2 and 3 + if (data.access === 'send') return 2; + if (data.access === 'consume') return 3; return null; // Fall back to default mapping } } diff --git a/packages/core/src/tracing/otlp_mapper/mapper.js b/packages/core/src/tracing/otlp_mapper/mapper.js index 93a0bbb3ac..1011f48b20 100644 --- a/packages/core/src/tracing/otlp_mapper/mapper.js +++ b/packages/core/src/tracing/otlp_mapper/mapper.js @@ -44,11 +44,6 @@ const otlpAttributeMappings = { kafka: { service: 'messaging.destination.name', access: 'messaging.operation.type' - }, - - // Service metadata - service: { - name: 'service.name' } }; From c1253b0beaf295dfecd11b8252924b57140345c7 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Fri, 15 May 2026 11:24:38 +0530 Subject: [PATCH 17/23] chore: fix --- .../core/src/tracing/backend_mappers/index.js | 20 +- .../src/tracing/backend_mappers/mapper.js | 4 + .../core/src/tracing/otlp_mapper/mapper.js | 130 ++++++- .../tracing/backend_mappers/mapper_test.js | 99 +---- .../test/tracing/otlp_mapper/mapper_test.js | 342 ++++++++++++++++++ packages/core/test/tracing/spanBuffer_test.js | 2 +- 6 files changed, 465 insertions(+), 132 deletions(-) create mode 100644 packages/core/test/tracing/otlp_mapper/mapper_test.js diff --git a/packages/core/src/tracing/backend_mappers/index.js b/packages/core/src/tracing/backend_mappers/index.js index 6101db0475..33623d973e 100644 --- a/packages/core/src/tracing/backend_mappers/index.js +++ b/packages/core/src/tracing/backend_mappers/index.js @@ -5,26 +5,10 @@ 'use strict'; const mapper = require('./mapper'); -const otlpMapper = require('../otlp_mapper/mapper'); /** - * @param {(span: import('../../core').InstanaBaseSpan) => import('../../core').InstanaBaseSpan} transformer + * Backend mapper transforms - converts internal span fields to backend format */ -function createSafeTransform(transformer) { - return (/** @type {import('../../core').InstanaBaseSpan} */ span) => { - try { - return transformer(span); - } catch (error) { - return span; - } - }; -} - module.exports = { - get transform() { - return createSafeTransform(mapper.transform); - }, - get otlpTransform() { - return createSafeTransform(otlpMapper.transform); - } + transform: mapper.transform }; diff --git a/packages/core/src/tracing/backend_mappers/mapper.js b/packages/core/src/tracing/backend_mappers/mapper.js index 3e5ede3272..fa99277dc4 100644 --- a/packages/core/src/tracing/backend_mappers/mapper.js +++ b/packages/core/src/tracing/backend_mappers/mapper.js @@ -47,6 +47,10 @@ const fieldMappings = { * @returns {import('../../core').InstanaBaseSpan} The transformed span. */ module.exports.transform = span => { + if (!span || !span.data) { + return span; + } + // In most cases, `span.n` matches the key inside `span.data` (e.g., `span.n === 'redis'` → `span.data.redis`). // However, there are exceptions where `span.n` represents a higher-level concept or protocol, // while `span.data` contains one or more lower-level components. diff --git a/packages/core/src/tracing/otlp_mapper/mapper.js b/packages/core/src/tracing/otlp_mapper/mapper.js index 1011f48b20..347e4a82c8 100644 --- a/packages/core/src/tracing/otlp_mapper/mapper.js +++ b/packages/core/src/tracing/otlp_mapper/mapper.js @@ -15,6 +15,49 @@ * * @type {Object>} */ + +/** + * Common database field mappings following OTLP Database Semantic Conventions. + * These mappings apply to all database span types (pg, mysql, mongodb, redis, etc.). + */ +const databaseMappings = { + stmt: 'db.statement', + command: 'db.operation.name', + host: 'net.peer.name', + port: 'net.peer.port', + user: 'db.user', + db: 'db.name', + namespace: 'db.namespace', + collection: 'db.collection.name', + table: 'db.sql.table', + operation: 'db.operation.name', + connection: 'db.connection_string' +}; + +/** + * Database span types that should use the common database mappings. + * Add new database types here as they are instrumented. + */ +const databaseSpanTypes = [ + 'pg', + 'mysql', + 'mongodb', + 'redis', + 'mssql', + 'couchbase', + 'elasticsearch', + 'dynamodb', + 'db2', + 'memcached', + 'mongoose', + 'prisma' +]; + +/** + * Messaging span types that should use the common messaging mappings. + */ +const messagingSpanTypes = ['kafka']; + const otlpAttributeMappings = { // HTTP Semantic Conventions http: { @@ -31,22 +74,55 @@ const otlpAttributeMappings = { route: 'http.route' }, - // PostgreSQL/Database Semantic Conventions - pg: { - stmt: 'db.statement', - host: 'net.peer.name', - port: 'net.peer.port', - user: 'db.user', - db: 'db.name' - }, - - // Kafka/Messaging Semantic Conventions - kafka: { + // Messaging Semantic Conventions (Kafka, etc.) + messaging: { service: 'messaging.destination.name', - access: 'messaging.operation.type' + access: 'messaging.operation.type', + operation: 'messaging.operation.type' } }; +/** + * Determines the appropriate mapping category for a given span data key. + * + * @param {string} key - The span data key (e.g., 'pg', 'mysql', 'http', 'kafka') + * @returns {'database' | 'messaging' | 'http' | null} The mapping category + */ +function getMappingCategory(key) { + if (key === 'http') { + return 'http'; + } + if (messagingSpanTypes.includes(key)) { + return 'messaging'; + } + if (databaseSpanTypes.includes(key)) { + return 'database'; + } + return null; +} + +/** + * Gets the appropriate mappings for a given span data key. + * + * @param {string} key - The span data key + * @returns {Object | null} The mappings object or null + */ +function getMappingsForKey(key) { + const category = getMappingCategory(key); + + if (category === 'http') { + return otlpAttributeMappings.http; + } + if (category === 'messaging') { + return otlpAttributeMappings.messaging; + } + if (category === 'database') { + return databaseMappings; + } + + return null; +} + /** * Transforms span data fields to OTLP attribute naming while keeping * the mapper logic separate from the backend field mapping. @@ -60,8 +136,12 @@ module.exports.transform = span => { } Object.keys(span.data).forEach(key => { - const mappings = otlpAttributeMappings[key]; - if (!mappings || typeof span.data[key] !== 'object' || span.data[key] === null) { + if (typeof span.data[key] !== 'object' || span.data[key] === null) { + return; + } + + const mappings = getMappingsForKey(key); + if (!mappings) { return; } @@ -86,6 +166,26 @@ function applyMappings(dataSection, mappings, sectionKey) { }); } +/** + * Returns all OTLP attribute mappings including dynamic database and messaging mappings. + * + * @returns {Object>} All mappings + */ module.exports.getOtlpAttributeMappings = function () { - return otlpAttributeMappings; + /** @type {Object>} */ + const allMappings = { ...otlpAttributeMappings }; + + // Add database mappings for all database span types + databaseSpanTypes.forEach(dbType => { + allMappings[dbType] = databaseMappings; + }); + + // Add messaging mappings for all messaging span types + messagingSpanTypes.forEach(msgType => { + allMappings[msgType] = otlpAttributeMappings.messaging; + }); + + return allMappings; }; + +// Made with Bob diff --git a/packages/core/test/tracing/backend_mappers/mapper_test.js b/packages/core/test/tracing/backend_mappers/mapper_test.js index cfef5bf52f..eb1ac41715 100644 --- a/packages/core/test/tracing/backend_mappers/mapper_test.js +++ b/packages/core/test/tracing/backend_mappers/mapper_test.js @@ -5,7 +5,7 @@ 'use strict'; const expect = require('chai').expect; -const { transform, otlpTransform } = require('../../../src/tracing/backend_mappers'); +const { transform } = require('../../../src/tracing/backend_mappers'); describe('tracing/backend_mappers', () => { let span; @@ -328,101 +328,4 @@ describe('tracing/backend_mappers', () => { expect(result).to.deep.equal(span); }); }); - describe('OTLP HTTP Mapper', () => { - it('should transform backend-mapped http span fields to OTLP http attributes', () => { - span = { - n: 'node.http.server', - t: '4234567803', - s: '4234567892', - p: '4234567891', - data: { - http: { - operation: 'GET', - endpoints: '/api/users', - connection: 'localhost', - status: 200 - } - } - }; - - const result = otlpTransform(transform(span)); - - // New OTel semantic conventions - expect(result.data.http['http.request.method']).to.equal('GET'); - expect(result.data.http['url.full']).to.equal('/api/users'); - expect(result.data.http['server.address']).to.equal('localhost'); - expect(result.data.http['http.response.status_code']).to.equal(200); - - expect(result.data.http).to.not.have.property('operation'); - expect(result.data.http).to.not.have.property('endpoints'); - expect(result.data.http).to.not.have.property('connection'); - expect(result.data.http).to.not.have.property('method'); - expect(result.data.http).to.not.have.property('url'); - expect(result.data.http).to.not.have.property('host'); - expect(result.data.http).to.not.have.property('status'); - }); - - it('should keep unmapped backend http fields as section-prefixed OTLP attributes', () => { - span = { - n: 'node.http.server', - data: { - http: { - method: 'POST', - url: '/orders', - host: 'service.local', - custom_header: 'x-test' - } - } - }; - - const result = otlpTransform(span); - - // New OTel semantic conventions - expect(result.data.http['http.request.method']).to.equal('POST'); - expect(result.data.http['url.full']).to.equal('/orders'); - expect(result.data.http['server.address']).to.equal('service.local'); - expect(result.data.http['http.custom_header']).to.equal('x-test'); - expect(result.data.http).to.not.have.property('method'); - expect(result.data.http).to.not.have.property('url'); - expect(result.data.http).to.not.have.property('host'); - expect(result.data.http).to.not.have.property('custom_header'); - }); - - it('should map additional HTTP fields according to OTel semantic conventions', () => { - span = { - n: 'node.http.client', - data: { - http: { - method: 'GET', - url: 'https://api.example.com/users?page=1', - path: '/users', - params: 'page=1', - protocol: 'HTTP/1.1', - path_tpl: '/users', - error: 'timeout' - } - } - }; - - const result = otlpTransform(span); - - // Verify all new mappings - expect(result.data.http['http.request.method']).to.equal('GET'); - expect(result.data.http['url.full']).to.equal('https://api.example.com/users?page=1'); - expect(result.data.http['url.path']).to.equal('/users'); - expect(result.data.http['url.query']).to.equal('page=1'); - expect(result.data.http['network.protocol.name']).to.equal('HTTP/1.1'); - expect(result.data.http['url.template']).to.equal('/users'); - expect(result.data.http['error.type']).to.equal('timeout'); - - // Verify old fields are removed - expect(result.data.http).to.not.have.property('method'); - expect(result.data.http).to.not.have.property('url'); - expect(result.data.http).to.not.have.property('path'); - expect(result.data.http).to.not.have.property('params'); - expect(result.data.http).to.not.have.property('protocol'); - expect(result.data.http).to.not.have.property('path_tpl'); - expect(result.data.http).to.not.have.property('error'); - }); - }); }); diff --git a/packages/core/test/tracing/otlp_mapper/mapper_test.js b/packages/core/test/tracing/otlp_mapper/mapper_test.js new file mode 100644 index 0000000000..cd15e444bc --- /dev/null +++ b/packages/core/test/tracing/otlp_mapper/mapper_test.js @@ -0,0 +1,342 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +const expect = require('chai').expect; +const { transform, getOtlpAttributeMappings } = require('../../../src/tracing/otlp_mapper/mapper'); + +describe('tracing/otlp_mapper', () => { + let span; + + describe('Dynamic Database Mappings', () => { + it('should transform PostgreSQL span using common database mappings', () => { + span = { + n: 'pg', + data: { + pg: { + stmt: 'SELECT * FROM users', + host: 'localhost', + port: 5432, + user: 'admin', + db: 'mydb' + } + } + }; + + const result = transform(span); + expect(result.data.pg['db.statement']).to.equal('SELECT * FROM users'); + expect(result.data.pg['net.peer.name']).to.equal('localhost'); + expect(result.data.pg['net.peer.port']).to.equal(5432); + expect(result.data.pg['db.user']).to.equal('admin'); + expect(result.data.pg['db.name']).to.equal('mydb'); + expect(result.data.pg).to.not.have.property('stmt'); + expect(result.data.pg).to.not.have.property('host'); + expect(result.data.pg).to.not.have.property('port'); + expect(result.data.pg).to.not.have.property('user'); + expect(result.data.pg).to.not.have.property('db'); + }); + + it('should transform MySQL span using common database mappings', () => { + span = { + n: 'pg', + data: { + mysql: { + stmt: 'INSERT INTO orders VALUES (1)', + host: 'db.example.com', + port: 3306, + user: 'root', + db: 'shop' + } + } + }; + + const result = transform(span); + + console.log(result); + // Note: MySQL uses same fields as PostgreSQL (stmt, host, port, user, db) + expect(result.data.mysql['db.statement']).to.equal('INSERT INTO orders VALUES (1)'); + expect(result.data.mysql['net.peer.name']).to.equal('db.example.com'); + expect(result.data.mysql['net.peer.port']).to.equal(3306); + expect(result.data.mysql['db.user']).to.equal('root'); + expect(result.data.mysql['db.name']).to.equal('shop'); + expect(result.data.mysql).to.not.have.property('stmt'); + expect(result.data.mysql).to.not.have.property('host'); + }); + + it('should transform MongoDB span using common database mappings', () => { + span = { + n: 'mongodb', + data: { + mongodb: { + command: 'find', + namespace: 'mydb.users', + collection: 'users', + host: 'mongo.local', + port: 27017 + } + } + }; + + const result = transform(span); + expect(result.data.mongodb['db.operation.name']).to.equal('find'); + expect(result.data.mongodb['db.namespace']).to.equal('mydb.users'); + expect(result.data.mongodb['db.collection.name']).to.equal('users'); + expect(result.data.mongodb['net.peer.name']).to.equal('mongo.local'); + expect(result.data.mongodb['net.peer.port']).to.equal(27017); + expect(result.data.mongodb).to.not.have.property('command'); + expect(result.data.mongodb).to.not.have.property('host'); + }); + + it('should transform Redis span using common database mappings', () => { + span = { + n: 'redis', + data: { + redis: { + command: 'GET', + connection: 'redis://localhost:6379' + } + } + }; + + const result = transform(span); + expect(result.data.redis['db.operation.name']).to.equal('GET'); + expect(result.data.redis['db.connection_string']).to.equal('redis://localhost:6379'); + expect(result.data.redis).to.not.have.property('command'); + expect(result.data.redis).to.not.have.property('connection'); + }); + + it('should handle unmapped database fields with section prefix', () => { + span = { + n: 'pg', + data: { + pg: { + stmt: 'SELECT 1', + custom_field: 'custom_value' + } + } + }; + + const result = transform(span); + expect(result.data.pg['db.statement']).to.equal('SELECT 1'); + expect(result.data.pg['pg.custom_field']).to.equal('custom_value'); + expect(result.data.pg).to.not.have.property('custom_field'); + }); + }); + + describe('HTTP Mappings', () => { + it('should transform HTTP span with specific HTTP mappings', () => { + span = { + n: 'node.http.server', + data: { + http: { + method: 'GET', + url: '/api/users', + host: 'localhost', + status: 200, + path: '/api/users', + protocol: 'HTTP/1.1' + } + } + }; + + const result = transform(span); + expect(result.data.http['http.request.method']).to.equal('GET'); + expect(result.data.http['url.full']).to.equal('/api/users'); + expect(result.data.http['server.address']).to.equal('localhost'); + expect(result.data.http['http.response.status_code']).to.equal(200); + expect(result.data.http['url.path']).to.equal('/api/users'); + expect(result.data.http['network.protocol.name']).to.equal('HTTP/1.1'); + }); + }); + + describe('Messaging Mappings', () => { + it('should transform Kafka span using messaging mappings', () => { + span = { + n: 'kafka', + data: { + kafka: { + service: 'my-topic', + access: 'produce' + } + } + }; + + const result = transform(span); + expect(result.data.kafka['messaging.destination.name']).to.equal('my-topic'); + expect(result.data.kafka['messaging.operation.type']).to.equal('produce'); + expect(result.data.kafka).to.not.have.property('service'); + expect(result.data.kafka).to.not.have.property('access'); + }); + }); + + describe('getOtlpAttributeMappings', () => { + it('should return mappings for all database types', () => { + const mappings = getOtlpAttributeMappings(); + + // Check that all database types have mappings + expect(mappings).to.have.property('pg'); + expect(mappings).to.have.property('mysql'); + expect(mappings).to.have.property('mongodb'); + expect(mappings).to.have.property('redis'); + expect(mappings).to.have.property('mssql'); + expect(mappings).to.have.property('couchbase'); + expect(mappings).to.have.property('elasticsearch'); + expect(mappings).to.have.property('dynamodb'); + expect(mappings).to.have.property('db2'); + expect(mappings).to.have.property('memcached'); + expect(mappings).to.have.property('mongoose'); + expect(mappings).to.have.property('prisma'); + + // Verify they all use the same database mappings + expect(mappings.pg).to.deep.equal(mappings.mysql); + expect(mappings.mysql).to.deep.equal(mappings.mongodb); + expect(mappings.redis).to.deep.equal(mappings.pg); + }); + + it('should return HTTP and messaging mappings', () => { + const mappings = getOtlpAttributeMappings(); + + expect(mappings).to.have.property('http'); + expect(mappings).to.have.property('kafka'); + expect(mappings.http).to.have.property('method'); + expect(mappings.kafka).to.have.property('service'); + }); + }); + + describe('HTTP OTLP Mappings (Integration with Backend Mapper)', () => { + it('should transform backend-mapped http span fields to OTLP http attributes', () => { + span = { + n: 'node.http.server', + data: { + http: { + method: 'GET', + url: '/api/users', + host: 'localhost', + status: 200 + } + } + }; + + const result = transform(span); + + // New OTel semantic conventions + expect(result.data.http['http.request.method']).to.equal('GET'); + expect(result.data.http['url.full']).to.equal('/api/users'); + expect(result.data.http['server.address']).to.equal('localhost'); + expect(result.data.http['http.response.status_code']).to.equal(200); + + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('host'); + expect(result.data.http).to.not.have.property('status'); + }); + + it('should keep unmapped backend http fields as section-prefixed OTLP attributes', () => { + span = { + n: 'node.http.server', + data: { + http: { + method: 'POST', + url: '/orders', + host: 'service.local', + custom_header: 'x-test' + } + } + }; + + const result = transform(span); + + // New OTel semantic conventions + expect(result.data.http['http.request.method']).to.equal('POST'); + expect(result.data.http['url.full']).to.equal('/orders'); + expect(result.data.http['server.address']).to.equal('service.local'); + expect(result.data.http['http.custom_header']).to.equal('x-test'); + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('host'); + expect(result.data.http).to.not.have.property('custom_header'); + }); + + it('should map additional HTTP fields according to OTel semantic conventions', () => { + span = { + n: 'node.http.client', + data: { + http: { + method: 'GET', + url: 'https://api.example.com/users?page=1', + path: '/users', + params: 'page=1', + protocol: 'HTTP/1.1', + path_tpl: '/users', + error: 'timeout' + } + } + }; + + const result = transform(span); + + // Verify all new mappings + expect(result.data.http['http.request.method']).to.equal('GET'); + expect(result.data.http['url.full']).to.equal('https://api.example.com/users?page=1'); + expect(result.data.http['url.path']).to.equal('/users'); + expect(result.data.http['url.query']).to.equal('page=1'); + expect(result.data.http['network.protocol.name']).to.equal('HTTP/1.1'); + expect(result.data.http['url.template']).to.equal('/users'); + expect(result.data.http['error.type']).to.equal('timeout'); + + // Verify old fields are removed + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('path'); + expect(result.data.http).to.not.have.property('params'); + expect(result.data.http).to.not.have.property('protocol'); + expect(result.data.http).to.not.have.property('path_tpl'); + expect(result.data.http).to.not.have.property('error'); + }); + }); + + describe('Edge Cases', () => { + it('should return span unchanged if data is null', () => { + span = { n: 'test', data: null }; + const result = transform(span); + expect(result).to.equal(span); + }); + + it('should return span unchanged if span is null', () => { + const result = transform(null); + expect(result).to.equal(null); + }); + + it('should skip non-object data sections', () => { + span = { + n: 'test', + data: { + pg: { stmt: 'SELECT 1' }, + stringField: 'value', + numberField: 123 + } + }; + + const result = transform(span); + expect(result.data.pg['db.statement']).to.equal('SELECT 1'); + expect(result.data.stringField).to.equal('value'); + expect(result.data.numberField).to.equal(123); + }); + + it('should handle spans with no matching mappings', () => { + span = { + n: 'custom', + data: { + custom: { field: 'value' } + } + }; + + const result = transform(span); + expect(result.data.custom.field).to.equal('value'); + }); + }); +}); + +// Made with Bob diff --git a/packages/core/test/tracing/spanBuffer_test.js b/packages/core/test/tracing/spanBuffer_test.js index ff7bbbdd44..26a1611d94 100644 --- a/packages/core/test/tracing/spanBuffer_test.js +++ b/packages/core/test/tracing/spanBuffer_test.js @@ -665,7 +665,7 @@ describe('tracing/spanBuffer', () => { const sentSpan = sentPayload.resourceSpans[0].scopeSpans[0].spans[0]; expect(sentSpan.traceId).to.have.lengthOf(32); - expect(sentSpan.name).to.equal('node.http.server'); + expect(sentSpan.name).to.equal('GET /orders'); expect(sentSpan.kind).to.equal(2); expect(sentSpan.attributes).to.deep.include.members([ { From d6c01a6945eaf40d207ca6a3a5d99a4a924ff32c Mon Sep 17 00:00:00 2001 From: Abhilash Date: Fri, 15 May 2026 11:26:43 +0530 Subject: [PATCH 18/23] chore: clean --- packages/core/src/tracing/backend_mappers/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/core/src/tracing/backend_mappers/index.js b/packages/core/src/tracing/backend_mappers/index.js index 33623d973e..940a974797 100644 --- a/packages/core/src/tracing/backend_mappers/index.js +++ b/packages/core/src/tracing/backend_mappers/index.js @@ -5,10 +5,14 @@ 'use strict'; const mapper = require('./mapper'); - -/** - * Backend mapper transforms - converts internal span fields to backend format - */ module.exports = { - transform: mapper.transform + get transform() { + return (/** @type {import('../../core').InstanaBaseSpan} */ span) => { + try { + return mapper.transform(span); + } catch (error) { + return span; + } + }; + } }; From efd41030914d8e7eb1402d05261da380fa5f4455 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Fri, 15 May 2026 11:43:15 +0530 Subject: [PATCH 19/23] chore: update --- .../core/src/tracing/backend_mappers/mapper.js | 1 - .../test/tracing/otlp_mapper/mapper_test.js | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/core/src/tracing/backend_mappers/mapper.js b/packages/core/src/tracing/backend_mappers/mapper.js index fa99277dc4..671c399090 100644 --- a/packages/core/src/tracing/backend_mappers/mapper.js +++ b/packages/core/src/tracing/backend_mappers/mapper.js @@ -50,7 +50,6 @@ module.exports.transform = span => { if (!span || !span.data) { return span; } - // In most cases, `span.n` matches the key inside `span.data` (e.g., `span.n === 'redis'` → `span.data.redis`). // However, there are exceptions where `span.n` represents a higher-level concept or protocol, // while `span.data` contains one or more lower-level components. diff --git a/packages/core/test/tracing/otlp_mapper/mapper_test.js b/packages/core/test/tracing/otlp_mapper/mapper_test.js index cd15e444bc..15bff7e526 100644 --- a/packages/core/test/tracing/otlp_mapper/mapper_test.js +++ b/packages/core/test/tracing/otlp_mapper/mapper_test.js @@ -40,7 +40,7 @@ describe('tracing/otlp_mapper', () => { it('should transform MySQL span using common database mappings', () => { span = { - n: 'pg', + n: 'mysql', data: { mysql: { stmt: 'INSERT INTO orders VALUES (1)', @@ -53,8 +53,6 @@ describe('tracing/otlp_mapper', () => { }; const result = transform(span); - - console.log(result); // Note: MySQL uses same fields as PostgreSQL (stmt, host, port, user, db) expect(result.data.mysql['db.statement']).to.equal('INSERT INTO orders VALUES (1)'); expect(result.data.mysql['net.peer.name']).to.equal('db.example.com'); @@ -63,6 +61,9 @@ describe('tracing/otlp_mapper', () => { expect(result.data.mysql['db.name']).to.equal('shop'); expect(result.data.mysql).to.not.have.property('stmt'); expect(result.data.mysql).to.not.have.property('host'); + expect(result.data.mysql).to.not.have.property('port'); + expect(result.data.mysql).to.not.have.property('user'); + expect(result.data.mysql).to.not.have.property('db'); }); it('should transform MongoDB span using common database mappings', () => { @@ -86,7 +87,10 @@ describe('tracing/otlp_mapper', () => { expect(result.data.mongodb['net.peer.name']).to.equal('mongo.local'); expect(result.data.mongodb['net.peer.port']).to.equal(27017); expect(result.data.mongodb).to.not.have.property('command'); + expect(result.data.mongodb).to.not.have.property('namespace'); + expect(result.data.mongodb).to.not.have.property('collection'); expect(result.data.mongodb).to.not.have.property('host'); + expect(result.data.mongodb).to.not.have.property('port'); }); it('should transform Redis span using common database mappings', () => { @@ -121,6 +125,7 @@ describe('tracing/otlp_mapper', () => { const result = transform(span); expect(result.data.pg['db.statement']).to.equal('SELECT 1'); expect(result.data.pg['pg.custom_field']).to.equal('custom_value'); + expect(result.data.pg).to.not.have.property('stmt'); expect(result.data.pg).to.not.have.property('custom_field'); }); }); @@ -148,6 +153,12 @@ describe('tracing/otlp_mapper', () => { expect(result.data.http['http.response.status_code']).to.equal(200); expect(result.data.http['url.path']).to.equal('/api/users'); expect(result.data.http['network.protocol.name']).to.equal('HTTP/1.1'); + expect(result.data.http).to.not.have.property('method'); + expect(result.data.http).to.not.have.property('url'); + expect(result.data.http).to.not.have.property('host'); + expect(result.data.http).to.not.have.property('status'); + expect(result.data.http).to.not.have.property('path'); + expect(result.data.http).to.not.have.property('protocol'); }); }); @@ -321,6 +332,7 @@ describe('tracing/otlp_mapper', () => { const result = transform(span); expect(result.data.pg['db.statement']).to.equal('SELECT 1'); + expect(result.data.pg).to.not.have.property('stmt'); expect(result.data.stringField).to.equal('value'); expect(result.data.numberField).to.equal(123); }); From b85ae666ca6579f9afc7fe2ed9c5e57e00c2079e Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 18 May 2026 12:55:13 +0530 Subject: [PATCH 20/23] chore: added readme --- OTLP_TRANSFORMATION_STEPS.md | 258 ++++++ .../src/tracing/OTLP_TRANSFORMATION_README.md | 742 ++++++++++++++++++ packages/core/src/tracing/otlpTransformer.js | 4 +- 3 files changed, 1002 insertions(+), 2 deletions(-) create mode 100644 OTLP_TRANSFORMATION_STEPS.md create mode 100644 packages/core/src/tracing/OTLP_TRANSFORMATION_README.md diff --git a/OTLP_TRANSFORMATION_STEPS.md b/OTLP_TRANSFORMATION_STEPS.md new file mode 100644 index 0000000000..e4024ce7d1 --- /dev/null +++ b/OTLP_TRANSFORMATION_STEPS.md @@ -0,0 +1,258 @@ +# OTLP Transformation - Step-by-Step Guide + +## Current Structure Analysis + +``` +Instana Span Creation + ↓ +Backend Mapper (mapper.js) + ↓ +Span Buffer (spanBuffer.js) + ↓ +[OTLP_FORMAT Check] + ↓ +OTLP Mapper (otlp_mapper/mapper.js) + ↓ +OTLP Transformer (otlpTransformer.js) + ↓ +Agent Connection (agentConnection.js) + ↓ +Backend (Port 4318) +``` + +--- + +## Step 1: Span Creation +**File**: Instrumentation modules (e.g., HTTP, Kafka, Database) + +**Input**: Application activity (HTTP request, DB query, etc.) + +**Output**: Instana span object +```javascript +{ + t: "trace-id", + s: "span-id", + p: "parent-id", + n: "node.http.server", + k: 1, + ts: 1234567890123, + d: 45, + ec: 0, + data: { + http: { + method: "GET", + url: "/api/users", + status: 200 + } + } +} +``` + +**Cleanup**: None needed - this is the entry point + +--- + +## Step 2: Backend Mapper +**File**: `packages/core/src/tracing/backend_mappers/mapper.js` + +**Purpose**: Normalize internal field names to backend field names + +**Transformation**: +```javascript +// Before +data.redis.operation = "GET" + +// After +data.redis.command = "GET" +``` + +**Cleanup**: +- ✅ Already clean +- ✅ Single responsibility +- ✅ Simple field mapping + +--- + +## Step 3: Span Buffer +**File**: `packages/core/src/tracing/spanBuffer.js` + +**Purpose**: Collect and batch spans before transmission + +**Key Logic** (line 461): +```javascript +const processedSpans = + process.env.INSTANA_OTLP_FORMAT === 'true' + ? otlpTransformer.transform(spansToSend) + : spansToSend; +``` + +**Cleanup**: +- ✅ Already clean +- ✅ Clear separation of concerns +- ✅ Simple format check + +--- + +## Step 4: OTLP Mapper (When OTLP_FORMAT=true) +**File**: `packages/core/src/tracing/otlp_mapper/mapper.js` + +**Purpose**: Map backend fields to OTLP semantic conventions + +**Transformation**: +```javascript +// Before +data.http.method = "GET" + +// After +data.http["http.request.method"] = "GET" +``` + +**Cleanup**: +- create a common json for attr and data and use this in mapper + +--- + +## Step 5: OTLP Transformer +**File**: `packages/core/src/tracing/otlpTransformer.js` + +**Purpose**: Transform complete span to OTLP format + +**Transformations**: +1. Group spans by resource +2. Convert timestamps (ms → nanoseconds) +3. Map span kinds (Instana → OTLP) +4. Generate span names +5. Create OTLP attributes +6. Build final OTLP structure + +**Output**: +```javascript +{ + resourceSpans: [{ + resource: { attributes: [...] }, + scopeSpans: [{ + scope: { name: "@instana/collector" }, + spans: [...] + }] + }] +} +``` + +**Cleanup**: +- remove redundancy +- mapper can deal with kind transformation etc + +--- + +## Step 6: Agent Connection +**File**: `packages/collector/src/agentConnection.js` + +**Purpose**: Send data to backend + +**Current Issues**: +- ❌ Hardcoded port 4318 (lines 499, 582) +- ❌ Duplicate functions: `sendData()` and `sendOtlpData()` +- ❌ No connection pooling + +**Cleanup Needed**: +1. Make OTLP port configurable +2. Merge duplicate send functions +3. Add connection pooling + +--- + +## Simple Test Steps + +### 1. Setup +```bash +cd example-apps/otel-exporter-test +npm install +``` + +### 2. Run with OTLP Format +```bash +INSTANA_OTLP_FORMAT=true OTEL_SERVICE_NAME=test-app npm start +``` + +### 3. Test Endpoints +```bash +# HTTP + HTTP Exit +curl http://localhost:3000/external-api + +# HTTP + Database Exit +curl http://localhost:3000/db + +# HTTP + Kafka Exit +curl -X POST http://localhost:3000/kafka -H "Content-Type: application/json" -d '{"test":"data"}' +``` + +### 4. Verify +- Check console for span output +- Verify OTLP format structure +- Confirm data sent to port 4318 + +--- + +## Quick Reference + +### Environment Variables +```bash +INSTANA_OTLP_FORMAT=true # Enable OTLP transformation +OTEL_SERVICE_NAME=my-service # Set service name (standard OpenTelemetry) +# OR +SERVICE_NAME=my-service # Set service name (legacy, still supported) +INSTANA_OTLP_PORT=4318 # (After cleanup) Configure OTLP port +``` + +### Key Files +``` +packages/core/src/tracing/ +├── backend_mappers/mapper.js # Step 2: Backend field mapping +├── otlp_mapper/mapper.js # Step 4: OTLP semantic mapping +├── otlpTransformer.js # Step 5: Full OTLP transformation +└── spanBuffer.js # Step 3: Buffering & format check + +packages/collector/src/ +├── agentConnection.js # Step 6: Network transmission +└── agent/opts.js # Configuration +``` + +### Trace Format at Each Step + +| Step | Format | Example Field | +|------|--------|---------------| +| 1. Creation | Instana Internal | `data.http.method` | +| 2. Backend Mapper | Instana Backend | `data.redis.command` | +| 3. Buffer | Same as Step 2 | - | +| 4. OTLP Mapper | Instana + OTLP | `data.http["http.request.method"]` | +| 5. OTLP Transform | Full OTLP | `attributes[{key, value}]` | +| 6. Transmission | OTLP JSON | `resourceSpans[...]` | + +--- + +## Summary + +**Current State**: ✅ Mostly clean, working implementation + +**Cleanup Needed**: +**Cleanup Needed**: + +1. Remove debug `console.log`s + +2. Create a common structure for: + + * attributes + * data + + and reuse this across all mappers. + + Cleanup can be done step-by-step: + + * first standardize `data` + * then standardize `attributes` + +3. Make OTLP port configurable + +4. Unify send functions + + * separate handling for OTLP and Instana if needed (optional) diff --git a/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md b/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md new file mode 100644 index 0000000000..7b7ce49907 --- /dev/null +++ b/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md @@ -0,0 +1,742 @@ +# OTLP Transformation Architecture + +## Overview + +This document describes the architecture and implementation of the OpenTelemetry Protocol (OTLP) transformation layer in the Instana Node.js collector. When `INSTANA_OTLP_FORMAT=true`, spans are transformed from Instana's internal format to OTLP format before transmission to the backend. + +--- + +## Architecture + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ Instrumentation Layer │ +│ (HTTP, Kafka, Database, etc.) │ +└────────────────────────┬────────────────────────────────────────┘ + │ Creates Instana Span + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Backend Mapper (mapper.js) │ +│ Maps internal fields → backend field names │ +│ Example: operation → command (for Redis) │ +└────────────────────────┬────────────────────────────────────────┘ + │ Instana Span (backend format) + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Span Buffer (spanBuffer.js) │ +│ Collects, batches, and manages span lifecycle │ +└────────────────────────┬────────────────────────────────────────┘ + │ Buffered Spans + ▼ + [OTLP_FORMAT Check] + │ + ┌───────────────┴───────────────┐ + │ true │ false + ▼ ▼ +┌─────────────────────┐ ┌──────────────────┐ +│ OTLP Mapper │ │ Send as-is │ +│ (otlp_mapper) │ │ (Instana fmt) │ +│ Backend → OTLP │ └──────────────────┘ +│ Semantic Conv. │ +└──────────┬──────────┘ + │ OTLP-mapped fields + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ OTLP Transformer (otlpTransformer.js) │ +│ │ +│ ┌──────────────────────────────────────────────────────────┐ │ +│ │ 1. Group spans by resource (PID + Host) │ │ +│ └──────────────────────────────────────────────────────────┘ │ +│ ┌──────────────────────────────────────────────────────────┐ │ +│ │ 2. Transform each span: │ │ +│ │ - Convert timestamps (ms → nanoseconds) │ │ +│ │ - Map span kind (Instana → OTLP) │ │ +│ │ - Generate span name │ │ +│ │ - Create OTLP attributes array │ │ +│ │ - Normalize trace ID (32-char hex) │ │ +│ │ - Set status based on error count │ │ +│ └──────────────────────────────────────────────────────────┘ │ +│ ┌──────────────────────────────────────────────────────────┐ │ +│ │ 3. Create resource attributes │ │ +│ │ - SDK info, service name, PID, hostname │ │ +│ └──────────────────────────────────────────────────────────┘ │ +│ ┌──────────────────────────────────────────────────────────┐ │ +│ │ 4. Build OTLP structure │ │ +│ │ - resourceSpans → scopeSpans → spans │ │ +│ └──────────────────────────────────────────────────────────┘ │ +└────────────────────────┬────────────────────────────────────────┘ + │ OTLP JSON + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Agent Connection (agentConnection.js) │ +│ POST /v1/traces to localhost:4318 │ +└─────────────────────────────────────────────────────────────────┘ +``` + +--- + +## Transformation Steps + +### Step 1: Trace Collection (Instana Span Format) + +**Input**: Raw Instana span from instrumentation + +```javascript +{ + t: "1234567890abcdef", // Trace ID + s: "span123", // Span ID + p: "parent456", // Parent Span ID (optional) + n: "node.http.server", // Span name/type + k: 1, // Kind (1=ENTRY, 2=EXIT, 3=INTERMEDIATE) + ts: 1234567890123, // Timestamp (milliseconds) + d: 45, // Duration (milliseconds) + ec: 0, // Error count + f: { // From (resource information) + e: "12345", // PID + h: "my-hostname" // Host ID + }, + data: { // Protocol-specific data + http: { + method: "GET", + url: "/api/users", + status: 200, + host: "example.com" + } + } +} +``` + +**Location**: Created by instrumentation modules (e.g., `packages/collector/src/tracing/instrumentation/protocols/http.js`) + +--- + +### Step 2: Backend Field Mapping + +**Purpose**: Normalize internal field names to backend-expected names + +**Transformation**: `packages/core/src/tracing/backend_mappers/mapper.js` + +```javascript +// Field mappings configuration +const fieldMappings = { + redis: { + operation: 'command' // operation → command + }, + kafka: { + operation: 'access', // operation → access + endpoints: 'service' // endpoints → service + }, + http: { + operation: 'method', // operation → method + endpoints: 'url', // endpoints → url + connection: 'host' // connection → host + } +}; + +// Example transformation +// Before: data.redis.operation = "GET" +// After: data.redis.command = "GET" +``` + +--- + +### Step 3: OTLP Semantic Convention Mapping + +**Purpose**: Map backend fields to OTLP semantic convention attributes + +**Transformation**: `packages/core/src/tracing/otlp_mapper/mapper.js` + +```javascript +// OTLP attribute mappings +const otlpAttributeMappings = { + http: { + method: 'http.request.method', + status: 'http.response.status_code', + url: 'url.full', + path: 'url.path', + host: 'server.address', + protocol: 'network.protocol.name' + }, + + // Database mappings (applies to pg, mysql, mongodb, redis, etc.) + database: { + stmt: 'db.statement', + command: 'db.operation.name', + host: 'net.peer.name', + port: 'net.peer.port', + user: 'db.user', + db: 'db.name', + table: 'db.sql.table' + }, + + // Messaging mappings (Kafka, etc.) + messaging: { + service: 'messaging.destination.name', + access: 'messaging.operation.type' + } +}; + +// Example transformation +// Before: data.http.method = "GET" +// After: data.http["http.request.method"] = "GET" +``` + +--- + +### Step 4: Transform Data Values + +**Location**: `packages/core/src/tracing/otlpTransformer.js` + +#### 4.1 Timestamp Conversion + +```javascript +// Convert milliseconds to nanoseconds (as string) +function msToNano(ms) { + return String(ms * 1000000); +} + +// Example: +// Input: ts = 1234567890123 (ms) +// Output: startTimeUnixNano = "1234567890123000000" (ns) +``` + +#### 4.2 Span Kind Mapping + +```javascript +// Instana → OTLP span kind mapping +function convertSpanKind(instanaKind, spanType, data) { + // Standard mappings + switch (instanaKind) { + case 1: return 2; // ENTRY → SERVER + case 2: return 3; // EXIT → CLIENT + case 3: return 1; // INTERMEDIATE → INTERNAL + default: return 0; // UNSPECIFIED + } + + // Special case: Kafka + if (spanType === 'kafka' && data.kafka) { + if (data.kafka.access === 'send') return 2; // PRODUCER + if (data.kafka.access === 'consume') return 3; // CONSUMER + } +} +``` + +#### 4.3 Trace ID Normalization + +```javascript +// Normalize to 32-character hex string +function normalizeTraceId(traceId) { + const normalized = String(traceId || '0'); + if (normalized.length === 32) return normalized; + if (normalized.length > 32) return normalized.slice(-32); + return normalized.padStart(32, '0'); +} + +// Example: +// Input: "1234567890abcdef" +// Output: "00000000000000001234567890abcdef" +``` + +#### 4.4 Span Name Generation + +```javascript +// Generate descriptive span names based on span type +const spanNameRules = { + 'node.http.server': { + template: data => `${data.method || 'HTTP'} ${data.path_tpl || data.url || '/'}` + }, + 'node.http.client': { + template: data => data.method || 'HTTP' + }, + 'postgres': { + template: data => { + const operation = (data.stmt || '').split(' ')[0] || 'query'; + const db = data.db || ''; + return `pg.query:${operation} ${db}`.trim(); + } + }, + 'kafka': { + template: data => `${data.access || 'process'} ${data.service || 'unknown'}` + } +}; + +// Examples: +// HTTP: "GET /api/users" +// Postgres: "pg.query:SELECT mydb" +// Kafka: "send my-topic" +``` + +#### 4.5 Status Determination + +```javascript +// Map error count to OTLP status +function createStatus(errorCount) { + if (errorCount > 0) { + return { code: 2 }; // ERROR + } + return { code: 1 }; // OK +} +``` + +--- + +### Step 5: Add Attributes + +**Location**: `packages/core/src/tracing/otlpTransformer.js` - `createAttributes()` + +#### 5.1 System Attributes + +Automatically added based on span type: + +```javascript +const systemAttributeRules = { + postgres: { + attributes: [ + { key: 'db.system', value: 'postgresql' } + ] + }, + kafka: { + attributes: [ + { key: 'messaging.system', value: 'kafka' } + ] + } +}; +``` + +#### 5.2 Data Attributes + +Transform span data to OTLP attribute format: + +```javascript +// Attribute value types +attributes.push({ + key: "http.request.method", + value: { stringValue: "GET" } +}); + +attributes.push({ + key: "http.response.status_code", + value: { intValue: 200 } +}); + +attributes.push({ + key: "feature.enabled", + value: { boolValue: true } +}); +``` + +#### 5.3 Complete Attributes Example + +```javascript +attributes: [ + // System attribute + { key: "db.system", value: { stringValue: "postgresql" } }, + + // Mapped attributes from span data + { key: "db.statement", value: { stringValue: "SELECT * FROM users" } }, + { key: "net.peer.name", value: { stringValue: "localhost" } }, + { key: "net.peer.port", value: { intValue: 5432 } }, + { key: "db.name", value: { stringValue: "mydb" } }, + + // Unmapped attributes (kept as-is with prefix) + { key: "pg.custom_field", value: { stringValue: "custom_value" } } +] +``` + +--- + +### Step 6: Transform Custom/Additional Attributes + +#### 6.1 Unmapped Fields + +Fields without explicit mappings are preserved with a prefix: + +```javascript +// If no mapping exists for a field +const otlpKey = mappings[field] || `${dataKey}.${field}`; + +// Example: +// data.http.custom_header → "http.custom_header" +``` + +#### 6.2 Complex Values + +Objects and arrays are JSON-stringified: + +```javascript +if (typeof value === 'object') { + attributes.push({ + key: otlpKey, + value: { stringValue: JSON.stringify(value) } + }); +} +``` + +#### 6.3 Adding New Mappings + +To add support for new span types or attributes: + +**Option 1: Update OTLP Mapper** (`otlp_mapper/mapper.js`) + +```javascript +// Add to otlpAttributeMappings +const otlpAttributeMappings = { + myNewProtocol: { + internalField: 'otel.semantic.convention.field', + anotherField: 'otel.another.field' + } +}; +``` + +**Option 2: Update System Attributes** (`otlpTransformer.js`) + +```javascript +// Add to systemAttributeRules +const systemAttributeRules = { + myNewProtocol: { + dataKey: 'myNewProtocol', + attributes: [ + { key: 'system.type', value: 'myNewProtocol' } + ] + } +}; +``` + +**Option 3: Update Span Name Rules** (`otlpTransformer.js`) + +```javascript +// Add to spanNameRules +const spanNameRules = { + 'myNewProtocol': { + dataKey: 'myNewProtocol', + template: data => `${data.operation} ${data.target}` + } +}; +``` + +--- + +### Step 7: Resource Attributes + +**Location**: `packages/core/src/tracing/otlpTransformer.js` - `createResourceAttributes()` + +```javascript +resource: { + attributes: [ + // SDK information + { + key: "telemetry.sdk.language", + value: { stringValue: "nodejs" } + }, + { + key: "telemetry.sdk.name", + value: { stringValue: "@instana/collector" } + }, + + // Service information + { + key: "service.name", + value: { stringValue: process.env.SERVICE_NAME } + }, + + // Process information + { + key: "process.pid", + value: { intValue: 12345 } + }, + + // Host information + { + key: "host.name", + value: { stringValue: "my-hostname" } + } + ] +} +``` + +--- + +### Step 8: Final OTLP Structure + +**Output**: Complete OTLP trace format + +```javascript +{ + resourceSpans: [ + { + resource: { + attributes: [ + { key: "telemetry.sdk.language", value: { stringValue: "nodejs" } }, + { key: "telemetry.sdk.name", value: { stringValue: "@instana/collector" } }, + { key: "service.name", value: { stringValue: "my-service" } }, + { key: "process.pid", value: { intValue: 12345 } }, + { key: "host.name", value: { stringValue: "my-hostname" } } + ] + }, + scopeSpans: [ + { + scope: { + name: "@instana/collector", + version: "1.0.0" + }, + spans: [ + { + traceId: "00000000000000001234567890abcdef", + spanId: "span123", + parentSpanId: "parent456", + name: "GET /api/users", + kind: 2, + startTimeUnixNano: "1234567890123000000", + endTimeUnixNano: "1234567890168000000", + attributes: [ + { key: "http.request.method", value: { stringValue: "GET" } }, + { key: "http.response.status_code", value: { intValue: 200 } }, + { key: "url.full", value: { stringValue: "/api/users" } }, + { key: "server.address", value: { stringValue: "example.com" } } + ], + status: { code: 1 } + } + ] + } + ] + } + ] +} +``` + +--- + +## Configuration Files + +### Mapping Configuration Approach + +The current implementation uses **code-based configuration** for mappings. For a JSON-based approach, consider: + +#### Proposed: `otlp-mappings.json` + +```json +{ + "spanKindMappings": { + "default": { + "1": 2, + "2": 3, + "3": 1 + }, + "kafka": { + "rules": [ + { "condition": "data.kafka.access === 'send'", "kind": 2 }, + { "condition": "data.kafka.access === 'consume'", "kind": 3 } + ] + } + }, + + "attributeMappings": { + "http": { + "method": "http.request.method", + "status": "http.response.status_code", + "url": "url.full", + "path": "url.path", + "host": "server.address" + }, + "database": { + "stmt": "db.statement", + "command": "db.operation.name", + "host": "net.peer.name", + "port": "net.peer.port" + } + }, + + "systemAttributes": { + "postgres": [ + { "key": "db.system", "value": "postgresql" } + ], + "kafka": [ + { "key": "messaging.system", "value": "kafka" } + ] + }, + + "spanNameTemplates": { + "node.http.server": "{method} {path_tpl|url|/}", + "postgres": "pg.query:{stmt[0]} {db}", + "kafka": "{access} {service}" + } +} +``` + +#### Proposed: `backend-mappings.json` + +```json +{ + "fieldMappings": { + "redis": { + "operation": "command" + }, + "kafka": { + "operation": "access", + "endpoints": "service" + }, + "http": { + "operation": "method", + "endpoints": "url", + "connection": "host" + } + } +} +``` + +--- + +## Usage + +### Enable OTLP Format + +```bash +export INSTANA_OTLP_FORMAT=true +export SERVICE_NAME=my-service +node app.js +``` + +### Verify Transformation + +Check logs for OTLP structure: +```javascript +// In otlpTransformer.js (line 379) +console.log('-----------------', JSON.stringify(otelSpans)); +``` + +### Backend Endpoint + +Spans are sent to: +- **Host**: `localhost` (configurable via `agentOpts.host`) +- **Port**: `4318` (OTLP standard port) +- **Path**: `/v1/traces` +- **Method**: `POST` +- **Content-Type**: `application/json; charset=UTF-8` + +--- + +## Testing + +### Unit Tests + +```bash +# Test OTLP mapper +npm test packages/core/test/tracing/otlp_mapper/mapper_test.js + +# Test backend mapper +npm test packages/core/test/tracing/backend_mappers/mapper_test.js + +# Test span buffer +npm test packages/core/test/tracing/spanBuffer_test.js +``` + +### Integration Test + +```bash +# Run example app with OTLP format +cd example-apps/otel-exporter-test +INSTANA_OTLP_FORMAT=true npm start +``` + +--- + +## Extending the Transformation + +### Adding a New Protocol + +1. **Add Backend Mapping** (`backend_mappers/mapper.js`): +```javascript +const fieldMappings = { + myProtocol: { + internalField: 'backendField' + } +}; +``` + +2. **Add OTLP Mapping** (`otlp_mapper/mapper.js`): +```javascript +const otlpAttributeMappings = { + myProtocol: { + backendField: 'otel.semantic.field' + } +}; +``` + +3. **Add System Attributes** (`otlpTransformer.js`): +```javascript +const systemAttributeRules = { + myProtocol: { + dataKey: 'myProtocol', + attributes: [ + { key: 'system.type', value: 'myProtocol' } + ] + } +}; +``` + +4. **Add Span Name Rule** (`otlpTransformer.js`): +```javascript +const spanNameRules = { + 'myProtocol': { + dataKey: 'myProtocol', + template: data => `${data.operation} ${data.target}` + } +}; +``` + +--- + +## References + +- [OpenTelemetry Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/) +- [OTLP Specification](https://opentelemetry.io/docs/specs/otlp/) +- [HTTP Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/http/) +- [Database Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/database/) +- [Messaging Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/messaging/) + +--- + +## Troubleshooting + +### Spans Not Transforming + +1. Check environment variable: `echo $INSTANA_OTLP_FORMAT` +2. Verify check in `spanBuffer.js` line 461 +3. Check logs for transformation errors + +### Missing Attributes + +1. Verify mapping exists in `otlp_mapper/mapper.js` +2. Check if field was mapped in `backend_mappers/mapper.js` +3. Unmapped fields are preserved with prefix + +### Incorrect Span Names + +1. Check `spanNameRules` in `otlpTransformer.js` +2. Add custom rule for your span type +3. Default: uses span type (`span.n`) + +### Backend Connection Issues + +1. Verify OTLP collector is running on port 4318 +2. Check `agentOpts.host` configuration +3. Review `agentConnection.js` sendData function + +--- + +## Performance Considerations + +- **Batching**: Spans are batched before transformation (configurable) +- **Memory**: Buffer size limited by `maxBufferedSpans` config +- **CPU**: Transformation is synchronous but optimized +- **Network**: Single HTTP request per batch + +--- + +## Future Improvements + +1. **JSON Configuration**: Move mappings to external JSON files +2. **Dynamic Rules**: Support runtime rule updates +3. **Compression**: Add gzip compression for large payloads +4. **Metrics**: Add transformation metrics (duration, errors) +5. **Validation**: Add OTLP schema validation \ No newline at end of file diff --git a/packages/core/src/tracing/otlpTransformer.js b/packages/core/src/tracing/otlpTransformer.js index b5cfdab065..fde8d66856 100644 --- a/packages/core/src/tracing/otlpTransformer.js +++ b/packages/core/src/tracing/otlpTransformer.js @@ -182,8 +182,8 @@ function createResourceAttributes(from) { value: { stringValue: '@instana/collector' } }); - // Service Name - use process.title or a default - const serviceName = process.env.SERVICE_NAME; + // Service Name - support both OTEL_SERVICE_NAME (standard) and SERVICE_NAME (legacy) + const serviceName = process.env.OTEL_SERVICE_NAME || process.env.SERVICE_NAME || 'unknown-service'; attributes.push({ key: 'service.name', value: { stringValue: serviceName } From b5a51c88f256e012e5d97ae60593a84b3dcc7f35 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 18 May 2026 12:55:24 +0530 Subject: [PATCH 21/23] chore: added example --- example-apps/otel-exporter-test/.gitignore | 4 + example-apps/otel-exporter-test/README.md | 240 ++ example-apps/otel-exporter-test/app.js | 109 + example-apps/otel-exporter-test/kafka.js | 94 + .../otel-exporter-test/package-lock.json | 3457 +++++++++++++++++ example-apps/otel-exporter-test/package.json | 40 + example-apps/otel-exporter-test/tracing.js | 101 + 7 files changed, 4045 insertions(+) create mode 100644 example-apps/otel-exporter-test/.gitignore create mode 100644 example-apps/otel-exporter-test/README.md create mode 100644 example-apps/otel-exporter-test/app.js create mode 100644 example-apps/otel-exporter-test/kafka.js create mode 100644 example-apps/otel-exporter-test/package-lock.json create mode 100644 example-apps/otel-exporter-test/package.json create mode 100644 example-apps/otel-exporter-test/tracing.js diff --git a/example-apps/otel-exporter-test/.gitignore b/example-apps/otel-exporter-test/.gitignore new file mode 100644 index 0000000000..3582051374 --- /dev/null +++ b/example-apps/otel-exporter-test/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +data.txt +npm-debug.log +.DS_Store \ No newline at end of file diff --git a/example-apps/otel-exporter-test/README.md b/example-apps/otel-exporter-test/README.md new file mode 100644 index 0000000000..01378bae61 --- /dev/null +++ b/example-apps/otel-exporter-test/README.md @@ -0,0 +1,240 @@ +# OpenTelemetry Exporter Test App + +A comprehensive Express.js application for testing OpenTelemetry tracing with Instana backend, including HTTP, PostgreSQL, and Kafka instrumentation. + +## Features + +- **HTTP tracing**: Express.js REST API with external HTTP calls +- **PostgreSQL tracing**: Database queries with pg driver +- **Kafka tracing**: Message producer and consumer +- **OpenTelemetry auto-instrumentation**: Automatic tracing for all operations +- **OTLP HTTP exporter**: Configured for Instana backend +- **Debug logging**: Console output for spans + +## Prerequisites + +1. **PostgreSQL** running on `localhost:5432` + - Database: `nodedb` + - User: `node` + - Password: `nodepw` + +2. **Kafka** running on `localhost:9092` + - Topic: `test-topic` (will be created automatically) + +3. **Instana** account with OTLP endpoint access + +## Setup + +### 1. Install Dependencies + +```bash +npm install +``` + +### 2. Configure PostgreSQL + +```bash +# Create database and user +psql -U postgres +CREATE DATABASE nodedb; +CREATE USER node WITH PASSWORD 'nodepw'; +GRANT ALL PRIVILEGES ON DATABASE nodedb TO node; +``` + +### 3. Configure Kafka + +Make sure Kafka is running on `localhost:9092`. If using Docker: + +```bash +docker run -d --name kafka \ + -p 9092:9092 \ + -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 \ + -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \ + confluentinc/cp-kafka:latest +``` + +### 4. Update Instana Configuration + +Edit `tracing.js` and update: +- `url`: Your Instana OTLP endpoint +- `x-instana-key`: Your Instana API key + +### 5. Start the Application + +```bash +npm start +``` + +Or for development with auto-reload: + +```bash +npm run dev +``` + +## API Endpoints + +### 1. HTTP Entry + HTTP Exit + +Tests HTTP client instrumentation with external API call. + +```bash +curl http://localhost:3000/external-api +``` + +**Expected trace:** +- HTTP server span (Express) +- HTTP client span (fetch to jsonplaceholder.typicode.com) + +### 2. HTTP Entry + PostgreSQL Exit + +Tests PostgreSQL database instrumentation. + +```bash +curl http://localhost:3000/db +``` + +**Expected trace:** +- HTTP server span (Express) +- PostgreSQL query span + +### 3. HTTP Entry + Kafka Exit + +Tests Kafka producer instrumentation. + +```bash +curl -X POST http://localhost:3000/kafka \ + -H "Content-Type: application/json" \ + -d '{"message":"Hello from OpenTelemetry!"}' +``` + +**Expected trace:** +- HTTP server span (Express) +- Kafka producer span +- Kafka consumer span (async, separate trace) + +## Tracing Details + +The application automatically traces: + +### HTTP Operations +- Express route handlers +- Outgoing HTTP requests (fetch/axios) +- Request/response details + +### PostgreSQL Operations +- SQL queries +- Connection details +- Query parameters + +### Kafka Operations +- Message production +- Message consumption +- Topic and partition information +- Custom attributes via hooks + +## Viewing Traces + +1. Make requests to the API endpoints +2. Check console output for span details +3. View traces in your Instana dashboard + +## Troubleshooting + +### PostgreSQL Connection Issues + +```bash +# Check if PostgreSQL is running +pg_isready -h localhost -p 5432 + +# Test connection +psql -h localhost -U node -d nodedb +``` + +### Kafka Connection Issues + +```bash +# Check if Kafka is running +nc -zv localhost 9092 + +# List topics +kafka-topics --list --bootstrap-server localhost:9092 +``` + +### OpenTelemetry Issues + +- Check console output for initialization messages +- Verify OTLP endpoint is accessible +- Ensure API key is correct +- Set log level to `DiagLogLevel.DEBUG` in `tracing.js` for more details + +## Configuration + +### Disable Console Exporter + +In `tracing.js`, comment out: + +```javascript +// provider.addSpanProcessor(new SimpleSpanProcessor(consoleExporter)); +``` + +### Change Service Name + +In `tracing.js`, update: + +```javascript +[SemanticResourceAttributes.SERVICE_NAME]: 'your-service-name' +``` + +### Disable Specific Instrumentations + +In `tracing.js`, modify the `getNodeAutoInstrumentations` options: + +```javascript +getNodeAutoInstrumentations({ + '@opentelemetry/instrumentation-fs': { enabled: false }, + '@opentelemetry/instrumentation-dns': { enabled: false } +}) +``` + +## Docker Setup (Optional) + +For running PostgreSQL and Kafka in Docker: + +```bash +# PostgreSQL +docker run -d --name postgres \ + -e POSTGRES_USER=node \ + -e POSTGRES_PASSWORD=nodepw \ + -e POSTGRES_DB=nodedb \ + -p 5432:5432 \ + postgres:15 + +# Kafka (requires Zookeeper) +docker-compose up -d +``` + +Create a `docker-compose.yml`: + +```yaml +version: '3' +services: + zookeeper: + image: confluentinc/cp-zookeeper:latest + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + + kafka: + image: confluentinc/cp-kafka:latest + depends_on: + - zookeeper + ports: + - "9092:9092" + environment: + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 +``` + +## License + +MIT \ No newline at end of file diff --git a/example-apps/otel-exporter-test/app.js b/example-apps/otel-exporter-test/app.js new file mode 100644 index 0000000000..9aa9faa7d0 --- /dev/null +++ b/example-apps/otel-exporter-test/app.js @@ -0,0 +1,109 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +// Load Instana collector from local repository +require('@instana/collector')(); + +const express = require('express'); +const { Pool } = require('pg'); +const { sendKafkaMessage, startKafkaConsumer } = require('./kafka'); + +const app = express(); +app.use(express.json()); + +const PORT = 3000; + +const pool = new Pool({ + host: 'localhost', + port: 5432, + user: 'node', + password: 'nodepw', + database: 'nodedb' +}); + +// --------------------------------------------------- +// 1. HTTP ENTRY + HTTP EXIT +// --------------------------------------------------- + +app.get('/external-api', async (req, res) => { + try { + const response = await fetch('https://jsonplaceholder.typicode.com/todos/1'); + const data = await response.json(); + + res.json({ + success: true, + data + }); + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + + res.status(500).json({ + error: err.message + }); + } +}); + +// --------------------------------------------------- +// 2. HTTP ENTRY + PG EXIT +// --------------------------------------------------- + +app.get('/db', async (req, res) => { + try { + const result = await pool.query('SELECT NOW() as current_time'); + + res.json({ + success: true, + rows: result.rows + }); + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + + res.status(500).json({ + error: err.message + }); + } +}); + +// --------------------------------------------------- +// 3. HTTP ENTRY + KAFKA EXIT +// --------------------------------------------------- + +app.post('/kafka', async (req, res) => { + try { + const payload = req.body || { + hello: 'world' + }; + + await sendKafkaMessage(payload); + + res.json({ + success: true, + sent: payload + }); + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + + res.status(500).json({ + error: err.message + }); + } +}); + +// --------------------------------------------------- +// START +// --------------------------------------------------- + +app.listen(PORT, async () => { + // eslint-disable-next-line no-console + console.log(`Server running on port ${PORT}`); + + await startKafkaConsumer(); +}); + +// Made with Bob diff --git a/example-apps/otel-exporter-test/kafka.js b/example-apps/otel-exporter-test/kafka.js new file mode 100644 index 0000000000..04248a3cf4 --- /dev/null +++ b/example-apps/otel-exporter-test/kafka.js @@ -0,0 +1,94 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +const { Kafka } = require('kafkajs'); + +const kafka = new Kafka({ + clientId: 'otel-node-app', + // HOST MACHINE: + brokers: ['localhost:9092'] + // DOCKER: + // brokers: ['kafka:29092'], +}); + +const producer = kafka.producer(); +const consumer = kafka.consumer({ + groupId: 'otel-group' +}); + +const TOPIC = 'test-topic'; + +let producerConnected = false; +let consumerStarted = false; + +async function connectProducer() { + if (!producerConnected) { + await producer.connect(); + producerConnected = true; + // eslint-disable-next-line no-console + console.log('Kafka producer connected'); + } +} + +async function sendKafkaMessage(message) { + await connectProducer(); + + await producer.send({ + topic: TOPIC, + messages: [ + { + key: 'sample-key', + value: JSON.stringify(message) + } + ] + }); + + // eslint-disable-next-line no-console + console.log('Kafka message sent'); +} + +async function startKafkaConsumer() { + if (consumerStarted) { + return; + } + + await consumer.connect(); + + await consumer.subscribe({ + topic: TOPIC, + fromBeginning: true + }); + + await consumer.run({ + eachMessage: async ({ topic, partition, message }) => { + const value = message.value?.toString(); + + // eslint-disable-next-line no-console + console.log('--------------------------------'); + // eslint-disable-next-line no-console + console.log('Kafka message received'); + // eslint-disable-next-line no-console + console.log('Topic:', topic); + // eslint-disable-next-line no-console + console.log('Partition:', partition); + // eslint-disable-next-line no-console + console.log('Value:', value); + // eslint-disable-next-line no-console + console.log('--------------------------------'); + } + }); + + consumerStarted = true; + // eslint-disable-next-line no-console + console.log('Kafka consumer started'); +} + +module.exports = { + sendKafkaMessage, + startKafkaConsumer +}; + +// Made with Bob diff --git a/example-apps/otel-exporter-test/package-lock.json b/example-apps/otel-exporter-test/package-lock.json new file mode 100644 index 0000000000..0313869184 --- /dev/null +++ b/example-apps/otel-exporter-test/package-lock.json @@ -0,0 +1,3457 @@ +{ + "name": "otel-exporter-test", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "otel-exporter-test", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@instana/collector": "file:../../packages/collector", + "@opentelemetry/api": "latest", + "@opentelemetry/auto-instrumentations-node": "latest", + "@opentelemetry/exporter-trace-otlp-http": "latest", + "@opentelemetry/instrumentation": "latest", + "@opentelemetry/instrumentation-express": "latest", + "@opentelemetry/instrumentation-http": "latest", + "@opentelemetry/instrumentation-kafkajs": "latest", + "@opentelemetry/instrumentation-pg": "latest", + "@opentelemetry/resources": "latest", + "@opentelemetry/sdk-trace-base": "latest", + "@opentelemetry/sdk-trace-node": "latest", + "@opentelemetry/semantic-conventions": "latest", + "express": "^4.18.2", + "kafkajs": "^2.2.4", + "pg": "^8.11.0" + }, + "devDependencies": { + "nodemon": "^2.0.22" + } + }, + "../../packages/collector": { + "name": "@instana/collector", + "version": "5.4.1", + "license": "MIT", + "dependencies": { + "@instana/core": "5.4.1", + "@instana/shared-metrics": "5.4.1", + "pino": "^9.13.0", + "semver": "^7.7.4", + "serialize-error": "^8.1.0" + }, + "bin": { + "instana-instrument-edgemicro-cli": "src/bin/instrument-edgemicro-cli.js" + }, + "engines": { + "node": ">=18.19.0" + }, + "optionalDependencies": { + "@instana/autoprofile": "5.4.1" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.3.tgz", + "integrity": "sha512-Iq8QQQ/7X3Sac15oB6p0FmUg/klxQvXLeileoqrTRGJYLV+/9tubbr9ipz0GKHjmXVsgFPo/+W+2cA8eNcR+XA==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz", + "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@instana/collector": { + "resolved": "../../packages/collector", + "link": true + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.1.tgz", + "integrity": "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.218.0.tgz", + "integrity": "sha512-fmEWp5kXlGEc3i/lR698Hz41DfGyN4Tbe4g7L1AxSc7fF8Xeh/FQ9Quqpa9dVA413Q1Ad43QOLzU4JoXgbFPWw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/auto-instrumentations-node": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/auto-instrumentations-node/-/auto-instrumentations-node-0.76.0.tgz", + "integrity": "sha512-44KWgqsMuqfV4UhOcwwnDeK8CpB5LT1MmpZj6sKXFXu2q6rjKo622pWgOgn5Ntp5Qal9q1uBX2VS8mvTpsMeyw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/instrumentation-amqplib": "^0.65.0", + "@opentelemetry/instrumentation-aws-lambda": "^0.70.0", + "@opentelemetry/instrumentation-aws-sdk": "^0.73.0", + "@opentelemetry/instrumentation-bunyan": "^0.63.0", + "@opentelemetry/instrumentation-cassandra-driver": "^0.63.0", + "@opentelemetry/instrumentation-connect": "^0.61.0", + "@opentelemetry/instrumentation-cucumber": "^0.34.0", + "@opentelemetry/instrumentation-dataloader": "^0.35.0", + "@opentelemetry/instrumentation-dns": "^0.61.0", + "@opentelemetry/instrumentation-express": "^0.66.0", + "@opentelemetry/instrumentation-fs": "^0.37.0", + "@opentelemetry/instrumentation-generic-pool": "^0.61.0", + "@opentelemetry/instrumentation-graphql": "^0.66.0", + "@opentelemetry/instrumentation-grpc": "^0.218.0", + "@opentelemetry/instrumentation-hapi": "^0.64.0", + "@opentelemetry/instrumentation-http": "^0.218.0", + "@opentelemetry/instrumentation-ioredis": "^0.66.0", + "@opentelemetry/instrumentation-kafkajs": "^0.27.0", + "@opentelemetry/instrumentation-knex": "^0.62.0", + "@opentelemetry/instrumentation-koa": "^0.66.0", + "@opentelemetry/instrumentation-lru-memoizer": "^0.62.0", + "@opentelemetry/instrumentation-memcached": "^0.61.0", + "@opentelemetry/instrumentation-mongodb": "^0.71.0", + "@opentelemetry/instrumentation-mongoose": "^0.64.0", + "@opentelemetry/instrumentation-mysql": "^0.64.0", + "@opentelemetry/instrumentation-mysql2": "^0.64.0", + "@opentelemetry/instrumentation-nestjs-core": "^0.64.0", + "@opentelemetry/instrumentation-net": "^0.62.0", + "@opentelemetry/instrumentation-openai": "^0.16.0", + "@opentelemetry/instrumentation-oracledb": "^0.43.0", + "@opentelemetry/instrumentation-pg": "^0.70.0", + "@opentelemetry/instrumentation-pino": "^0.64.0", + "@opentelemetry/instrumentation-redis": "^0.66.0", + "@opentelemetry/instrumentation-restify": "^0.63.0", + "@opentelemetry/instrumentation-router": "^0.62.0", + "@opentelemetry/instrumentation-runtime-node": "^0.31.0", + "@opentelemetry/instrumentation-socket.io": "^0.65.0", + "@opentelemetry/instrumentation-tedious": "^0.37.0", + "@opentelemetry/instrumentation-undici": "^0.28.0", + "@opentelemetry/instrumentation-winston": "^0.62.0", + "@opentelemetry/resource-detector-alibaba-cloud": "^0.33.8", + "@opentelemetry/resource-detector-aws": "^2.18.0", + "@opentelemetry/resource-detector-azure": "^0.26.0", + "@opentelemetry/resource-detector-container": "^0.8.9", + "@opentelemetry/resource-detector-gcp": "^0.53.0", + "@opentelemetry/resources": "^2.0.0", + "@opentelemetry/sdk-node": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.4.1", + "@opentelemetry/core": "^2.0.0" + } + }, + "node_modules/@opentelemetry/configuration": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/configuration/-/configuration-0.218.0.tgz", + "integrity": "sha512-W8wIz7H2R1pufR5jfjb3gU2XkMpm2x/7b1RJcsuzvd70Il/rWWE+g5/Od7hQKrxRTSrTrOWlru101PWXz5I1EQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "yaml": "^2.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0" + } + }, + "node_modules/@opentelemetry/context-async-hooks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.7.1.tgz", + "integrity": "sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.7.1.tgz", + "integrity": "sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-logs-otlp-grpc": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-grpc/-/exporter-logs-otlp-grpc-0.218.0.tgz", + "integrity": "sha512-hoxrNH1l/Xy6F9WTJ5IK+6j1r9nQFlPOmrnTlhYHTySdunfXLmUCPv3bQtKYntxag9h3wLYBZQ2HI6FOx+BT2g==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/grpc-js": "^1.14.3", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/sdk-logs": "0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-logs-otlp-http": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.218.0.tgz", + "integrity": "sha512-Qx+4rpVHzgg89dawcWRHyt+XRXeLnhFz/qBtvggmjkcgPUdr+NAB0/u/eIPA8yAeJV0J80Vz43JZCh/XFvZFGw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/sdk-logs": "0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-logs-otlp-proto": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-proto/-/exporter-logs-otlp-proto-0.218.0.tgz", + "integrity": "sha512-1/noQNsp9gXD75HPzgjBrcF1+XTtry7pFAUfxVEJgg7mPv2AawKQuYkhMmJ8qjxz4Ubc3Y8bwvfxevXsKTq4cg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-logs": "0.218.0", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-grpc": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc/-/exporter-metrics-otlp-grpc-0.218.0.tgz", + "integrity": "sha512-YapQ9vNMX0NSZF6LK5pWAFfjpJleV2O9uYWfYGeb/5F1Kb9rPGK8tZDMJFa/sOksgdFuflDvYuA0B4qjDB4fjQ==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/grpc-js": "^1.14.3", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/exporter-metrics-otlp-http": "0.218.0", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-metrics": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-http": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.218.0.tgz", + "integrity": "sha512-bV7d2OuMpZu2+gAaxUAhzfZ0h3WVZk8ETQUEE3DNSntbTaMpuITjtm8I0rNyHFdm7Ax57K6ty7SgFXlBmOLIvQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-metrics": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-proto": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-proto/-/exporter-metrics-otlp-proto-0.218.0.tgz", + "integrity": "sha512-ubLddKjWULhla9YZRCj/rTBeppjJYE4e9w0icx5mTu3eFhWjQzbV75NYjXuIlEG+NJsBl6d+sTFw5Qu+oej4oQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/exporter-metrics-otlp-http": "0.218.0", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-metrics": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-prometheus": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.218.0.tgz", + "integrity": "sha512-RT5oEyu1kddZJ1vt7/BUo5wV+P7hpNAESsR3dUd3+8deHuX7gWNoCOZn+SfDT+hJHlIJ5h/AxiCLXIrutswDJg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-metrics": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-grpc": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.218.0.tgz", + "integrity": "sha512-3fXxVQEj9TNAFaCi79JeFKfeLd0sDtInaR3gaZDVlzNSPHtz8PZuCV34JKWjD4XXzT20IdMe8IpX6mRVNDA4Tw==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/grpc-js": "^1.14.3", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.218.0.tgz", + "integrity": "sha512-8dqezsmPhtKitIK/eTipZhYl9EX2/gNQ5zUMhaz3uxEURwfkNf8IPvo6yNfrzbxdtpAOybS/+h7wmIWYqFSpiw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.218.0.tgz", + "integrity": "sha512-r1Msf8SNLRmwh9J6XQ5uh82D7CdDWMNHnPB7LAVHjzut0TkSeKc5KcIvr4SvHvfk/xwN5gxC+VLKQ1k0o8PSPw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-zipkin": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-2.7.1.tgz", + "integrity": "sha512-mfsD9bKAxcKrh5+y08TPodvClBO0CznBE3p79YAGnO81WI4LrdsGA65T53e4iTSbCalW4WaUpkbeJcbpyIUHfg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/instrumentation": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.218.0.tgz", + "integrity": "sha512-mIZil8Es+sYDK5m+DQiwAwF57F14TF2YlEqvIjZ/RQWcxDBwRGsKfdK2Tv65OU9meQKCMzSIFS9mxAcnAb6Bkg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "import-in-the-middle": "^3.0.0", + "require-in-the-middle": "^8.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-amqplib": { + "version": "0.65.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.65.0.tgz", + "integrity": "sha512-fF7fNHA59n3y23ROfst2EbSxmP+L3E+snZO6aMU4w4xD84mfejAivspIAsqa9arX5HZlBK6dslHz5dWGNp5D0A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-aws-lambda": { + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-aws-lambda/-/instrumentation-aws-lambda-0.70.0.tgz", + "integrity": "sha512-HT74cQxi/iiVEz5dRdNdfGCFzPFbkxSiwHfFPHDwkRcr1JKQqI6hm8qeXEvEiJ+36xIU1KkQMDfeThJ1ifnUiA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@types/aws-lambda": "^8.10.155" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-aws-sdk": { + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-aws-sdk/-/instrumentation-aws-sdk-0.73.0.tgz", + "integrity": "sha512-0INPkHbR6o4J3psE+ncwWaE7qtDpb2p+i+qfV82cfwYLCXavYCGosBZ/S4pOErDVJYIyQVIsNAHhaUgaL313SQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.34.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-bunyan": { + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-bunyan/-/instrumentation-bunyan-0.63.0.tgz", + "integrity": "sha512-z0xPSZ62d3I7sG2sUTyQ5/ES1RdESP2eOETiMLY9gPSp+HZwbsAyj7T/2sdZKYD+O2ajRHZEil+DBoUolf1ocQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.218.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@types/bunyan": "1.8.11" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-cassandra-driver": { + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-cassandra-driver/-/instrumentation-cassandra-driver-0.63.0.tgz", + "integrity": "sha512-jnVTOr3h/46UDalEwJ4ITux8UWwHmnsOik5WFs3JB/UrUj8Wad5eI+KpOEBuOUeOfPB9sce11qgVw3WXU2r+hg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.37.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.61.0.tgz", + "integrity": "sha512-ZTQ0W3Lb7GJsOd+72cG8FJQKA5DqYfELJGLmChrJIezRSLfJIfofwKEGLX5rMtFJmwckpichQkBZWjid5dvnVQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@types/connect": "3.4.38" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-cucumber": { + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-cucumber/-/instrumentation-cucumber-0.34.0.tgz", + "integrity": "sha512-VK63Cm8osAdsSZpULPk+qnNktQUJzmnIOv2wuh79fV41WuTM38uOFC3s978/24pDkSljhN4EYCbPRLrAhXfKSA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/instrumentation-dataloader": { + "version": "0.35.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.35.0.tgz", + "integrity": "sha512-6x6UPP0tLzrdj15PIEN3qgp/WCcESCavHJfkIKoyLmy4UjGLF1KgEUMyD74xhbKGo426uvMbhvCgZC0ye8nO/A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-dns": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dns/-/instrumentation-dns-0.61.0.tgz", + "integrity": "sha512-5D8xFaw9GXq9ZIOAvG7NPDivFfZWFAekLGFn1B7ppyhuAYBVHGybFpx4Q9BV1Uup3yzCdiD78KhyH7c3dKOYSw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.66.0.tgz", + "integrity": "sha512-G1xTh5M5shklMgIyUXWDjU2BakulKtcISaM4U5TyanvO7R4xbB3iC7YQ8QKegLXaOs81Ku8RlcIcbYRrz/82wQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fs": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.37.0.tgz", + "integrity": "sha512-5mxhFuwAK0FFvisUdvuywaZ9ySMZ15HfbN6IpLn0gwRh9s1/QBcpLznQ/A15cZs1QFtBJ+JXIHdwY7WOD0c4Eg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.61.0.tgz", + "integrity": "sha512-tvp5PWnGRPHY/kz9Kg1IRLBL0qUAxMSNG623f+ZGEsvnCVEjr3tFyw1JGQzM+B3eZKkO+Dp/LYrtOSfb69D5lA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.66.0.tgz", + "integrity": "sha512-D4PN1tStj6rnOdofnt2xINJjtT1k2ockzaODrn76VEBZeqJ3QsEvKFfunB0EFAohO4xswVp14VAVmKNnGzA1Dw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-grpc": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-grpc/-/instrumentation-grpc-0.218.0.tgz", + "integrity": "sha512-kcDCNrC7IWNXEKQriGrwuh5jjbMFU5exOQzU9ufEY9UkACNcgYIdOd7XpX3IqZ3UPSnZyZtlwgfsbC5SNlEDbA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "0.218.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.64.0.tgz", + "integrity": "sha512-PCHgCICCDz7p9BgCU9gQz2smbqu4V4P8QtWJ7DLjL3bmzSdrgy6EGvecDg1YuhjBsoN08SR+y36hgdHkqCgrzQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.218.0.tgz", + "integrity": "sha512-x9djaqdzpT8WAboep1H9nCAQ1E+MMsm08TNfA02TqM3bNNddZeiim+E3KMWVQFaX6JpUy7V0nm/wfN/K2Em+Zw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/instrumentation": "0.218.0", + "@opentelemetry/semantic-conventions": "^1.29.0", + "forwarded-parse": "2.1.2" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.66.0.tgz", + "integrity": "sha512-UfTAcaBKCzLUZ9opvfOLV4bH46XiNFqUsKykfPCIefDIxJ1iUYtMOucNaiZ+/kjQdPy5i6Ef5tk2IAjxol4X1w==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/redis-common": "^0.38.3", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.27.0.tgz", + "integrity": "sha512-kl/C2AU4KZGHlMZD12nMFXcMjxSHvu5Q0UPSQ6IJeBfCadYuWgW+sWIa2JZVK/A0qRYm2cncekJyeBHQDyfUUg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.30.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-knex": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.62.0.tgz", + "integrity": "sha512-XgfhCAWwSqA0YnwaEKdpvQMavc90D3R65frhLCO9JNl867EulNps9tm6pjGIg+GiYuewn00gEzW4HQ5btgYxGQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.66.0.tgz", + "integrity": "sha512-04x/z21WTMEfy3lUSr4aTj8WsTN3OZF901hJ+ciOwdwf7AK8UJTpZCXw6KQ3G4Vag56q1HoMihCONeWZLeld1g==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.36.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0" + } + }, + "node_modules/@opentelemetry/instrumentation-lru-memoizer": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.62.0.tgz", + "integrity": "sha512-AlGKIdk6ZT7WmIozfUb2LjOcI3AhQrvAXKX0zi1cVcnw2QlRbVYyV5GTa2Th9ebuczVfWPaoPrmZw61zCp/czw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-memcached": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-memcached/-/instrumentation-memcached-0.61.0.tgz", + "integrity": "sha512-qiCR9Wovf5AHzn6g+LXhvwMmv2I6zhHz2I2tEHZMmBuD8c18bkJzGFxHoSBlxdApRT+SW13r9472dDMm4BRjgQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@types/memcached": "^2.2.6" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.71.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.71.0.tgz", + "integrity": "sha512-6rwfVjAUY69CKkyGqzL+F5X7Nzw0+Ke9pOxk9xUPJpy8vracZxuQYF7rWu02sV1xOgi4u52449SuVhD+zaSiIA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.64.0.tgz", + "integrity": "sha512-iCIqeUaERN8Uc5Rrtg4zvQ6d7z5JQ5iUmbnr/JHYPxAidDowmRc8/wDMJeMKRfLPTj336Zu0ec7rH/ak/4N9vw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.64.0.tgz", + "integrity": "sha512-W1w76AJkP7i0uzzAe7nsCMWq4+EMSA550f1lAmxDPdQC5FnreNbRIm/tod2OS9gVrYvRrQXNkFmZJKGo4kzCnw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@types/mysql": "2.15.27" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.64.0.tgz", + "integrity": "sha512-yTu0mYh/qJPSE86VmNLQww5uugDyvCS2KJIPfPtIk2ufoEUoHPsV6Iynnvmz588Moq04aBLxfTa/EtE4A2ykWA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@opentelemetry/sql-common": "^0.41.2" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.64.0.tgz", + "integrity": "sha512-PW1ArxryMwF8/IXq1nzlQs7tmr/fWd1tf71AHevZT3Fm0hW7jRX9JEfYgIAcKDvmbqcJEr5K1224NEimrRPbuQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.30.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-net": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-net/-/instrumentation-net-0.62.0.tgz", + "integrity": "sha512-Gt2kzpACpmIad+q3LQqe8UNHuoVvdLuFpB6SN/A6xLPKNllb+ksPUYQhj1kXdZOpcFZNGKDXHyN+TUCVCk1TRw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-openai": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-openai/-/instrumentation-openai-0.16.0.tgz", + "integrity": "sha512-I0KKybyqqFOxSBgYKQNdR/EF3LvzSaAUT7Y75xkjbgscY+V8UWDpUbY68POLhUC3SKMlGvZmrTSxcQ+Y0vRhNw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.218.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.36.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-oracledb": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-oracledb/-/instrumentation-oracledb-0.43.0.tgz", + "integrity": "sha512-7Z4kOOdnrHX4S5gCeWhnnpWQwEd7weRjDhJA1nSrwTYtAcVWNjk5wsMKHBCTDCN0uJtA9T6PouZ+AKRYiS1Rrg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.34.0", + "@types/oracledb": "6.5.2" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg": { + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.70.0.tgz", + "integrity": "sha512-g8WXwwOUXfjiEmATwjB/33QKE2AkIpNe4KIuJJh4djtXgCL0Wne+AzAfjuDIAspGvO1txQp8ibKsLd3SBmcvJA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.34.0", + "@opentelemetry/sql-common": "^0.41.2", + "@types/pg": "8.15.6", + "@types/pg-pool": "2.0.7" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pino": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pino/-/instrumentation-pino-0.64.0.tgz", + "integrity": "sha512-+vDL7tZMZjkp8BpYMx/cL2/HWGsNUqKcRmAIIEaQu/6F44oM6xGDMCSqMKHdKCsH1+WW52EYdHbWkVGTF0KVsQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.218.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.66.0.tgz", + "integrity": "sha512-bVShkag6vP2VQO0cpA8CHjOohWbKNYLyjiwGkOnSAwou1TPc6pf9DssFUxwqN2XF1J4oqP0LVSvN9kZUzMecfA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/redis-common": "^0.38.3", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-restify": { + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-restify/-/instrumentation-restify-0.63.0.tgz", + "integrity": "sha512-Z73YxZpt0Y56uRu2pRWOjO5wXHvZqF46K4czoKRTGlUifzzFmUZxyOeAAECACuMRSLZmZ394WJin0MDgU9iW9w==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-router": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-router/-/instrumentation-router-0.62.0.tgz", + "integrity": "sha512-0w8ok7GbXtYvX7TtLp72qQJKNyI7lD72Fy2NsNKIcQAv6TqGox5javFyXrIrCAtZHCONePxeAwAYj1Qd9si9OQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-runtime-node": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-runtime-node/-/instrumentation-runtime-node-0.31.0.tgz", + "integrity": "sha512-HkLsuEfUDahFiL/xFtEqJDMp7sp8ynOtA045bJi9nAH8CrPvljPW5SgJQb2mQqEYJQopbWYZ2lPqQEfj7bYgJg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.218.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-socket.io": { + "version": "0.65.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-socket.io/-/instrumentation-socket.io-0.65.0.tgz", + "integrity": "sha512-dNvIbD40h0z69stQ9cIeAWRyy5WyQM1a1XnFthekc/oi/ipX4E6oYJBM4X2xKBxjZMTjdV5VshLoNeYMSBsnjw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-tedious": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.37.0.tgz", + "integrity": "sha512-cGLF46UsgeI1334atJxLO36yQlV7WXKg35Mp+e2NXo2vOTfIZTVqoKOzExVOTOwT4AQjfGVEDxyq5wXybUYXIA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.33.0", + "@types/tedious": "^4.0.14" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-undici": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.28.0.tgz", + "integrity": "sha512-7nh4Gw7PhYtQm82FIJtWUhx6iZQJj0bdkKe2RQb3XNIyxu0o9rM1J5Xt083SsG2tCbQZpX9/mlDxhTrK1Z/lVQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.218.0", + "@opentelemetry/semantic-conventions": "^1.24.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.7.0" + } + }, + "node_modules/@opentelemetry/instrumentation-winston": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-winston/-/instrumentation-winston-0.62.0.tgz", + "integrity": "sha512-pr1U9ZV4RRy23qMVrRzebfxwDWjp44xA7sC0PAdeW9v4HDcfOr0ejdTJmIsBGvhkNHPBajfieaIF9b6/9wjErA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.218.0", + "@opentelemetry/instrumentation": "^0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.218.0.tgz", + "integrity": "sha512-ZwqpkNL5W7RyGJPDZ9g06DvKp8KFTWPJPN12anpMQYSKpTSU0z3EIZuPq9vPGpS8siFyOqDYDAuCwlNO9FqgbA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-transformer": "0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-grpc-exporter-base": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.218.0.tgz", + "integrity": "sha512-H/lCGJ536N98VpYJOaWTQOkv4Dx6TnmStK6Rqfu1W7KkFbPAx04hjdYEMZF/YbnHzPUSIK4kM6OE2GKGBTpV9A==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/grpc-js": "^1.14.3", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/otlp-transformer": "0.218.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.218.0.tgz", + "integrity": "sha512-CFaKH87WAzjuJ4awowTTLzUvMfaRfiOFG5+qm5S5ncyalRtN4ecQ+YmuANJSCrVPuvZFEkUgKhBPBndxi3rHsQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-logs": "0.218.0", + "@opentelemetry/sdk-metrics": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/propagator-b3": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-2.7.1.tgz", + "integrity": "sha512-RJid6E2CKyeGfKBzXKF21ejabGMHypFkPAh3qZ+NvI+SGjuIye79t3PmiqcDgtRzdKH6ynXzbfslQ8DfpRUg2A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/propagator-jaeger": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-2.7.1.tgz", + "integrity": "sha512-KMjVBHzP4N60bOzxja76M1F1hZZ43lGPga5ix+mkv9+kk1nx9SbkxSvJsMbuVUxdPQmsPTqGShmhN8ulrMOg6Q==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/redis-common": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.3.tgz", + "integrity": "sha512-VCghU1JYs/4gP6Gqf/xro9MEsZ7LrMv2uONVsaESKL38ZOB9BqnI98FfS23wjMnHlpuE+TTaWSoAVNpTwYXzjw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.19.0 || >=20.6.0" + } + }, + "node_modules/@opentelemetry/resource-detector-alibaba-cloud": { + "version": "0.33.8", + "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-alibaba-cloud/-/resource-detector-alibaba-cloud-0.33.8.tgz", + "integrity": "sha512-RnSB/uxkElny0/WBFEtIG2HRG0cpSNTRdE+YSB7Poa+uljK+ddCacEZYz/PMgZh+cs586XstJQxdyjz0jtcAug==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/resources": "^2.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/resource-detector-aws": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-aws/-/resource-detector-aws-2.18.0.tgz", + "integrity": "sha512-wyMM4UoRuHvI2KjqnTzvyW8Yv7MKRGA+I78Xti6gTEw7hBhqXU1SRo+f9KrsQfeeiOn+TkDuvxavuaAQbD3i6g==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/resources": "^2.0.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/resource-detector-azure": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-azure/-/resource-detector-azure-0.26.0.tgz", + "integrity": "sha512-7KxF7mlwI2nKja/iEdwPqOaS0QAJbhT9ye4DeYZnXdOS/4phfonk5nSmyGDBYhBL7J30MPL91oZNuGYRKXZAXA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/resources": "^2.0.0", + "@opentelemetry/semantic-conventions": "^1.37.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/resource-detector-container": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-container/-/resource-detector-container-0.8.9.tgz", + "integrity": "sha512-Xd2C4HjW9hl75iqZT7tQNy2yRBUqNucq2O9+e0FJRNkbiItInYVMzc0S0KDXcx/vZBwNmlrKS3R0uLCU9ULsGA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/resources": "^2.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/resource-detector-gcp": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resource-detector-gcp/-/resource-detector-gcp-0.53.0.tgz", + "integrity": "sha512-RCV31v23ZwZfYR3LPkuORHTHIOvfm3hZBT7hAzSO0+oAIrG/Dm0ld5tV4lYNO05GjI7sHQdRcbSqzEYAvQcQuw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/resources": "^2.0.0", + "gcp-metadata": "^8.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.7.1.tgz", + "integrity": "sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.218.0.tgz", + "integrity": "sha512-QvnNdugatFTVCJXH0Mcu7GOOJSylA9j127kIezOE4YwTI4YbowRons2K4WZTv5FMS8T4q9P0NdaRHdkSmeAIag==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.7.1.tgz", + "integrity": "sha512-MpDJdkiFDs3Pm1RHO3KByuZbuBdJEXEAkiC0+yJdsZGVCdf1RpHR6n+LHDcS7ffmfrt5kVCzJSCfm4z2C7v0uQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.9.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-node": { + "version": "0.218.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.218.0.tgz", + "integrity": "sha512-tPMjHrLV5gsfNdYqoRHjeGbCAZBXXD9c1Qo/2ut7VwnUABDNh76xNxrT0SEhkIIJuCN45bbN1vZnYL1gY0IkOg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.218.0", + "@opentelemetry/configuration": "0.218.0", + "@opentelemetry/context-async-hooks": "2.7.1", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/exporter-logs-otlp-grpc": "0.218.0", + "@opentelemetry/exporter-logs-otlp-http": "0.218.0", + "@opentelemetry/exporter-logs-otlp-proto": "0.218.0", + "@opentelemetry/exporter-metrics-otlp-grpc": "0.218.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.218.0", + "@opentelemetry/exporter-metrics-otlp-proto": "0.218.0", + "@opentelemetry/exporter-prometheus": "0.218.0", + "@opentelemetry/exporter-trace-otlp-grpc": "0.218.0", + "@opentelemetry/exporter-trace-otlp-http": "0.218.0", + "@opentelemetry/exporter-trace-otlp-proto": "0.218.0", + "@opentelemetry/exporter-zipkin": "2.7.1", + "@opentelemetry/instrumentation": "0.218.0", + "@opentelemetry/otlp-exporter-base": "0.218.0", + "@opentelemetry/propagator-b3": "2.7.1", + "@opentelemetry/propagator-jaeger": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/sdk-logs": "0.218.0", + "@opentelemetry/sdk-metrics": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1", + "@opentelemetry/sdk-trace-node": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.7.1.tgz", + "integrity": "sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.7.1", + "@opentelemetry/resources": "2.7.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-node": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-2.7.1.tgz", + "integrity": "sha512-pCpQxU68lV+I9s9svqMyVu5iHdDDUnqUpSxqwyCU8A9ejEsSnMPCbearwsUO4yk08ZJzAIUCFuReMdVQvHrdvg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/context-async-hooks": "2.7.1", + "@opentelemetry/core": "2.7.1", + "@opentelemetry/sdk-trace-base": "2.7.1" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.41.1.tgz", + "integrity": "sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sql-common": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.2.tgz", + "integrity": "sha512-4mhWm3Z8z+i508zQJ7r6Xi7y4mmoJpdvH0fZPFRkWrdp5fq7hhZ2HhYokEOLkfqSMgPR4Z9EyB3DBkbKGOqZiQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz", + "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz", + "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==", + "license": "BSD-3-Clause" + }, + "node_modules/@types/aws-lambda": { + "version": "8.10.161", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.161.tgz", + "integrity": "sha512-rUYdp+MQwSFocxIOcSsYSF3YYYC/uUpMbCY/mbO21vGqfrEYvNSoPyKYDj6RhXXpPfS0KstW9RwG3qXh9sL7FQ==", + "license": "MIT" + }, + "node_modules/@types/bunyan": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/@types/bunyan/-/bunyan-1.8.11.tgz", + "integrity": "sha512-758fRH7umIMk5qt5ELmRMff4mLDlN+xyYzC+dkPTdKwbSkJFvz6xwyScrytPU0QIBbRRwbiE8/BIg8bpajerNQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/memcached": { + "version": "2.2.10", + "resolved": "https://registry.npmjs.org/@types/memcached/-/memcached-2.2.10.tgz", + "integrity": "sha512-AM9smvZN55Gzs2wRrqeMHVP7KE8KWgCJO/XL5yCly2xF6EKa4YlbpK+cLSAH4NG/Ah64HrlegmGqW8kYws7Vxg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mysql": { + "version": "2.15.27", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz", + "integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "25.8.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.8.0.tgz", + "integrity": "sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ==", + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/oracledb": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@types/oracledb/-/oracledb-6.5.2.tgz", + "integrity": "sha512-kK1eBS/Adeyis+3OlBDMeQQuasIDLUYXsi2T15ccNJ0iyUpQ4xDF7svFu3+bGVrI0CMBUclPciz+lsQR3JX3TQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/pg": { + "version": "8.15.6", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.6.tgz", + "integrity": "sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "node_modules/@types/pg-pool": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.7.tgz", + "integrity": "sha512-U4CwmGVQcbEuqpyju8/ptOKg6gEC+Tqsvj2xS9o1g71bUh8twxnC6ZL5rZKCsGN0iyH0CwgUyc9VR5owNQF9Ng==", + "license": "MIT", + "dependencies": { + "@types/pg": "*" + } + }, + "node_modules/@types/tedious": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", + "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "license": "MIT", + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.5", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.5.tgz", + "integrity": "sha512-3grm+/2tUOvu2cjJkvsIxrv/wVpfXQW4PsQHYm7yk4vfpu7Ekl6nEsYBoJUL6qDwZUx8wUhQ8tR2qz+ad9c9OA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.15.1", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cjs-module-lexer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz", + "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", + "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.15.1", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/forwarded-parse": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", + "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==", + "license": "MIT" + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.4.tgz", + "integrity": "sha512-bTIgTsM2bWn3XklZISBTQX7ZSddGW+IO3bMdGaemHZ3tbqExMENHLx6kKZ/KlejgrMtj8q7wBItt51yegqalrA==", + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/gcp-metadata": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz", + "integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==", + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^7.0.0", + "google-logging-utils": "^1.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/google-logging-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz", + "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, + "node_modules/import-in-the-middle": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-3.0.1.tgz", + "integrity": "sha512-pYkiyXVL2Mf3pozdlDGV6NAObxQx13Ae8knZk1UJRJ6uRW/ZRmTGHlQYtrsSl7ubuE5F8CD1z+s1n4RHNuTtuA==", + "license": "Apache-2.0", + "dependencies": { + "acorn": "^8.15.0", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^2.2.0", + "module-details-from-path": "^1.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/kafkajs": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/kafkajs/-/kafkajs-2.2.4.tgz", + "integrity": "sha512-j/YeapB1vfPT2iOIUn/vxdyKEuhuY2PxMBvf5JWux6iSaukAccrMtXEY/Lb7OvavDhOWME589bpLrEdnVHjfjA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/module-details-from-path": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", + "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", + "license": "MIT" + }, + "node_modules/pg": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.20.0.tgz", + "integrity": "sha512-ldhMxz2r8fl/6QkXnBD3CR9/xg694oT6DZQ2s6c/RI28OjtSOpxnPrUCGOBJ46RCUxcWdx3p6kw/xnDHjKvaRA==", + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.12.0", + "pg-pool": "^3.13.0", + "pg-protocol": "^1.13.0", + "pg-types": "2.2.0", + "pgpass": "1.0.5" + }, + "engines": { + "node": ">= 16.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.3.0" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.3.0.tgz", + "integrity": "sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.12.0.tgz", + "integrity": "sha512-U7qg+bpswf3Cs5xLzRqbXbQl85ng0mfSV/J0nnA31MCLgvEaAo7CIhmeyrmJpOr7o+zm0rXK+hNnT5l9RHkCkQ==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.13.0.tgz", + "integrity": "sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.13.0.tgz", + "integrity": "sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", + "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/protobufjs": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.9.tgz", + "integrity": "sha512-Od4muIm3HW1AouyHF5lONOf1FWo3hY1NbFDoy191X9GzhpgW1clCoaFjfVs2rKJNFYpTNJbje4cbAIDBZJ63ZA==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.15.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", + "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-in-the-middle": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-8.0.1.tgz", + "integrity": "sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "module-details-from-path": "^1.0.3" + }, + "engines": { + "node": ">=9.3.0 || >=8.10.0 <9.0.0" + } + }, + "node_modules/require-in-the-middle/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/require-in-the-middle/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/example-apps/otel-exporter-test/package.json b/example-apps/otel-exporter-test/package.json new file mode 100644 index 0000000000..91f4161c2d --- /dev/null +++ b/example-apps/otel-exporter-test/package.json @@ -0,0 +1,40 @@ +{ + "name": "otel-exporter-test", + "version": "1.0.0", + "description": "Sample app for testing OpenTelemetry exporter with Instana (HTTP, PostgreSQL, Kafka)", + "main": "app.js", + "scripts": { + "start": "node app.js", + "dev-otel": "nodemon -r ./tracing.js app.js" + }, + "keywords": [ + "opentelemetry", + "instana", + "tracing", + "postgresql", + "kafka" + ], + "author": "", + "license": "MIT", + "dependencies": { + "@instana/collector": "file:../../packages/collector", + "express": "^4.18.2", + "pg": "^8.11.0", + "kafkajs": "^2.2.4", + "@opentelemetry/api": "latest", + "@opentelemetry/sdk-trace-node": "latest", + "@opentelemetry/sdk-trace-base": "latest", + "@opentelemetry/exporter-trace-otlp-http": "latest", + "@opentelemetry/instrumentation": "latest", + "@opentelemetry/auto-instrumentations-node": "latest", + "@opentelemetry/instrumentation-http": "latest", + "@opentelemetry/instrumentation-express": "latest", + "@opentelemetry/instrumentation-pg": "latest", + "@opentelemetry/instrumentation-kafkajs": "latest", + "@opentelemetry/resources": "latest", + "@opentelemetry/semantic-conventions": "latest" + }, + "devDependencies": { + "nodemon": "^2.0.22" + } +} diff --git a/example-apps/otel-exporter-test/tracing.js b/example-apps/otel-exporter-test/tracing.js new file mode 100644 index 0000000000..aca2564db5 --- /dev/null +++ b/example-apps/otel-exporter-test/tracing.js @@ -0,0 +1,101 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api'); +const { Resource } = require('@opentelemetry/resources'); +const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); +const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); +const { BatchSpanProcessor, SimpleSpanProcessor, ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base'); +const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http'); +const { registerInstrumentations } = require('@opentelemetry/instrumentation'); +const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node'); + +// --------------------------------------------------- +// Explicit instrumentations +// --------------------------------------------------- + +const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http'); +const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express'); +const { PgInstrumentation } = require('@opentelemetry/instrumentation-pg'); +const { KafkaJsInstrumentation } = require('@opentelemetry/instrumentation-kafkajs'); + +// --------------------------------------------------- +// OTel internal logs +// --------------------------------------------------- + +diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO); + +// --------------------------------------------------- +// Provider +// --------------------------------------------------- + +const provider = new NodeTracerProvider({ + resource: new Resource({ + [SemanticResourceAttributes.SERVICE_NAME]: 'test-sample-nodejs-app' + }) +}); + +// --------------------------------------------------- +// Exporters +// --------------------------------------------------- + +const instanaExporter = new OTLPTraceExporter({ + url: 'https://otlp-red-saas.instana.io:4318/v1/traces', + headers: { + 'x-instana-key': 'nqtbV5cEQ5ev0MFzOIwskg' + } +}); + +const consoleExporter = new ConsoleSpanExporter(); + +// --------------------------------------------------- +// Span processors +// --------------------------------------------------- + +provider.addSpanProcessor(new BatchSpanProcessor(instanaExporter)); +provider.addSpanProcessor(new SimpleSpanProcessor(consoleExporter)); + +// --------------------------------------------------- +// Register provider +// --------------------------------------------------- + +provider.register(); + +// --------------------------------------------------- +// Instrumentations +// --------------------------------------------------- + +registerInstrumentations({ + instrumentations: [ + // Generic node auto instrumentation + getNodeAutoInstrumentations({ + // optional noisy instrumentations disable + '@opentelemetry/instrumentation-fs': { + enabled: false + } + }), + + // Explicit instrumentations + new HttpInstrumentation(), + new ExpressInstrumentation(), + new PgInstrumentation(), + new KafkaJsInstrumentation({ + producerHook: (span, info) => { + span.setAttribute('messaging.custom.producer', true); + span.setAttribute('messaging.destination.name', info.topic); + }, + consumerHook: (span, info) => { + span.setAttribute('messaging.custom.consumer', true); + span.setAttribute('messaging.destination.name', info.topic); + } + }) + ] +}); + +// eslint-disable-next-line no-console +console.log('OpenTelemetry initialized'); + +// Made with Bob From f79a64108660db1772d3ca7c29a32ca38bffdeec Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 18 May 2026 17:08:24 +0530 Subject: [PATCH 22/23] chore: added example transformer --- scripts/README.md | 21 + scripts/examples/instana-batch-spans.json | 55 +++ scripts/examples/instana-http-span.json | 22 ++ scripts/examples/instana-kafka-span.json | 19 + scripts/instana-to-otel-converter.js | 450 ++++++++++++++++++++++ 5 files changed, 567 insertions(+) create mode 100644 scripts/README.md create mode 100644 scripts/examples/instana-batch-spans.json create mode 100644 scripts/examples/instana-http-span.json create mode 100644 scripts/examples/instana-kafka-span.json create mode 100644 scripts/instana-to-otel-converter.js diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000000..854e2cabd8 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,21 @@ + +## Usage + +### Command Line Interface + +```bash +cd scripts/ + +# Convert a single span +1. node instana-to-otel-converter.js examples/instana-http-span.json + +# Convert and save to file +2. node instana-to-otel-converter.js examples/instana-http-span.json output.json + +# Convert batch of spans +3. node instana-to-otel-converter.js examples/instana-batch-spans.json otel-batch.json + +# Pipe output +4. node instana-to-otel-converter.js examples/instana-kafka-span.json > kafka-otel.json +``` + diff --git a/scripts/examples/instana-batch-spans.json b/scripts/examples/instana-batch-spans.json new file mode 100644 index 0000000000..4caa3e0871 --- /dev/null +++ b/scripts/examples/instana-batch-spans.json @@ -0,0 +1,55 @@ +[ + { + "t": "abc123def456", + "s": "span001", + "n": "node.http.server", + "ts": 1716019200000, + "d": 150, + "ec": 0, + "data": { + "http": { + "method": "POST", + "url": "/api/orders", + "path": "/api/orders", + "host": "api.example.com", + "status": 201, + "protocol": "HTTP/1.1" + } + } + }, + { + "t": "abc123def456", + "s": "span002", + "p": "span001", + "n": "kafka", + "ts": 1716019200050, + "d": 30, + "ec": 0, + "data": { + "kafka": { + "service": "order-events", + "access": "send", + "partition": 2, + "offset": 98765 + } + } + }, + { + "t": "abc123def456", + "s": "span003", + "p": "span001", + "n": "node.http.client", + "ts": 1716019200100, + "d": 45, + "ec": 0, + "data": { + "http": { + "method": "GET", + "url": "https://payment-service.com/validate", + "path": "/validate", + "host": "payment-service.com", + "status": 200 + } + } + } +] diff --git a/scripts/examples/instana-http-span.json b/scripts/examples/instana-http-span.json new file mode 100644 index 0000000000..f1b57c0236 --- /dev/null +++ b/scripts/examples/instana-http-span.json @@ -0,0 +1,22 @@ +{ + "t": "abc123def456", + "s": "span001", + "p": "parent001", + "n": "node.http.server", + "ts": 1716019200000, + "d": 150, + "ec": 0, + "data": { + "http": { + "method": "GET", + "url": "https://api.example.com/users?page=1", + "path": "/users", + "params": "page=1", + "host": "api.example.com", + "status": 200, + "protocol": "HTTP/1.1", + "route": "/users" + }, + "service": "user-service" + } +} diff --git a/scripts/examples/instana-kafka-span.json b/scripts/examples/instana-kafka-span.json new file mode 100644 index 0000000000..840c7bcc0c --- /dev/null +++ b/scripts/examples/instana-kafka-span.json @@ -0,0 +1,19 @@ +{ + "t": "xyz789abc123", + "s": "span002", + "p": "parent002", + "n": "kafka", + "ts": 1716019300000, + "d": 50, + "ec": 0, + "data": { + "kafka": { + "service": "order-events", + "access": "send", + "partition": 0, + "offset": 12345, + "key": "order-123" + }, + "service": "order-service" + } +} diff --git a/scripts/instana-to-otel-converter.js b/scripts/instana-to-otel-converter.js new file mode 100644 index 0000000000..34ea2868b5 --- /dev/null +++ b/scripts/instana-to-otel-converter.js @@ -0,0 +1,450 @@ +/* + * (c) Copyright IBM Corp. 2026 + */ + +'use strict'; + +/* eslint-disable no-console */ + +/** + * Standalone Script: Instana Span to OpenTelemetry Span Converter + * + * This script converts Instana spans to OpenTelemetry format with proper + * semantic conventions for HTTP and Kafka spans. + * + * Usage: + * node instana-to-otel-converter.js [output-file.json] + * + * Or use programmatically: + * const { convertInstanaToOtel } = require('./instana-to-otel-converter'); + * const otelSpan = convertInstanaToOtel(instanaSpan); + */ + +const fs = require('fs'); + +// ============================================================================ +// OTLP Attribute Mappings Configuration +// ============================================================================ + +/** + * Unified span type configuration with semantic convention mappings + * + * Each span type includes: + * - mappings: Field name to OTLP attribute mappings + * - prefix: Default prefix for unmapped fields + * - additionalAttributes: Static attributes to add for this span type + * + * Based on OpenTelemetry Semantic Conventions: + * - HTTP: https://opentelemetry.io/docs/specs/semconv/http/ + * - Messaging: https://opentelemetry.io/docs/specs/semconv/messaging/ + */ +const OTEL_SPAN_TYPE_CONFIG = { + http: { + mappings: { + method: 'http.request.method', + status: 'http.response.status_code', + url: 'url.full', + path: 'url.path', + host: 'server.address', + protocol: 'network.protocol.name', + params: 'url.query', + path_tpl: 'url.template', + error: 'error.type', + status_text: 'http.status_text', + route: 'http.route', + header: 'http.request.header', + response_header: 'http.response.header' + }, + prefix: 'http', + additionalAttributes: {} + }, + kafka: { + mappings: { + service: 'messaging.destination.name', + access: 'messaging.operation.type', + operation: 'messaging.operation.type', + topic: 'messaging.destination.name', + partition: 'messaging.kafka.destination.partition', + offset: 'messaging.kafka.message.offset', + key: 'messaging.kafka.message.key', + group: 'messaging.consumer.group.name' + }, + prefix: 'messaging.kafka', + additionalAttributes: { + 'messaging.system': 'kafka' + } + } +}; + +// ============================================================================ +// Core Conversion Functions +// ============================================================================ + +/** + * Converts an Instana span to OpenTelemetry format + * + * @param {Object} instanaSpan - The Instana span object + * @returns {Object} OpenTelemetry formatted span + */ +function convertInstanaToOtel(instanaSpan) { + if (!instanaSpan || typeof instanaSpan !== 'object') { + throw new Error('Invalid Instana span: must be an object'); + } + + // Create base OTEL span structure + const otelSpan = { + traceId: convertTraceId(instanaSpan.t), + spanId: convertSpanId(instanaSpan.s), + parentSpanId: instanaSpan.p ? convertSpanId(instanaSpan.p) : undefined, + name: generateSpanName(instanaSpan), + kind: determineSpanKind(instanaSpan), + startTimeUnixNano: convertTimestamp(instanaSpan.ts), + endTimeUnixNano: convertTimestamp(instanaSpan.ts, instanaSpan.d), + attributes: {}, + status: determineStatus(instanaSpan), + events: [], + links: [] + }; + + // Convert span data to OTLP attributes + if (instanaSpan.data) { + otelSpan.attributes = convertSpanData(instanaSpan.data); + } + + // Service nam eis treated as a normal span attribute rather than a resource attribute + // see: https://opentelemetry.io/docs/specs/semconv/registry/attributes/ + // This is also required in all spans, so we can keep this here IMO + // Add service information + if (instanaSpan.data?.service) { + otelSpan.attributes['service.name'] = instanaSpan.data.service; + } + + // Add error information if present + if (instanaSpan.ec && instanaSpan.ec > 0) { + otelSpan.attributes.error = true; + otelSpan.attributes['error.count'] = instanaSpan.ec; + } + + // Clean up undefined values + Object.keys(otelSpan).forEach(key => { + if (otelSpan[key] === undefined) { + delete otelSpan[key]; + } + }); + + return otelSpan; +} + +/** + * Converts Instana span data to OTLP attributes based on span type + * + * @param {Object} data - Instana span data object + * @returns {Object} OTLP attributes + */ +function convertSpanData(data) { + const attributes = {}; + + // Dynamically process each span type using the unified configuration + Object.keys(data).forEach(spanType => { + const config = OTEL_SPAN_TYPE_CONFIG[spanType]; + + if (config && typeof data[spanType] === 'object') { + // Add any additional attributes for this span type + Object.assign(attributes, config.additionalAttributes); + + // Process the span type data + Object.keys(data[spanType]).forEach(key => { + const otelKey = config.mappings[key]; + + if (otelKey) { + attributes[otelKey] = data[spanType][key]; + } else { + // Unmapped fields get prefixed + attributes[`${config.prefix}.${key}`] = data[spanType][key]; + } + }); + } else if (typeof data[spanType] !== 'object') { + // Handle non-object fields directly + attributes[spanType] = data[spanType]; + } + }); + + return attributes; +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +/** + * Converts Instana trace ID to OTLP format (32-character hex string) + * + * @param {string} instanaTraceId - Instana trace ID (16-character hex) + * @returns {string} OTLP trace ID (32-character hex) + */ +function convertTraceId(instanaTraceId) { + if (!instanaTraceId) return '00000000000000000000000000000000'; + + // Pad to 32 characters if needed + return instanaTraceId.padStart(32, '0'); +} + +/** + * Converts Instana span ID to OTLP format (16-character hex string) + * + * @param {string} instanaSpanId - Instana span ID + * @returns {string} OTLP span ID (16-character hex) + */ +function convertSpanId(instanaSpanId) { + if (!instanaSpanId) return '0000000000000000'; + + // Pad to 16 characters if needed + return instanaSpanId.padStart(16, '0'); +} + +/** + * Converts Instana timestamp to OTLP nanosecond format + * + * @param {number} timestamp - Instana timestamp in milliseconds + * @param {number} duration - Optional duration in milliseconds + * @returns {string} Timestamp in nanoseconds + */ +function convertTimestamp(timestamp, duration = 0) { + if (!timestamp) return '0'; + + const totalMs = timestamp + duration; + return String(totalMs * 1000000); // Convert ms to ns +} + +/** + * Generates OTLP span name from Instana span + * + * @param {Object} instanaSpan - Instana span + * @returns {string} OTLP span name + */ +function generateSpanName(instanaSpan) { + const spanName = instanaSpan.n; + + // For HTTP spans, use method + path if available + if (instanaSpan.data?.http) { + const method = instanaSpan.data.http.method || 'HTTP'; + const httpPath = instanaSpan.data.http.path || instanaSpan.data.http.url || '/'; + return `${method} ${httpPath}`; + } + + // For Kafka spans, use operation + topic + if (instanaSpan.data?.kafka) { + const operation = instanaSpan.data.kafka.access || instanaSpan.data.kafka.operation || 'kafka'; + const topic = instanaSpan.data.kafka.service || instanaSpan.data.kafka.topic || 'unknown'; + return `${operation} ${topic}`; + } + + return spanName || 'unknown'; +} + +/** + * Determines OTLP span kind from Instana span + * + * @param {Object} instanaSpan - Instana span + * @returns {number} OTLP span kind enum value + */ +function determineSpanKind(instanaSpan) { + // OTLP Span Kind enum values + const SpanKind = { + UNSPECIFIED: 0, + INTERNAL: 1, + SERVER: 2, + CLIENT: 3, + PRODUCER: 4, + CONSUMER: 5 + }; + + // Use Instana's span kind field (k) if available + // k=1: Entry/Server span + // k=2: Exit/Client span + // k=3: Intermediate/Internal span (or undefined) + if (instanaSpan.k === 1) { + return SpanKind.SERVER; + } else if (instanaSpan.k === 2) { + return SpanKind.CLIENT; + } else if (instanaSpan.k === 3) { + return SpanKind.INTERNAL; + } + + // Kafka is a special case, Event if the following code is not there, it will get mapped to entry/exit by above logic + // Fallback to span data for more specific kinds (Producer/Consumer) + // Kafka Producer + if (instanaSpan.data?.kafka?.access === 'send' || instanaSpan.data?.kafka?.access === 'produce') { + return SpanKind.PRODUCER; + } + + // Kafka Consumer + if (instanaSpan.data?.kafka?.access === 'consume' || instanaSpan.data?.kafka?.access === 'receive') { + return SpanKind.CONSUMER; + } + + return SpanKind.EXIT; +} + +/** + * Determines OTLP status from Instana span + * + * @param {Object} instanaSpan - Instana span + * @returns {Object} OTLP status object + */ +function determineStatus(instanaSpan) { + // OTLP Status Code enum values + const StatusCode = { + UNSET: 0, + OK: 1, + ERROR: 2 + }; + + const status = { + code: StatusCode.UNSET + }; + + // Check for errors + if (instanaSpan.ec && instanaSpan.ec > 0) { + status.code = StatusCode.ERROR; + status.message = instanaSpan.data?.http?.error || instanaSpan.data?.kafka?.error || 'Error occurred'; + } else if (instanaSpan.data?.http?.status) { + const httpStatus = instanaSpan.data.http.status; + if (httpStatus >= 400) { + status.code = StatusCode.ERROR; + status.message = `HTTP ${httpStatus}`; + } else if (httpStatus >= 200 && httpStatus < 300) { + status.code = StatusCode.OK; + } + } else { + status.code = StatusCode.OK; + } + + return status; +} + +// ============================================================================ +// Batch Conversion +// ============================================================================ + +/** + * Converts multiple Instana spans to OTLP format + * + * @param {Array} instanaSpans - Array of Instana spans + * @returns {Array} Array of OTLP spans + */ +function convertBatch(instanaSpans) { + if (!Array.isArray(instanaSpans)) { + throw new Error('Input must be an array of spans'); + } + + return instanaSpans + .map(span => { + try { + return convertInstanaToOtel(span); + } catch (error) { + console.error(`Error converting span: ${error.message}`); + return null; + } + }) + .filter(span => span !== null); +} + +// ============================================================================ +// CLI Interface +// ============================================================================ + +/** + * Main CLI function + */ +function main() { + const args = process.argv.slice(2); + + if (args.length === 0 || args.includes('--help') || args.includes('-h')) { + console.log(` +Instana to OpenTelemetry Span Converter + +Usage: + node instana-to-otel-converter.js [output-file.json] + +Arguments: + input-file.json - JSON file containing Instana span(s) + output-file.json - Optional output file (defaults to stdout) + +Input Format: + - Single span object: { t: "...", s: "...", ... } + - Array of spans: [{ t: "...", s: "..." }, ...] + +Examples: + node instana-to-otel-converter.js instana-span.json + node instana-to-otel-converter.js instana-spans.json otel-spans.json + node instana-to-otel-converter.js input.json > output.json + `); + process.exit(0); + } + + const inputFile = args[0]; + const outputFile = args[1]; + + // Read input file + if (!fs.existsSync(inputFile)) { + console.error(`Error: Input file not found: ${inputFile}`); + process.exit(1); + } + + let inputData; + try { + const fileContent = fs.readFileSync(inputFile, 'utf8'); + inputData = JSON.parse(fileContent); + } catch (error) { + console.error(`Error reading input file: ${error.message}`); + process.exit(1); + } + + // Convert spans + let outputData; + try { + if (Array.isArray(inputData)) { + outputData = convertBatch(inputData); + } else { + outputData = convertInstanaToOtel(inputData); + } + } catch (error) { + console.error(`Error converting spans: ${error.message}`); + process.exit(1); + } + + // Write output + const outputJson = JSON.stringify(outputData, null, 2); + + if (outputFile) { + try { + fs.writeFileSync(outputFile, outputJson, 'utf8'); + console.log(`✓ Converted ${Array.isArray(inputData) ? inputData.length : 1} span(s)`); + console.log(`✓ Output written to: ${outputFile}`); + } catch (error) { + console.error(`Error writing output file: ${error.message}`); + process.exit(1); + } + } else { + console.log(outputJson); + } +} + +// ============================================================================ +// Module Exports +// ============================================================================ + +module.exports = { + convertInstanaToOtel, + convertBatch, + convertSpanData, + OTEL_SPAN_TYPE_CONFIG +}; + +// Run CLI if executed directly +if (require.main === module) { + main(); +} + +// Made with Bob From 06835ebae26de207cb662d022c33b787093205d2 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 18 May 2026 17:17:02 +0530 Subject: [PATCH 23/23] chore: update readme to minimal --- OTLP_TRANSFORMATION_STEPS.md | 258 ------- .../src/tracing/OTLP_TRANSFORMATION_README.md | 704 +----------------- 2 files changed, 28 insertions(+), 934 deletions(-) delete mode 100644 OTLP_TRANSFORMATION_STEPS.md diff --git a/OTLP_TRANSFORMATION_STEPS.md b/OTLP_TRANSFORMATION_STEPS.md deleted file mode 100644 index e4024ce7d1..0000000000 --- a/OTLP_TRANSFORMATION_STEPS.md +++ /dev/null @@ -1,258 +0,0 @@ -# OTLP Transformation - Step-by-Step Guide - -## Current Structure Analysis - -``` -Instana Span Creation - ↓ -Backend Mapper (mapper.js) - ↓ -Span Buffer (spanBuffer.js) - ↓ -[OTLP_FORMAT Check] - ↓ -OTLP Mapper (otlp_mapper/mapper.js) - ↓ -OTLP Transformer (otlpTransformer.js) - ↓ -Agent Connection (agentConnection.js) - ↓ -Backend (Port 4318) -``` - ---- - -## Step 1: Span Creation -**File**: Instrumentation modules (e.g., HTTP, Kafka, Database) - -**Input**: Application activity (HTTP request, DB query, etc.) - -**Output**: Instana span object -```javascript -{ - t: "trace-id", - s: "span-id", - p: "parent-id", - n: "node.http.server", - k: 1, - ts: 1234567890123, - d: 45, - ec: 0, - data: { - http: { - method: "GET", - url: "/api/users", - status: 200 - } - } -} -``` - -**Cleanup**: None needed - this is the entry point - ---- - -## Step 2: Backend Mapper -**File**: `packages/core/src/tracing/backend_mappers/mapper.js` - -**Purpose**: Normalize internal field names to backend field names - -**Transformation**: -```javascript -// Before -data.redis.operation = "GET" - -// After -data.redis.command = "GET" -``` - -**Cleanup**: -- ✅ Already clean -- ✅ Single responsibility -- ✅ Simple field mapping - ---- - -## Step 3: Span Buffer -**File**: `packages/core/src/tracing/spanBuffer.js` - -**Purpose**: Collect and batch spans before transmission - -**Key Logic** (line 461): -```javascript -const processedSpans = - process.env.INSTANA_OTLP_FORMAT === 'true' - ? otlpTransformer.transform(spansToSend) - : spansToSend; -``` - -**Cleanup**: -- ✅ Already clean -- ✅ Clear separation of concerns -- ✅ Simple format check - ---- - -## Step 4: OTLP Mapper (When OTLP_FORMAT=true) -**File**: `packages/core/src/tracing/otlp_mapper/mapper.js` - -**Purpose**: Map backend fields to OTLP semantic conventions - -**Transformation**: -```javascript -// Before -data.http.method = "GET" - -// After -data.http["http.request.method"] = "GET" -``` - -**Cleanup**: -- create a common json for attr and data and use this in mapper - ---- - -## Step 5: OTLP Transformer -**File**: `packages/core/src/tracing/otlpTransformer.js` - -**Purpose**: Transform complete span to OTLP format - -**Transformations**: -1. Group spans by resource -2. Convert timestamps (ms → nanoseconds) -3. Map span kinds (Instana → OTLP) -4. Generate span names -5. Create OTLP attributes -6. Build final OTLP structure - -**Output**: -```javascript -{ - resourceSpans: [{ - resource: { attributes: [...] }, - scopeSpans: [{ - scope: { name: "@instana/collector" }, - spans: [...] - }] - }] -} -``` - -**Cleanup**: -- remove redundancy -- mapper can deal with kind transformation etc - ---- - -## Step 6: Agent Connection -**File**: `packages/collector/src/agentConnection.js` - -**Purpose**: Send data to backend - -**Current Issues**: -- ❌ Hardcoded port 4318 (lines 499, 582) -- ❌ Duplicate functions: `sendData()` and `sendOtlpData()` -- ❌ No connection pooling - -**Cleanup Needed**: -1. Make OTLP port configurable -2. Merge duplicate send functions -3. Add connection pooling - ---- - -## Simple Test Steps - -### 1. Setup -```bash -cd example-apps/otel-exporter-test -npm install -``` - -### 2. Run with OTLP Format -```bash -INSTANA_OTLP_FORMAT=true OTEL_SERVICE_NAME=test-app npm start -``` - -### 3. Test Endpoints -```bash -# HTTP + HTTP Exit -curl http://localhost:3000/external-api - -# HTTP + Database Exit -curl http://localhost:3000/db - -# HTTP + Kafka Exit -curl -X POST http://localhost:3000/kafka -H "Content-Type: application/json" -d '{"test":"data"}' -``` - -### 4. Verify -- Check console for span output -- Verify OTLP format structure -- Confirm data sent to port 4318 - ---- - -## Quick Reference - -### Environment Variables -```bash -INSTANA_OTLP_FORMAT=true # Enable OTLP transformation -OTEL_SERVICE_NAME=my-service # Set service name (standard OpenTelemetry) -# OR -SERVICE_NAME=my-service # Set service name (legacy, still supported) -INSTANA_OTLP_PORT=4318 # (After cleanup) Configure OTLP port -``` - -### Key Files -``` -packages/core/src/tracing/ -├── backend_mappers/mapper.js # Step 2: Backend field mapping -├── otlp_mapper/mapper.js # Step 4: OTLP semantic mapping -├── otlpTransformer.js # Step 5: Full OTLP transformation -└── spanBuffer.js # Step 3: Buffering & format check - -packages/collector/src/ -├── agentConnection.js # Step 6: Network transmission -└── agent/opts.js # Configuration -``` - -### Trace Format at Each Step - -| Step | Format | Example Field | -|------|--------|---------------| -| 1. Creation | Instana Internal | `data.http.method` | -| 2. Backend Mapper | Instana Backend | `data.redis.command` | -| 3. Buffer | Same as Step 2 | - | -| 4. OTLP Mapper | Instana + OTLP | `data.http["http.request.method"]` | -| 5. OTLP Transform | Full OTLP | `attributes[{key, value}]` | -| 6. Transmission | OTLP JSON | `resourceSpans[...]` | - ---- - -## Summary - -**Current State**: ✅ Mostly clean, working implementation - -**Cleanup Needed**: -**Cleanup Needed**: - -1. Remove debug `console.log`s - -2. Create a common structure for: - - * attributes - * data - - and reuse this across all mappers. - - Cleanup can be done step-by-step: - - * first standardize `data` - * then standardize `attributes` - -3. Make OTLP port configurable - -4. Unify send functions - - * separate handling for OTLP and Instana if needed (optional) diff --git a/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md b/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md index 7b7ce49907..20c3100393 100644 --- a/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md +++ b/packages/core/src/tracing/OTLP_TRANSFORMATION_README.md @@ -34,35 +34,41 @@ This document describes the architecture and implementation of the OpenTelemetry │ true │ false ▼ ▼ ┌─────────────────────┐ ┌──────────────────┐ -│ OTLP Mapper │ │ Send as-is │ -│ (otlp_mapper) │ │ (Instana fmt) │ -│ Backend → OTLP │ └──────────────────┘ -│ Semantic Conv. │ +│ OTLP Converter │ │ Send as-is │ +│ (converter.js) │ │ (Instana fmt) │ +│ Instana → OTLP │ └──────────────────┘ +│ Direct Transform │ └──────────┬──────────┘ - │ OTLP-mapped fields + │ OTLP spans ▼ ┌─────────────────────────────────────────────────────────────────┐ -│ OTLP Transformer (otlpTransformer.js) │ +│ OTLP Converter (instana-to-otel-converter.js) │ │ │ │ ┌──────────────────────────────────────────────────────────┐ │ -│ │ 1. Group spans by resource (PID + Host) │ │ +│ │ 1. Convert base span structure: │ │ +│ │ - Normalize trace ID (16 → 32-char hex) │ │ +│ │ - Normalize span ID (16-char hex) │ │ +│ │ - Convert timestamps (ms → nanoseconds) │ │ +│ │ - Generate span name from data │ │ +│ │ - Determine span kind (Instana k → OTLP kind) │ │ │ └──────────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────────┐ │ -│ │ 2. Transform each span: │ │ -│ │ - Convert timestamps (ms → nanoseconds) │ │ -│ │ - Map span kind (Instana → OTLP) │ │ -│ │ - Generate span name │ │ -│ │ - Create OTLP attributes array │ │ -│ │ - Normalize trace ID (32-char hex) │ │ -│ │ - Set status based on error count │ │ +│ │ 2. Transform span data to OTLP attributes: │ │ +│ │ - Apply unified span type configuration │ │ +│ │ - Map fields using semantic conventions │ │ +│ │ - Add additional attributes per span type │ │ +│ │ - Prefix unmapped fields │ │ │ └──────────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────────┐ │ -│ │ 3. Create resource attributes │ │ -│ │ - SDK info, service name, PID, hostname │ │ +│ │ 3. Set span status: │ │ +│ │ - Check error count (ec > 0 → ERROR) │ │ +│ │ - Check HTTP status (4xx/5xx → ERROR, 2xx → OK) │ │ +│ │ - Default to OK if no errors │ │ │ └──────────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────────┐ │ -│ │ 4. Build OTLP structure │ │ -│ │ - resourceSpans → scopeSpans → spans │ │ +│ │ 4. Add service and error attributes: │ │ +│ │ - service.name from span data │ │ +│ │ - error and error.count if ec > 0 │ │ │ └──────────────────────────────────────────────────────────┘ │ └────────────────────────┬────────────────────────────────────────┘ │ OTLP JSON @@ -79,664 +85,10 @@ This document describes the architecture and implementation of the OpenTelemetry ### Step 1: Trace Collection (Instana Span Format) -**Input**: Raw Instana span from instrumentation - -```javascript -{ - t: "1234567890abcdef", // Trace ID - s: "span123", // Span ID - p: "parent456", // Parent Span ID (optional) - n: "node.http.server", // Span name/type - k: 1, // Kind (1=ENTRY, 2=EXIT, 3=INTERMEDIATE) - ts: 1234567890123, // Timestamp (milliseconds) - d: 45, // Duration (milliseconds) - ec: 0, // Error count - f: { // From (resource information) - e: "12345", // PID - h: "my-hostname" // Host ID - }, - data: { // Protocol-specific data - http: { - method: "GET", - url: "/api/users", - status: 200, - host: "example.com" - } - } -} -``` - -**Location**: Created by instrumentation modules (e.g., `packages/collector/src/tracing/instrumentation/protocols/http.js`) - ---- - -### Step 2: Backend Field Mapping - -**Purpose**: Normalize internal field names to backend-expected names - -**Transformation**: `packages/core/src/tracing/backend_mappers/mapper.js` - -```javascript -// Field mappings configuration -const fieldMappings = { - redis: { - operation: 'command' // operation → command - }, - kafka: { - operation: 'access', // operation → access - endpoints: 'service' // endpoints → service - }, - http: { - operation: 'method', // operation → method - endpoints: 'url', // endpoints → url - connection: 'host' // connection → host - } -}; - -// Example transformation -// Before: data.redis.operation = "GET" -// After: data.redis.command = "GET" -``` - ---- - -### Step 3: OTLP Semantic Convention Mapping - -**Purpose**: Map backend fields to OTLP semantic convention attributes - -**Transformation**: `packages/core/src/tracing/otlp_mapper/mapper.js` - -```javascript -// OTLP attribute mappings -const otlpAttributeMappings = { - http: { - method: 'http.request.method', - status: 'http.response.status_code', - url: 'url.full', - path: 'url.path', - host: 'server.address', - protocol: 'network.protocol.name' - }, - - // Database mappings (applies to pg, mysql, mongodb, redis, etc.) - database: { - stmt: 'db.statement', - command: 'db.operation.name', - host: 'net.peer.name', - port: 'net.peer.port', - user: 'db.user', - db: 'db.name', - table: 'db.sql.table' - }, - - // Messaging mappings (Kafka, etc.) - messaging: { - service: 'messaging.destination.name', - access: 'messaging.operation.type' - } -}; - -// Example transformation -// Before: data.http.method = "GET" -// After: data.http["http.request.method"] = "GET" -``` - ---- - -### Step 4: Transform Data Values - -**Location**: `packages/core/src/tracing/otlpTransformer.js` - -#### 4.1 Timestamp Conversion - -```javascript -// Convert milliseconds to nanoseconds (as string) -function msToNano(ms) { - return String(ms * 1000000); -} - -// Example: -// Input: ts = 1234567890123 (ms) -// Output: startTimeUnixNano = "1234567890123000000" (ns) -``` - -#### 4.2 Span Kind Mapping - -```javascript -// Instana → OTLP span kind mapping -function convertSpanKind(instanaKind, spanType, data) { - // Standard mappings - switch (instanaKind) { - case 1: return 2; // ENTRY → SERVER - case 2: return 3; // EXIT → CLIENT - case 3: return 1; // INTERMEDIATE → INTERNAL - default: return 0; // UNSPECIFIED - } - - // Special case: Kafka - if (spanType === 'kafka' && data.kafka) { - if (data.kafka.access === 'send') return 2; // PRODUCER - if (data.kafka.access === 'consume') return 3; // CONSUMER - } -} -``` - -#### 4.3 Trace ID Normalization - -```javascript -// Normalize to 32-character hex string -function normalizeTraceId(traceId) { - const normalized = String(traceId || '0'); - if (normalized.length === 32) return normalized; - if (normalized.length > 32) return normalized.slice(-32); - return normalized.padStart(32, '0'); -} - -// Example: -// Input: "1234567890abcdef" -// Output: "00000000000000001234567890abcdef" -``` - -#### 4.4 Span Name Generation - -```javascript -// Generate descriptive span names based on span type -const spanNameRules = { - 'node.http.server': { - template: data => `${data.method || 'HTTP'} ${data.path_tpl || data.url || '/'}` - }, - 'node.http.client': { - template: data => data.method || 'HTTP' - }, - 'postgres': { - template: data => { - const operation = (data.stmt || '').split(' ')[0] || 'query'; - const db = data.db || ''; - return `pg.query:${operation} ${db}`.trim(); - } - }, - 'kafka': { - template: data => `${data.access || 'process'} ${data.service || 'unknown'}` - } -}; - -// Examples: -// HTTP: "GET /api/users" -// Postgres: "pg.query:SELECT mydb" -// Kafka: "send my-topic" -``` - -#### 4.5 Status Determination - -```javascript -// Map error count to OTLP status -function createStatus(errorCount) { - if (errorCount > 0) { - return { code: 2 }; // ERROR - } - return { code: 1 }; // OK -} -``` - ---- - -### Step 5: Add Attributes - -**Location**: `packages/core/src/tracing/otlpTransformer.js` - `createAttributes()` - -#### 5.1 System Attributes - -Automatically added based on span type: - -```javascript -const systemAttributeRules = { - postgres: { - attributes: [ - { key: 'db.system', value: 'postgresql' } - ] - }, - kafka: { - attributes: [ - { key: 'messaging.system', value: 'kafka' } - ] - } -}; -``` - -#### 5.2 Data Attributes - -Transform span data to OTLP attribute format: - -```javascript -// Attribute value types -attributes.push({ - key: "http.request.method", - value: { stringValue: "GET" } -}); - -attributes.push({ - key: "http.response.status_code", - value: { intValue: 200 } -}); - -attributes.push({ - key: "feature.enabled", - value: { boolValue: true } -}); -``` - -#### 5.3 Complete Attributes Example - -```javascript -attributes: [ - // System attribute - { key: "db.system", value: { stringValue: "postgresql" } }, - - // Mapped attributes from span data - { key: "db.statement", value: { stringValue: "SELECT * FROM users" } }, - { key: "net.peer.name", value: { stringValue: "localhost" } }, - { key: "net.peer.port", value: { intValue: 5432 } }, - { key: "db.name", value: { stringValue: "mydb" } }, - - // Unmapped attributes (kept as-is with prefix) - { key: "pg.custom_field", value: { stringValue: "custom_value" } } -] -``` - ---- - -### Step 6: Transform Custom/Additional Attributes - -#### 6.1 Unmapped Fields - -Fields without explicit mappings are preserved with a prefix: - -```javascript -// If no mapping exists for a field -const otlpKey = mappings[field] || `${dataKey}.${field}`; - -// Example: -// data.http.custom_header → "http.custom_header" -``` - -#### 6.2 Complex Values - -Objects and arrays are JSON-stringified: - -```javascript -if (typeof value === 'object') { - attributes.push({ - key: otlpKey, - value: { stringValue: JSON.stringify(value) } - }); -} -``` - -#### 6.3 Adding New Mappings - -To add support for new span types or attributes: - -**Option 1: Update OTLP Mapper** (`otlp_mapper/mapper.js`) - -```javascript -// Add to otlpAttributeMappings -const otlpAttributeMappings = { - myNewProtocol: { - internalField: 'otel.semantic.convention.field', - anotherField: 'otel.another.field' - } -}; -``` - -**Option 2: Update System Attributes** (`otlpTransformer.js`) - -```javascript -// Add to systemAttributeRules -const systemAttributeRules = { - myNewProtocol: { - dataKey: 'myNewProtocol', - attributes: [ - { key: 'system.type', value: 'myNewProtocol' } - ] - } -}; -``` - -**Option 3: Update Span Name Rules** (`otlpTransformer.js`) - -```javascript -// Add to spanNameRules -const spanNameRules = { - 'myNewProtocol': { - dataKey: 'myNewProtocol', - template: data => `${data.operation} ${data.target}` - } -}; -``` - ---- - -### Step 7: Resource Attributes - -**Location**: `packages/core/src/tracing/otlpTransformer.js` - `createResourceAttributes()` - -```javascript -resource: { - attributes: [ - // SDK information - { - key: "telemetry.sdk.language", - value: { stringValue: "nodejs" } - }, - { - key: "telemetry.sdk.name", - value: { stringValue: "@instana/collector" } - }, - - // Service information - { - key: "service.name", - value: { stringValue: process.env.SERVICE_NAME } - }, - - // Process information - { - key: "process.pid", - value: { intValue: 12345 } - }, - - // Host information - { - key: "host.name", - value: { stringValue: "my-hostname" } - } - ] -} -``` - ---- - -### Step 8: Final OTLP Structure - -**Output**: Complete OTLP trace format - -```javascript -{ - resourceSpans: [ - { - resource: { - attributes: [ - { key: "telemetry.sdk.language", value: { stringValue: "nodejs" } }, - { key: "telemetry.sdk.name", value: { stringValue: "@instana/collector" } }, - { key: "service.name", value: { stringValue: "my-service" } }, - { key: "process.pid", value: { intValue: 12345 } }, - { key: "host.name", value: { stringValue: "my-hostname" } } - ] - }, - scopeSpans: [ - { - scope: { - name: "@instana/collector", - version: "1.0.0" - }, - spans: [ - { - traceId: "00000000000000001234567890abcdef", - spanId: "span123", - parentSpanId: "parent456", - name: "GET /api/users", - kind: 2, - startTimeUnixNano: "1234567890123000000", - endTimeUnixNano: "1234567890168000000", - attributes: [ - { key: "http.request.method", value: { stringValue: "GET" } }, - { key: "http.response.status_code", value: { intValue: 200 } }, - { key: "url.full", value: { stringValue: "/api/users" } }, - { key: "server.address", value: { stringValue: "example.com" } } - ], - status: { code: 1 } - } - ] - } - ] - } - ] -} -``` - ---- - -## Configuration Files - -### Mapping Configuration Approach - -The current implementation uses **code-based configuration** for mappings. For a JSON-based approach, consider: - -#### Proposed: `otlp-mappings.json` - -```json -{ - "spanKindMappings": { - "default": { - "1": 2, - "2": 3, - "3": 1 - }, - "kafka": { - "rules": [ - { "condition": "data.kafka.access === 'send'", "kind": 2 }, - { "condition": "data.kafka.access === 'consume'", "kind": 3 } - ] - } - }, - - "attributeMappings": { - "http": { - "method": "http.request.method", - "status": "http.response.status_code", - "url": "url.full", - "path": "url.path", - "host": "server.address" - }, - "database": { - "stmt": "db.statement", - "command": "db.operation.name", - "host": "net.peer.name", - "port": "net.peer.port" - } - }, - - "systemAttributes": { - "postgres": [ - { "key": "db.system", "value": "postgresql" } - ], - "kafka": [ - { "key": "messaging.system", "value": "kafka" } - ] - }, - - "spanNameTemplates": { - "node.http.server": "{method} {path_tpl|url|/}", - "postgres": "pg.query:{stmt[0]} {db}", - "kafka": "{access} {service}" - } -} -``` - -#### Proposed: `backend-mappings.json` - -```json -{ - "fieldMappings": { - "redis": { - "operation": "command" - }, - "kafka": { - "operation": "access", - "endpoints": "service" - }, - "http": { - "operation": "method", - "endpoints": "url", - "connection": "host" - } - } -} -``` - ---- - -## Usage - -### Enable OTLP Format - -```bash -export INSTANA_OTLP_FORMAT=true -export SERVICE_NAME=my-service -node app.js -``` - -### Verify Transformation - -Check logs for OTLP structure: -```javascript -// In otlpTransformer.js (line 379) -console.log('-----------------', JSON.stringify(otelSpans)); -``` - -### Backend Endpoint - -Spans are sent to: -- **Host**: `localhost` (configurable via `agentOpts.host`) -- **Port**: `4318` (OTLP standard port) -- **Path**: `/v1/traces` -- **Method**: `POST` -- **Content-Type**: `application/json; charset=UTF-8` - ---- - -## Testing +### Step 2: Unified Span Type Configuration -### Unit Tests - -```bash -# Test OTLP mapper -npm test packages/core/test/tracing/otlp_mapper/mapper_test.js - -# Test backend mapper -npm test packages/core/test/tracing/backend_mappers/mapper_test.js - -# Test span buffer -npm test packages/core/test/tracing/spanBuffer_test.js -``` - -### Integration Test - -```bash -# Run example app with OTLP format -cd example-apps/otel-exporter-test -INSTANA_OTLP_FORMAT=true npm start -``` - ---- - -## Extending the Transformation - -### Adding a New Protocol - -1. **Add Backend Mapping** (`backend_mappers/mapper.js`): -```javascript -const fieldMappings = { - myProtocol: { - internalField: 'backendField' - } -}; -``` - -2. **Add OTLP Mapping** (`otlp_mapper/mapper.js`): -```javascript -const otlpAttributeMappings = { - myProtocol: { - backendField: 'otel.semantic.field' - } -}; -``` - -3. **Add System Attributes** (`otlpTransformer.js`): -```javascript -const systemAttributeRules = { - myProtocol: { - dataKey: 'myProtocol', - attributes: [ - { key: 'system.type', value: 'myProtocol' } - ] - } -}; -``` - -4. **Add Span Name Rule** (`otlpTransformer.js`): -```javascript -const spanNameRules = { - 'myProtocol': { - dataKey: 'myProtocol', - template: data => `${data.operation} ${data.target}` - } -}; -``` - ---- - -## References - -- [OpenTelemetry Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/) -- [OTLP Specification](https://opentelemetry.io/docs/specs/otlp/) -- [HTTP Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/http/) -- [Database Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/database/) -- [Messaging Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/messaging/) - ---- - -## Troubleshooting - -### Spans Not Transforming - -1. Check environment variable: `echo $INSTANA_OTLP_FORMAT` -2. Verify check in `spanBuffer.js` line 461 -3. Check logs for transformation errors - -### Missing Attributes - -1. Verify mapping exists in `otlp_mapper/mapper.js` -2. Check if field was mapped in `backend_mappers/mapper.js` -3. Unmapped fields are preserved with prefix - -### Incorrect Span Names - -1. Check `spanNameRules` in `otlpTransformer.js` -2. Add custom rule for your span type -3. Default: uses span type (`span.n`) - -### Backend Connection Issues - -1. Verify OTLP collector is running on port 4318 -2. Check `agentOpts.host` configuration -3. Review `agentConnection.js` sendData function - ---- - -## Performance Considerations - -- **Batching**: Spans are batched before transformation (configurable) -- **Memory**: Buffer size limited by `maxBufferedSpans` config -- **CPU**: Transformation is synchronous but optimized -- **Network**: Single HTTP request per batch - ---- +### Step 3: Span Data Conversion -## Future Improvements +### Step 4: Add Service and Error Attributes -1. **JSON Configuration**: Move mappings to external JSON files -2. **Dynamic Rules**: Support runtime rule updates -3. **Compression**: Add gzip compression for large payloads -4. **Metrics**: Add transformation metrics (duration, errors) -5. **Validation**: Add OTLP schema validation \ No newline at end of file +### Step 5: OTLP JSON Format \ No newline at end of file