Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
68409ce
chore: playground done
kirrg001 Apr 9, 2026
a0af08a
chore: infra cor
kirrg001 Apr 9, 2026
a41a17e
chore: phase 1
abhilash-sivan May 4, 2026
5beae45
chore: phase 2
abhilash-sivan May 4, 2026
03a2818
chore: phase 3
abhilash-sivan May 7, 2026
0849123
chore: cleanup
abhilash-sivan May 7, 2026
4d053c1
chore: rewrite
abhilash-sivan May 7, 2026
9fd5e65
chore: test
abhilash-sivan May 7, 2026
fa2975c
chore: a
abhilash-sivan May 7, 2026
edf2180
chore: new fields
abhilash-sivan May 7, 2026
03a1335
chore: test
abhilash-sivan May 7, 2026
3465c07
test: fixed failing test
abhilash-sivan May 10, 2026
ce3a980
chore: cleanup
abhilash-sivan May 10, 2026
1f28c8e
chore: ui corrected
abhilash-sivan May 13, 2026
e1af284
chore: added kafka and pg, generalize
abhilash-sivan May 14, 2026
e392966
chore: update
abhilash-sivan May 14, 2026
d3f3d75
chore: fix
abhilash-sivan May 15, 2026
925ef10
chore: clean
abhilash-sivan May 15, 2026
69d08d7
chore: update
abhilash-sivan May 15, 2026
6db5786
chore: added readme
abhilash-sivan May 18, 2026
5a2e7a4
chore: added example
abhilash-sivan May 18, 2026
7076fd0
chore: added example transformer
abhilash-sivan May 18, 2026
2ee0788
chore: update readme to minimal
abhilash-sivan May 18, 2026
aaa4317
chore: update logic
abhilash-sivan May 19, 2026
2ee1352
chore: spanBuffer uses temporary converter
abhilash-sivan May 19, 2026
4e5b8bd
chore: move files for using inside spanBuffer
abhilash-sivan May 19, 2026
a72e4aa
chore: update
abhilash-sivan May 19, 2026
0ecaa33
chore: rearrange
abhilash-sivan May 19, 2026
f10bf3e
chore: added separate transformer
abhilash-sivan May 20, 2026
fd8c82a
chore: added example otel spans
abhilash-sivan May 20, 2026
bb30ccc
chore: make getSpanType dynamic
abhilash-sivan May 20, 2026
fb14402
chore: fix status
abhilash-sivan May 20, 2026
9eed689
chore: kafka systemName
abhilash-sivan May 20, 2026
9729561
chore: v1 of multiple data key logic
abhilash-sivan May 21, 2026
8bba930
chore: refactor
abhilash-sivan May 21, 2026
fbba264
chore: optimize additioanl attributes
abhilash-sivan May 22, 2026
9f2f999
chore: wip more dynamic
abhilash-sivan May 22, 2026
0ff3f68
chore: refatcor transformers
abhilash-sivan May 26, 2026
e5ebc43
chore: refactor main file
abhilash-sivan May 26, 2026
3d9b59d
chore: new otel span type file
abhilash-sivan May 26, 2026
ec5f160
chore: cleanup otlp transformer
abhilash-sivan May 26, 2026
cbe0bec
chore: minor refactor for pr comment
abhilash-sivan May 26, 2026
a4ac517
chore: udpate example app
abhilash-sivan Jun 2, 2026
0f53a7a
chore: refactor 1
abhilash-sivan Jun 4, 2026
cfe4ee4
chore: same format
abhilash-sivan Jun 4, 2026
d583373
chore: remove circular dependency
abhilash-sivan Jun 4, 2026
be15bd7
chore: use fn instead of string
abhilash-sivan Jun 4, 2026
8e04f43
chore: rearrange
abhilash-sivan Jun 4, 2026
306a229
chore: refactor clean
abhilash-sivan Jun 4, 2026
6adcaa3
chore: refactor
abhilash-sivan Jun 4, 2026
6df9013
chore: fix refactorig issues
abhilash-sivan Jun 4, 2026
8ac8422
chore: rearrage
abhilash-sivan Jun 4, 2026
10471fc
chore: resolve priority span type
abhilash-sivan Jun 5, 2026
23c81fd
chore: updated structure
abhilash-sivan Jun 5, 2026
1144946
chore: remove parentSpanContext for now
abhilash-sivan Jun 5, 2026
45602db
chore: add version specific directory
abhilash-sivan Jun 5, 2026
32c2b11
chore: service name resolution
abhilash-sivan Jun 5, 2026
36b7cb5
chore: instr
aryamohanan Jun 8, 2026
35b2d7a
chore: updated the structure
aryamohanan Jun 8, 2026
addcf4d
chore: tested kafka+ mongo
aryamohanan Jun 8, 2026
00169ba
chore: updated
aryamohanan Jun 8, 2026
d282382
chore: skip log spans
aryamohanan Jun 8, 2026
a5ddf2d
chore: fine tuning
aryamohanan Jun 8, 2026
6a50074
chore: fine tuning
aryamohanan Jun 8, 2026
3ad16aa
chore: renaming
aryamohanan Jun 9, 2026
a08be9d
chore: added events and links
aryamohanan Jun 9, 2026
e00e533
chore: revert
aryamohanan Jun 9, 2026
196fef7
chore: updated
aryamohanan Jun 9, 2026
30adf01
chore: more claenup
aryamohanan Jun 9, 2026
4bd48a6
chore: readme update
aryamohanan Jun 9, 2026
00b2113
chore: cleanup and test
aryamohanan Jun 9, 2026
06c6995
chore: updated span status logic
aryamohanan Jun 10, 2026
59f708a
chore: added some cleanup
aryamohanan Jun 10, 2026
5663ada
chore: metrics
aryamohanan Jun 10, 2026
2d590ad
chore: fixed timestap and duration
abhilash-sivan Jun 11, 2026
f5a3d23
chore: restructure
aryamohanan Jun 11, 2026
e41c3a5
chore: deleted unwanted files
aryamohanan Jun 11, 2026
aaec8ca
chore: more cleanup
aryamohanan Jun 11, 2026
80cb746
test: updated
aryamohanan Jun 12, 2026
562f0b1
chore: moved examples
aryamohanan Jun 12, 2026
1db4bf3
chore: fine tuning
aryamohanan Jun 12, 2026
a30c16a
chore: metrics
aryamohanan Jun 12, 2026
caeb442
chore: agentconnection
aryamohanan Jun 12, 2026
69c9b1f
chore: agentconnection
aryamohanan Jun 12, 2026
29a953c
chore: metrics handled
aryamohanan Jun 12, 2026
b20e504
chore: review comments
aryamohanan Jun 12, 2026
eaaae08
chore: resource
aryamohanan Jun 12, 2026
008d1c7
chore: updated
aryamohanan Jun 12, 2026
6be2f46
chore: updated
aryamohanan Jun 12, 2026
bb51823
chore: updated codebase
aryamohanan Jun 13, 2026
64e2b1e
chore: updated
aryamohanan Jun 15, 2026
b77b748
chore: handled dual transformation
abhilash-sivan Jun 15, 2026
5da3173
chore: corrected mappings from internal format
abhilash-sivan Jun 15, 2026
4322734
test: fix tests
abhilash-sivan Jun 15, 2026
02badb7
test: added azure blob test
abhilash-sivan Jun 15, 2026
c55829c
chore: improved metrics
aryamohanan Jun 15, 2026
7aafa4b
chore: improved metrics
aryamohanan Jun 15, 2026
8d6cbe3
chore: test
aryamohanan Jun 15, 2026
e10fce4
chore: test
aryamohanan Jun 15, 2026
583f6ac
chore: test
aryamohanan Jun 15, 2026
e87c0f2
chore: updated
aryamohanan Jun 15, 2026
75aeb24
chore: updated
aryamohanan Jun 15, 2026
1a007bd
chore: updated
aryamohanan Jun 16, 2026
cdb742d
chore: fine tuning
aryamohanan Jun 16, 2026
eb47c6f
chore: removed comments from agent conn
aryamohanan Jun 16, 2026
d433971
chore: fixed tests
aryamohanan Jun 16, 2026
05173ef
chore: updated
aryamohanan Jun 16, 2026
4af59e8
chore: handled error.type
abhilash-sivan Jun 16, 2026
01b5f1e
chore: config
aryamohanan Jun 16, 2026
bdbbfdf
chore: updated
aryamohanan Jun 16, 2026
6ff9ad1
chore: updated
aryamohanan Jun 16, 2026
e0cee93
chore: cleanup
aryamohanan Jun 16, 2026
4021ef5
chore: fine tuning
aryamohanan Jun 16, 2026
eeecb9c
chore: fine tuning
aryamohanan Jun 16, 2026
cfc3a89
chore: resource
aryamohanan Jun 16, 2026
5d64943
chore: resource
aryamohanan Jun 16, 2026
71fc888
chore: updated http span mapping for host and port
abhilash-sivan Jun 16, 2026
d166e2e
chore: clean code
aryamohanan Jun 16, 2026
41a3132
chore: clean metrics
aryamohanan Jun 16, 2026
df7aeb2
chore: clean code
aryamohanan Jun 16, 2026
ea6a864
chore: updated
aryamohanan Jun 17, 2026
730405e
chore: renamed
aryamohanan Jun 17, 2026
9a828cb
chore: renamed
aryamohanan Jun 17, 2026
c2c0749
chore: updated
aryamohanan Jun 17, 2026
94941b5
chore: updated
aryamohanan Jun 17, 2026
9fa4c3b
chore: updated
aryamohanan Jun 17, 2026
b0d8dee
chore: updated
aryamohanan Jun 17, 2026
7c91970
chore: updated mapping
aryamohanan Jun 18, 2026
064438a
chore: updated
aryamohanan Jun 18, 2026
998b922
chore: updated
aryamohanan Jun 18, 2026
2c57f9f
chore: renaming
aryamohanan Jun 18, 2026
421eec9
chore: extented unit tests
aryamohanan Jun 18, 2026
5adba2f
chore: extented unit tests
aryamohanan Jun 18, 2026
4fea828
chore: removed integretion test
aryamohanan Jun 18, 2026
157fb5d
chore: fixed spanBuffer test
aryamohanan Jun 18, 2026
803fc0b
test: extented test
aryamohanan Jun 19, 2026
5ed8aa7
chore: minor fix on config
aryamohanan Jun 19, 2026
1c1e7fb
chore: update
aryamohanan Jun 19, 2026
c9e5f4a
chore: updated correct version numeber
abhilash-sivan Jun 19, 2026
1fa80dd
chore: comments
abhilash-sivan Jun 19, 2026
d97706a
chore: kinesis
abhilash-sivan Jun 19, 2026
423df71
chore: kafka
abhilash-sivan Jun 19, 2026
2e1a60f
chore: ampq as rabbitmq
abhilash-sivan Jun 19, 2026
d4cb9bf
chore: nats
abhilash-sivan Jun 19, 2026
31442ad
chore: nats update and bull
abhilash-sivan Jun 19, 2026
454e6e8
test: fix semconv expectation
abhilash-sivan Jun 19, 2026
73a3092
chore: aws sqs
abhilash-sivan Jun 19, 2026
3f2ebbc
chore: aws sns span mapping
abhilash-sivan Jun 22, 2026
7ff7745
chore: gcp pubsub mapping
abhilash-sivan Jun 22, 2026
35258b5
chore: postgres mapping
abhilash-sivan Jun 22, 2026
ab6e66f
chore: mysql mapping
abhilash-sivan Jun 22, 2026
38ae171
chore: mssql mapping
abhilash-sivan Jun 22, 2026
d17d42d
chore: db2 mapping
abhilash-sivan Jun 22, 2026
3ac343f
chore: mongodb mapping
abhilash-sivan Jun 22, 2026
657a15d
chore: span map redis
abhilash-sivan Jun 22, 2026
21e56a7
chore: couchbase span mapping
abhilash-sivan Jun 22, 2026
1798ac0
chore: elasticsearch
abhilash-sivan Jun 22, 2026
ff86d9d
chore: dynamodb
abhilash-sivan Jun 22, 2026
0431468
chore: memcached
abhilash-sivan Jun 22, 2026
e94fbd9
chore: prisma
abhilash-sivan Jun 22, 2026
557b2e6
chore: comment for prisma
abhilash-sivan Jun 22, 2026
56702ef
chore: corrected the time property
aryamohanan Jun 23, 2026
ae9efba
chore: corrected the test
aryamohanan Jun 23, 2026
456cc1a
chore: fine tuning
aryamohanan Jun 23, 2026
d90ae4c
chore: fixed hostname
aryamohanan Jun 23, 2026
0f00fcc
chore: merge conflicts resolved
aryamohanan Jun 24, 2026
a19575c
chore: fine tuning
aryamohanan Jun 24, 2026
00a7f1d
chore: error code for http client
aryamohanan Jun 24, 2026
3c5f5b1
chore: unit tests coverage for mapper
aryamohanan Jun 24, 2026
531743a
chore: fixed type
aryamohanan Jun 24, 2026
ca71463
chore: updated integretion test
aryamohanan Jun 25, 2026
5dacca5
chore: updated
aryamohanan Jun 25, 2026
442187f
chore: fixed test failures
aryamohanan Jun 25, 2026
c980fa2
chore: fixed test failures
aryamohanan Jun 25, 2026
2544f90
chore: http mapping fine tuning
aryamohanan Jun 25, 2026
a354f6e
chore: mapping general improvements
aryamohanan Jun 25, 2026
c9ed716
chore: updated mapping tests
aryamohanan Jun 25, 2026
eb719f1
chore: updated mapping tests
aryamohanan Jun 25, 2026
0dff0c8
chore: updated
aryamohanan Jun 26, 2026
607e6d9
chore: agentconnection
aryamohanan Jun 26, 2026
dfaf341
chore: test updated
aryamohanan Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion example-apps/collector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js"
"start": "node src/index.js",
"start:otlp": "INSTANA_TRACING_OTLP_ENABLED=true node src/index.js"
},
"dependencies": {
"@instana/collector": "latest",
Expand Down
148 changes: 117 additions & 31 deletions packages/collector/src/agentConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const cmdline = require('./cmdline');
let logger;
/** @type {{ pid: number }} */
let pidStore;
/** @type {import('@instana/core/src/config').InstanaConfig} */
let config;
let isOtlpExporterEnabled = false;

// How many extra characters are to be reserved for the inode and
// file descriptor fields in the collector announce cycle.
Expand All @@ -31,19 +34,35 @@ let maxContentErrorHasBeenLogged = false;
const http = uninstrumentedHttp.http;
let isConnected = false;

/**
* @type {number | undefined}
*/
let otlpPort;

/** @type {string | null} */
let cpuSetFileContent = null;

/**
* @param {import('@instana/core/src/config').InstanaConfig} config
* @param {import('@instana/core/src/config').InstanaConfig} _config
* @param {any} _pidStore
*/
exports.init = function init(config, _pidStore) {
exports.init = function init(_config, _pidStore) {
config = _config;
logger = config.logger;
pidStore = _pidStore;

cmdline.init(config);
cpuSetFileContent = getCpuSetFileContent();
isOtlpExporterEnabled = config.tracing.otlp.enabled;
otlpPort = config.tracing.otlp.port;
};

/**
* @param {import('@instana/core/src/config').InstanaConfig} _config
*/
exports.activate = function activate(_config) {
config = _config;
isOtlpExporterEnabled = config.tracing.otlp.enabled;
};

exports.AgentEventSeverity = {
Expand Down Expand Up @@ -86,6 +105,37 @@ exports.AgentEventSeverity = {
* @property {string} [cpuSetFileContent]
*/

/** @type {Record<string, { otlpPath: string, instanaPath: () => string }>} */
const EXPORT_ENDPOINTS = {
traces: {
otlpPath: '/v1/traces',
instanaPath: () => `/com.instana.plugin.nodejs/traces.${pidStore.pid}`
},
metrics: {
otlpPath: '/v1/metrics',
instanaPath: () => `/com.instana.plugin.nodejs.${pidStore.pid}`
}
};

/**
* @param {string} type
* @returns { {path: string, port: number} }
*/
function resolveExportEndpoint(type) {
const endpoint = EXPORT_ENDPOINTS[type];

if (isOtlpExporterEnabled) {
return {
path: endpoint.otlpPath,
port: otlpPort
};
}

return {
path: endpoint.instanaPath(),
port: agentOpts.port
};
}
/**
* @param {(err: Error, rawResponse?: string) => void} callback
*/
Expand Down Expand Up @@ -307,13 +357,19 @@ function checkWhetherResponseForPathIsOkay(path, cb) {
exports.sendMetrics = function sendMetrics(data, cb) {
cb = util.atMostOnce('callback for sendMetrics', cb);

sendData(`/com.instana.plugin.nodejs.${pidStore.pid}`, data, (err, body) => {
if (err) {
cb(err, null);
} else {
const exportTarget = resolveExportEndpoint('metrics');
sendData({
...exportTarget,
data,
cb: (err, body) => {
if (err) {
cb(err, null);
return;
}

try {
// 2016-09-11
// Older sensor versions will not repond with a JSON
// Older sensor versions will not respond with a JSON
// structure. Support a smooth update path.
body = JSON.parse(body);
} catch (e) {
Expand All @@ -327,24 +383,33 @@ exports.sendMetrics = function sendMetrics(data, cb) {

/**
*
* @param {Array.<InstanaBaseSpan>} spans
* @param {Array.<InstanaBaseSpan>|Object} spans
* @param {(...args: *) => *} cb
*/
exports.sendSpans = function sendSpans(spans, cb) {
const callback = util.atMostOnce('callback for sendSpans', err => {
if (err && !maxContentErrorHasBeenLogged && err instanceof PayloadTooLargeError) {
logLargeSpans(spans);
if (Array.isArray(spans)) {
logLargeSpans(spans);
}
} else if (err) {
const spanInfo = getSpanLengthInfo(spans);
logger.debug(`Failed to send: ${JSON.stringify(spanInfo)}`);
} else {
if (Array.isArray(spans)) {
const spanInfo = getSpanLengthInfo(spans);
logger.debug(`Failed to send: ${JSON.stringify(spanInfo)}`);
}
} else if (Array.isArray(spans)) {
const spanInfo = getSpanLengthInfo(spans);
logger.debug(`Successfully sent: ${JSON.stringify(spanInfo)}`);
}
cb(err);
});

sendData(`/com.instana.plugin.nodejs/traces.${pidStore.pid}`, spans, callback, true);
const exportTarget = resolveExportEndpoint('traces');
sendData({
...exportTarget,
data: spans,
cb: callback,
ignore404: true
});
};

/**
Expand All @@ -364,7 +429,12 @@ exports.sendProfiles = function sendProfiles(profiles, cb) {
cb(err);
});

sendData(`/com.instana.plugin.nodejs/profiles.${pidStore.pid}`, profiles, callback);
sendData({
path: `/com.instana.plugin.nodejs/profiles.${pidStore.pid}`,
port: agentOpts.port,
data: profiles,
cb: callback
});
};

/**
Expand All @@ -375,8 +445,12 @@ exports.sendEvent = function sendEvent(eventData, cb) {
const callback = util.atMostOnce('callback for sendEvent', (err, responseBody) => {
cb(err, responseBody);
});

sendData('/com.instana.plugin.generic.event', eventData, callback);
sendData({
path: '/com.instana.plugin.generic.event',
port: agentOpts.port,
data: eventData,
cb: callback
});
};

/**
Expand All @@ -398,7 +472,12 @@ exports.sendAgentMonitoringEvent = function sendAgentMonitoringEvent(code, categ
cb(err, responseBody);
});

sendData('/com.instana.plugin.generic.agent-monitoring-event', event, callback);
sendData({
path: '/com.instana.plugin.generic.agent-monitoring-event',
port: agentOpts.port,
data: event,
cb: callback
});
};

/**
Expand All @@ -409,11 +488,12 @@ exports.sendAgentMonitoringEvent = function sendAgentMonitoringEvent(code, categ
exports.sendAgentResponseToAgent = function sendAgentResponseToAgent(messageId, response, cb) {
cb = util.atMostOnce('callback for sendAgentResponseToAgent', cb);

sendData(
`/com.instana.plugin.nodejs/response.${pidStore.pid}?messageId=${encodeURIComponent(messageId)}`,
response,
sendData({
path: `/com.instana.plugin.nodejs/response.${pidStore.pid}?messageId=${encodeURIComponent(messageId)}`,
port: agentOpts.port,
data: response,
cb
);
});
};

/**
Expand All @@ -425,17 +505,24 @@ exports.sendTracingMetricsToAgent = function sendTracingMetricsToAgent(tracingMe
cb(err);
});

sendData('/tracermetrics', tracingMetrics, callback);
sendData({
path: '/tracermetrics',
port: agentOpts.port,
data: tracingMetrics,
cb: callback
});
};

/**
* @param {string} path
* @param {*} data
* @param {(...args: *) => *} cb
* @param {boolean} [ignore404]
* @returns
* @param {Object} params
* @param {string} params.path
* @param {*} params.data
* @param {(...args: *) => *} params.cb
* @param {boolean} [params.ignore404]
* @param {number} params.port
* @returns {*}
*/
function sendData(path, data, cb, ignore404 = false) {
function sendData({ path, data, cb, ignore404 = false, port }) {
cb = util.atMostOnce(`callback for sendData: ${path}`, cb);

const payloadAsString = JSON.stringify(data, circularReferenceRemover());
Expand All @@ -451,11 +538,10 @@ function sendData(path, data, cb, ignore404 = false) {
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: agentOpts.port,
port,
path,
method: 'POST',
agent: http.agent,
Expand Down
14 changes: 9 additions & 5 deletions packages/collector/src/announceCycle/agentready.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ function enter(_ctx) {

logger.debug(`isMainThread: ${isMainThread}`);

const updatedConfig = coreConfig.update({
externalConfig: agentOpts.config,
source: util.constants.CONFIG_SOURCES.AGENT
});

agentConnection.activate(updatedConfig);

if (isMainThread) {
uncaught.activate();
metrics.activate();
Expand All @@ -122,18 +129,15 @@ function enter(_ctx) {
},
function onError() {
ctx.transitionTo('unannounced');
}
},
updatedConfig
);
scheduleTracingMetrics();
if (!disableEOLEvents) {
detectEOLNodeVersion();
}
}

const updatedConfig = coreConfig.update({
externalConfig: agentOpts.config,
source: util.constants.CONFIG_SOURCES.AGENT
});
tracing.activate(updatedConfig);

if (agentOpts.autoProfile && autoprofile) {
Expand Down
25 changes: 25 additions & 0 deletions packages/collector/src/announceCycle/unannounced.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const maxRetryDelay = 60 * 1000; // one minute
* @typedef {Object} TracingConfig
* @property {Array.<string>} [extra-http-headers]
* @property {KafkaTracingConfig} [kafka]
* @property {OtlpConfig} [otlp]
* @property {import('@instana/core/src/config/types').IgnoreEndpoints} [ignore-endpoints]
* @property {boolean} [span-batching-enabled]
* @property {import('@instana/core/src/config/types').Disable} [disable]
Expand All @@ -62,6 +63,12 @@ const maxRetryDelay = 60 * 1000; // one minute
* @property {boolean} [trace-correlation]
*/

/**
* @typedef {Object} OtlpConfig
* @property {boolean} [enabled]
* @property {number} [port]
*/

/**
* @param {import('@instana/core/src/config').InstanaConfig} config
* @param {any} _pidStore
Expand Down Expand Up @@ -128,6 +135,7 @@ function applyAgentConfiguration(agentResponse) {
applySecretsConfiguration(agentResponse);
applyExtraHttpHeaderConfiguration(agentResponse);
applyKafkaTracingConfiguration(agentResponse);
applyOtlpExporterConfiguration(agentResponse);
applySpanBatchingConfiguration(agentResponse);
applyIgnoreEndpointsConfiguration(agentResponse);
applyStackTraceConfiguration(agentResponse);
Expand Down Expand Up @@ -208,6 +216,23 @@ function applyKafkaTracingConfiguration(agentResponse) {
// were only introduced with the Node.js discovery version 1.2.18.
}

/**
* @param {AgentAnnounceResponse} agentResponse
*/
function applyOtlpExporterConfiguration(agentResponse) {
if (agentResponse.tracing && agentResponse.tracing.otlp) {
const otlpConfigFromAgent = /** @type {Record<string, any>} */ (agentResponse.tracing.otlp);
ensureNestedObjectExists(agentOpts.config, ['tracing', 'otlp']);

Object.keys(otlpConfigFromAgent).forEach(key => {
const value = otlpConfigFromAgent[key];
if (value != null) {
/** @type {Record<string, any>} */ (agentOpts.config.tracing.otlp)[key] = value;
}
});
}
}

/**
* @param {AgentAnnounceResponse} agentResponse
*/
Expand Down
Loading