Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws/otel-aws-xray-propagator

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws/otel-aws-xray-propagator

OpenTelemetry AWS Xray propagator provides HTTP header propagation for systems that are using AWS Xray HTTP header format.

  • 0.12.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
273
increased by58.72%
Maintainers
2
Weekly downloads
 
Created
Source

OpenTelemetry Propagator AWS X-Ray

Gitter chat Apache License

The OpenTelemetry Propagator for AWS X-Ray provides HTTP header propagation for systems that are using AWS X-Ray HTTP header format. This propagator translates the OpenTelemetry SpanContext into the equivalent AWS X-Ray header format, for use with the OpenTelemetry JS SDK.

Installation

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

Usage

In the global tracer configuration file, configure the following:

const { propagation } = require("@opentelemetry/api");
const { AwsXRayPropagator } = require('@aws-observability/propagator-aws-xray');
// ...

module.exports = ("service_name_here") => {
  // set global propagator
  propagation.setGlobalPropagator(new AwsXRayPropagator());
  // ...}

For more details, see the Getting Started guide.

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. The root is required, whereas the parent ID and sampling decision are optional.

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, encoded from time(second) when created. Populated by taking the first 8 characters of the OpenTelemetry trace ID.
    • UUID - 96-bit random number in base16 format. Populated by taking 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.
  • Populated from the OpenTelemetry trace flags.

Example of usage (will be added after published):

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 21 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc