How to use the @azure/core-tracing.getTracer function in @azure/core-tracing

To help you get started, we’ve selected a few @azure/core-tracing 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 / keyvault / keyvault-secrets / src / index.ts View on Github external
private createSpan(methodName: string, requestOptions: RequestOptionsBase = {}): Span {
    const tracer = getTracer();
    return tracer.startSpan(methodName, requestOptions && requestOptions.spanOptions);
  }
github Azure / azure-sdk-for-js / sdk / appconfiguration / app-configuration / src / internal / tracingHelpers.ts View on Github external
private createSpan(options: T, operationName: keyof TClient) {
    const span = getTracer().startSpan(`${this.baseOperationName}.${operationName}`, {
      ...options.spanOptions,
      kind: SpanKind.INTERNAL
    });

    let newOptions = options;

    if (span.isRecording()) {
      newOptions = Spanner.addParentToOptions(options, span);
    }
    return { span, newOptions };
  }
github Azure / azure-sdk-for-js / sdk / storage / storage-file-datalake / src / utils / tracing.ts View on Github external
export function createSpan(
  operationName: string,
  tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
  const tracer = getTracer();
  const spanOptions: SpanOptions = {
    ...tracingOptions.spanOptions,
    kind: SpanKind.INTERNAL
  };

  const span = tracer.startSpan(`Azure.Storage.DataLake.${operationName}`, spanOptions);

  let newOptions = tracingOptions.spanOptions || {};
  if (span.isRecording()) {
    newOptions = {
      ...tracingOptions,
      parent: span
    };
  }

  return {
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / diagnostics / messageSpan.ts View on Github external
export function createMessageSpan(parentSpan?: Span | SpanContext): Span {
  const tracer = getTracer();
  const span = tracer.startSpan("Azure.EventHubs.message", {
    kind: SpanKind.PRODUCER,
    parent: parentSpan
  });

  return span;
}
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / partitionPump.ts View on Github external
): Span {
  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;
}
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / sender.ts View on Github external
private _createSendSpan(
    parentSpan?: Span | SpanContext,
    spanContextsToLink: SpanContext[] = []
  ): Span {
    const links: Link[] = spanContextsToLink.map((spanContext) => {
      return {
        spanContext
      };
    });
    const tracer = getTracer();
    const span = tracer.startSpan("Azure.EventHubs.send", {
      kind: SpanKind.CLIENT,
      parent: parentSpan,
      links
    });

    span.setAttribute("message_bus.destination", this._eventHubName);
    span.setAttribute("peer.address", this._endpoint);

    return span;
  }
github Azure / azure-sdk-for-js / sdk / storage / storage-utils / tracing.ts View on Github external
export function createSpan(
  operationName: string,
  tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
  const tracer = getTracer();
  const spanOptions: SpanOptions = {
    ...tracingOptions.spanOptions,
    kind: SpanKind.INTERNAL
  };

  const span = tracer.startSpan(`Azure.Storage.Blob.${operationName}`, spanOptions);

  let newOptions = tracingOptions.spanOptions || {};
  if (span.isRecording()) {
    newOptions = {
      ...tracingOptions,
      parent: span
    };
  }

  return {
github Azure / azure-sdk-for-js / sdk / keyvault / keyvault-keys / src / index.ts View on Github external
private createSpan(methodName: string, requestOptions?: RequestOptionsBase): Span {
    const tracer = getTracer();
    return tracer.startSpan(methodName, requestOptions && requestOptions.spanOptions);
  }

@azure/core-tracing

Provides low-level interfaces and helper methods for tracing in Azure SDK

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis