Javascript APM agent pass message with transaction


(Sundar) #1

I'm using Javascript APM agent, I need to sent my report information to APM server. I want to sent below messages with two transactions with different customContext message. Actually what it happend is customContext message is same for two transactions. Could you please suggest , any other logics availble for this scenrio.

message = [{"name": "abc"}, {"name": xyz}]
apm = InitApm.init({
    'serviceName': serviceName,
    'serverUrl': serverUrl
});
for (msg in message) {
	name = 'transaction-name' + msg.name;
	transaction = apm.startTransaction(transactionName, 'custom');
    httpSpan = transaction.startSpan(null, null);
    apm.setCustomContext(msg);
    httpSpan.end();
    transaction.end();
}

(Hamidreza Jahtalabziabari) #2

Hi,

Thanks for your interest in Elastic APM.
The apm.setCustomContext sets the global custom context that will be included in every transaction and error. Currently we don't support setting context on individual transactions, I have created this issue to keep track of this feature request. Please feel free to make comments on the issue.

Cheers,
Hamid


(Sundar) #3

Thank you for your reply.


(system) #4

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.