Socket
Socket
Sign inDemoInstall

@opentelemetry/propagator-aws-xray

Package Overview
Dependencies
3
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @opentelemetry/propagator-aws-xray

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


Version published
Maintainers
3
Install size
2.50 MB
Created

Changelog

Source

1.24.1

:bug: (Bug Fix)

  • fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used #4648 @pichlermarc
    • getEnvWithoutDefaults() would use process.env if it was defined when running in a browser, while getEnv() would always use _globalThis. Now both use _globalThis when running in a browser.
  • fix(resources): prevent circular import (resource -> detector -> resource -> ...) #4653 @pichlermarc
    • fixes a circular import warning which would appear in rollup when bundling @opentelemetry/resources
  • fix(exporter-metrics-otlp-grpc): add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc #4678 @AkselAllas

Readme

Source

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.

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Last updated on 07 May 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc