npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opentelemetry/propagator-aws-xray

v1.26.0

Published

OpenTelemetry AWS Xray propagator provides context propagation for systems that are using AWS X-Ray format.

Downloads

3,871,860

Readme

OpenTelemetry Propagator AWS X-Ray

NPM Published Version Apache License

The OpenTelemetry Propagator for AWS X-Ray provides HTTP header propagation for systems that are using AWS X-Amzn-Trace-Id format. This propagator translates the OpenTelemetry SpanContext into the equivalent AWS header format, for use with the OpenTelemetry JS SDK. TraceState is currently not propagated.

This package was originally located in opentelemetry-js-contrib. It has been moved in order to make it a direct dependency of the Node SDK. As a result, versions from 1.4.0 to 1.22.0 have been skipped.

Installation

npm install --save @opentelemetry/propagator-aws-xray

Usage

In the global tracer configuration file, configure the following:

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { AWSXRayPropagator } = require('@opentelemetry/propagator-aws-xray');
// ...

const provider = new NodeTracerProvider();

// Set the global trace context propagator to use X-Ray formatted trace header
provider.register({
  propagator: new AWSXRayPropagator()
});

Propagator Details

Example header:X-Amzn-Trace-Id: Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1

The header consists of three parts: the root trace ID, the parent ID and the sampling decision.

Root - The AWS X-Ray format trace ID

  • Format: (spec-version)-(timestamp)-(UUID)
    • spec_version - The version of the AWS X-Ray header format. Currently, only "1" is valid.
    • timestamp - 32-bit number in base16 format, corresponds to the first 8 characters of the OpenTelemetry trace ID. Note, while X-Ray calls this timestamp, for the purpose of propagation it is opaque and any value will work.
    • UUID - 96-bit random number in base16 format, corresponds to the last 10 characters of the OpenTelemetry trace ID.

Root is analogous to the OpenTelemetry Trace ID, with some small format changes. For additional reading, see the AWS X-Ray Trace ID public documentation.

Parent - The ID of the AWS X-Ray Segment

Sampled - The sampling decision

  • Defined in the AWS X-Ray specification as a tri-state field, with "0", "1" and "?" as valid values. Only "0" and "1" are used in this propagator. If "?", a new trace will be started.
  • Populated from the OpenTelemetry trace flags.

Useful links

License

Apache 2.0 - See LICENSE for more information.