@google-cloud/opentelemetry-cloud-trace-propagator
TypeScript icon, indicating that this package has built-in type declarations

0.17.0 • Public • Published

OpenTelemetry Google Cloud Trace Propagator

NPM Published Version Apache License

OpenTelemetry Google Cloud Trace Propagator allows other services to create spans with the right context.

Format: TRACE_ID/SPAN_ID;o=TRACE_TRUE

  • {TRACE_ID}

    • is a 32-character hexadecimal value representing a 128-bit number.
    • It should be unique between your requests, unless you intentionally want to bundle the requests together.
  • {SPAN_ID}

    • is the decimal representation of the (unsigned) span ID.
    • It should be randomly generated and unique in your trace.
    • For subsequent requests, set SPAN_ID to the span ID of the parent request.
  • {TRACE_TRUE}

    • must be 1 to trace request. Specify 0 to not trace the request.

Usage

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { CloudPropagator } = require('@google-cloud/opentelemetry-cloud-trace-propagator');

const provider = new NodeTracerProvider();
provider.register({
  // Use CloudPropagator
  propagator: new CloudPropagator()
});

Useful links

Dependents (14)

Package Sidebar

Install

npm i @google-cloud/opentelemetry-cloud-trace-propagator

Weekly Downloads

95,328

Version

0.17.0

License

Apache-2.0

Unpacked Size

21.6 kB

Total Files

9

Last publish

Collaborators

  • google-wombot
  • google-admin