Normally Pleasant Mixture

    This package has been deprecated

    Author message:

    No longer supported, use @opentelemetry/id-generator-aws-xray instead

    @aws/otel-aws-xray-id-generator
    TypeScript icon, indicating that this package has built-in type declarations

    0.13.1 • Public • Published

    AWS OpenTelemetry X-Ray IdGenerator README

    Gitter chat Apache License

    The OpenTelemetry IdGenerator for AWS X-Ray generates trace IDs with its first four bytes set to the start time of the trace followed by a unique identifier consisting of 12 bytes of randomly generated numbers. OpenTelemetry offers an extension point which allows the usage of this custom IdGenerator as opposed to the out-of-the-box random IdGenerator.

    Installation

    npm install --save @aws/otel-aws-xray-id-generator

    Usage

    In the global tracer configuration file, configure the following:

    const { NodeTracerProvider } = require('@opentelemetry/node');
    const { AWSXRayIdGenerator } = require('@aws/otel-aws-xray-id-generator');
    // ...
    
    module.exports = ("service_name_here") => {
       const tracerConfig = {
        idGenerator: new AWSXRayIdGenerator(),
        resources: resources
      };
      const tracerProvider = new NodeTracerProvider(tracerConfig);
      // ...}

    For more details, see the Getting Started guide.

    Trace ID Details

    Example trace ID format: 58406520a006649127e371903a2de979

    A trace ID consists of two parts; the time stamp and the unique identifier.

    Time Stamp

    • the first 8 hexadecimal digits represent the time of the original request in Unix epoch time
    • for example, 10:00AM December 1st, 2016 PST in epoch time is 1480615200 seconds, or 58406520 in hexadecimal digits.

    Unique Identifier

    • the last 24 hexadecimal digits is an unique identifier for the trace

    Useful links

    License

    Apache 2.0 - See LICENSE for more information.

    Install

    npm i @aws/otel-aws-xray-id-generator

    DownloadsWeekly Downloads

    1,159

    Version

    0.13.1

    License

    Apache-2.0

    Unpacked Size

    20.4 kB

    Total Files

    23

    Last publish

    Collaborators

    • allenyin96
    • alolita