0.27.2 • Published 7 months ago

@opentelemetry/propagator-grpc-census-binary v0.27.2

Weekly downloads
43
License
Apache-2.0
Repository
github
Last release
7 months ago

OpenTelemetry Propagator gRPC Census

NPM Published Version Apache License

OpenTelemetry gRPC Census propagator provides gRPC header propagation for systems that use the OpenCensus 'grpc-trace-bin' binary header format. This allows for context propagation when either:

  • incoming gRPC calls come from services already instrumented using OpenCensus
  • outgoing gRPC calls go to services already instrumented using OpenCensus

This propagator works in conjunction with the OpenTelemetry gRPC plugin.

Example of usage:

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { GrpcCensusPropagator } = require('@opentelemetry/propagator-grpc-census-binary');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GrpcInstrumentation } = require('opentelemetry/instrumentation-grpc');

const provider = new NodeTracerProvider();

// Register GrpcCensusPropagator so we can propagate content using
// the 'grpc-trace-bin' header in our incoming/outgoing gRPC calls.
provider.register({
  propagator: new GrpcCensusPropagator()
});

registerInstrumentations({
  instrumentations: [
    new GrpcInstrumentation(),
  ],
});

Also, see examples/grpc-census-prop for a worked example that shows when this propagator can be useful.

Implementation Details

See binary-format.ts for equivalent encoding/decoding of the format in OpenCensus. Note: the author of the OpenCensus binary format, @mayurkale22, also created BinaryTraceContext.ts in opentelemetry-core but that was subsequently removed as part of PR #804. The implementation of GrpcCensusPropagator in this module uses a version of BinaryTraceContext.ts inspired by Mayur's previous work (with minor modifications e.g. there is no longer a BinaryFormat interface to implement).

Useful links

License

Apache 2.0 - See LICENSE for more information.

0.27.2

7 months ago

0.27.1

1 year ago

0.27.0

1 year ago

0.26.1

2 years ago

0.26.0

3 years ago

0.25.1

3 years ago

0.25.0

3 years ago

0.24.0

3 years ago

0.23.0

3 years ago

0.22.0

3 years ago

0.21.0

3 years ago

0.20.0

3 years ago

0.16.0

4 years ago

0.15.0

4 years ago

0.14.0

4 years ago

0.13.1

4 years ago

0.13.0

4 years ago

0.12.1

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago