Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const links: Link[] = [];
for (const receivedEvent of receivedEvents) {
const spanContext = extractSpanContextFromEventData(receivedEvent);
if (spanContext == null) {
continue;
}
links.push({
spanContext
});
}
const span = getTracer().startSpan("Azure.EventHubs.process", {
kind: SpanKind.CONSUMER,
links,
parent: getParentSpan(tracingOptions)
});
span.setAttributes({
component: "eventhubs",
"message_bus.destination": eventHubProperties.eventHubName,
"peer.address": eventHubProperties.endpoint
});
return span;
}