How to use the jaeger-client/dist/src/util.default.encodeInt64 function in jaeger-client

To help you get started, we’ve selected a few jaeger-client 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 census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
}`.slice(-32);

  const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: getThriftReference(span.links),
    flags: span.spanContext.options || 0x1,
    startTime: Utils.encodeInt64(span.startTime.getTime() * 1000), // to microseconds
    duration: Utils.encodeInt64(span.duration * 1000), // to microseconds
    tags: spanTags,
    logs: spanLogs,
  };
}
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
const parentSpan: string | Buffer = span.parentSpanId
    ? Utils.encodeInt64(span.parentSpanId)
    : ThriftUtils.emptyBuffer;

  const traceId = `00000000000000000000000000000000${
    span.spanContext.traceId
  }`.slice(-32);

  const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: getThriftReference(span.links),
    flags: span.spanContext.options || 0x1,
    startTime: Utils.encodeInt64(span.startTime.getTime() * 1000), // to microseconds
    duration: Utils.encodeInt64(span.duration * 1000), // to microseconds
    tags: spanTags,
    logs: spanLogs,
  };
}
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
? Utils.encodeInt64(span.parentSpanId)
    : ThriftUtils.emptyBuffer;

  const traceId = `00000000000000000000000000000000${
    span.spanContext.traceId
  }`.slice(-32);

  const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: getThriftReference(span.links),
    flags: span.spanContext.options || 0x1,
    startTime: Utils.encodeInt64(span.startTime.getTime() * 1000), // to microseconds
    duration: Utils.encodeInt64(span.duration * 1000), // to microseconds
    tags: spanTags,
    logs: spanLogs,
  };
}
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
const parentSpan: string | Buffer = span.parentSpanId
    ? Utils.encodeInt64(span.parentSpanId)
    : ThriftUtils.emptyBuffer;

  const traceId = `00000000000000000000000000000000${
    span.spanContext.traceId
  }`.slice(-32);

  const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: getThriftReference(span.links),
    flags: span.spanContext.options || 0x1,
    startTime: Utils.encodeInt64(span.startTime.getTime() * 1000), // to microseconds
    duration: Utils.encodeInt64(span.duration * 1000), // to microseconds
    tags: spanTags,
    logs: spanLogs,
  };
}
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,
    operationName: span.name,
    references: getThriftReference(span.links),
    flags: span.spanContext.options || 0x1,
    startTime: Utils.encodeInt64(span.startTime.getTime() * 1000), // to microseconds
    duration: Utils.encodeInt64(span.duration * 1000), // to microseconds
    tags: spanTags,
    logs: spanLogs,
  };
}
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
(link): ThriftReference | null => {
        const refType = getThriftType(link.type);
        if (!refType) return null;

        const traceId = `00000000000000000000000000000000${link.traceId}`.slice(
          -32
        );
        const traceIdHigh = Utils.encodeInt64(traceId.slice(0, 16));
        const traceIdLow = Utils.encodeInt64(traceId.slice(16));
        const spanId = Utils.encodeInt64(link.spanId);
        return { traceIdLow, traceIdHigh, spanId, refType };
      }
    )
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
(link): ThriftReference | null => {
        const refType = getThriftType(link.type);
        if (!refType) return null;

        const traceId = `00000000000000000000000000000000${link.traceId}`.slice(
          -32
        );
        const traceIdHigh = Utils.encodeInt64(traceId.slice(0, 16));
        const traceIdLow = Utils.encodeInt64(traceId.slice(16));
        const spanId = Utils.encodeInt64(link.spanId);
        return { traceIdLow, traceIdHigh, spanId, refType };
      }
    )
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
(link): ThriftReference | null => {
        const refType = getThriftType(link.type);
        if (!refType) return null;

        const traceId = `00000000000000000000000000000000${link.traceId}`.slice(
          -32
        );
        const traceIdHigh = Utils.encodeInt64(traceId.slice(0, 16));
        const traceIdLow = Utils.encodeInt64(traceId.slice(16));
        const spanId = Utils.encodeInt64(link.spanId);
        return { traceIdLow, traceIdHigh, spanId, refType };
      }
    )
github census-instrumentation / opencensus-node / packages / opencensus-exporter-jaeger / src / jaeger-driver / index.ts View on Github external
if (span.annotations) {
    span.annotations.forEach(ann => {
      const tags: Tag[] = [];
      Object.keys(ann.attributes).forEach(key => {
        tags.push({ key, value: ann.attributes[key] });
      });
      tags.push({ key: 'description', value: ann.description });
      logs.push({
        timestamp: ann.timestamp,
        fields: tags,
      });
    });
  }

  const parentSpan: string | Buffer = span.parentSpanId
    ? Utils.encodeInt64(span.parentSpanId)
    : ThriftUtils.emptyBuffer;

  const traceId = `00000000000000000000000000000000${
    span.spanContext.traceId
  }`.slice(-32);

  const high = traceId.slice(0, 16);
  const low = traceId.slice(16);
  const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags);
  const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs);

  return {
    traceIdLow: Utils.encodeInt64(low),
    traceIdHigh: Utils.encodeInt64(high),
    spanId: Utils.encodeInt64(span.spanContext.spanId),
    parentSpanId: parentSpan,