How to use the @opentelemetry/types.SpanKind.CONSUMER function in @opentelemetry/types

To help you get started, we’ve selected a few @opentelemetry/types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / partitionPump.ts View on Github external
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;
}