Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
poller.on('message', function(msg) {
const span = tracer.startSpan('message');
span.setTag('service.name', 'message-cards');
span.setTag('resource.name', 'message');
tracer.scopeManager().activate(span);
console.log(JSON.stringify(msg.body));
msg.del();
span.finish();
});
const createCommand = (command: string) => (
promise: Promise
): Promise => {
const parentScope = tracer.scopeManager().active()
const span = tracer.startSpan("memcached", {
childOf: parentScope && parentScope.span(),
tags: {
[Tags.SPAN_KIND]: Tags.SPAN_KIND_RPC_CLIENT,
[Tags.DB_TYPE]: "memcached",
"service.name": `${DD_TRACER_SERVICE_NAME}.memcached`,
"resource.name": command,
"span.type": "memcached",
},
})
return promise.then(
result => {
span.finish()
return result
},