How to use the @opentelemetry/core.hrTimeToMicroseconds function in @opentelemetry/core

To help you get started, we’ve selected a few @opentelemetry/core 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 open-telemetry / opentelemetry-js / packages / opentelemetry-tracing / src / export / ConsoleSpanExporter.ts View on Github external
private _exportInfo(span: ReadableSpan) {
    return {
      traceId: span.spanContext.traceId,
      parentId: span.parentSpanId,
      name: span.name,
      id: span.spanContext.spanId,
      kind: span.kind,
      timestamp: hrTimeToMicroseconds(span.startTime),
      duration: hrTimeToMicroseconds(span.duration),
      attributes: span.attributes,
      status: span.status,
      events: span.events,
    };
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-exporter-zipkin / src / transform.ts View on Github external
return events.map(event => ({
    timestamp: hrTimeToMicroseconds(event.time),
    value: event.name,
  }));
}
github open-telemetry / opentelemetry-js / packages / opentelemetry-tracing / src / export / ConsoleSpanExporter.ts View on Github external
private _exportInfo(span: ReadableSpan) {
    return {
      traceId: span.spanContext.traceId,
      parentId: span.parentSpanId,
      name: span.name,
      id: span.spanContext.spanId,
      kind: span.kind,
      timestamp: hrTimeToMicroseconds(span.startTime),
      duration: hrTimeToMicroseconds(span.duration),
      attributes: span.attributes,
      status: span.status,
      events: span.events,
    };
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-exporter-jaeger / src / transform.ts View on Github external
);
      }
      return { timestamp: hrTimeToMilliseconds(event.time), fields };
    }
  );
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(traceIdLow),
    traceIdHigh: Utils.encodeInt64(traceIdHigh),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: spanLinksToThriftRefs(span.links, span.parentSpanId),
    flags: span.spanContext.traceFlags || DEFAULT_FLAGS,
    startTime: Utils.encodeInt64(hrTimeToMicroseconds(span.startTime)),
    duration: Utils.encodeInt64(hrTimeToMicroseconds(span.duration)),
    tags: spanTags,
    logs: spanLogs,
  };
}