UNPKG

1.59 kBMarkdownView Raw
1# OpenCensus B3 Format Propagation for Node.js
2[![Gitter chat][gitter-image]][gitter-url]
3
4OpenCensus B3 Format Propagation sends a span context on the wire in an HTTP request, allowing other services to create spans with the right context.
5
6The library is in alpha stage and the API is subject to change.
7
8## Installation
9
10Install OpenCensus B3 Propagation with:
11```bash
12npm install @opencensus/propagation-b3
13```
14
15## Usage
16
17To propagate span context arround services with B3 Propagation, pass an instance of B3 Propagation to your tracing instance. For Javascript:
18
19```javascript
20const tracing = require('@opencensus/nodejs');
21const propagation = require('@opencensus/propagation-b3');
22
23const b3 = new propagation.B3Format();
24
25tracing.start({propagation: b3});
26```
27
28Similarly for Typescript:
29
30```typescript
31import * as tracing from '@opencensus/nodejs';
32import { B3Format } from '@opencensus/propagation-b3';
33
34const b3 = new B3Format();
35
36tracing.start({propagation: b3});
37```
38
39## Useful links
40- To know more about B3 Format propagation, visit: <https://github.com/openzipkin/b3-propagation>
41- For more information on OpenCensus, visit: <https://opencensus.io/>
42- To checkout the OpenCensus for Node.js, visit: <https://github.com/census-instrumentation/opencensus-node>
43- For help or feedback on this project, join us on [gitter](https://gitter.im/census-instrumentation/Lobby)
44
45[gitter-image]: https://badges.gitter.im/census-instrumentation/lobby.svg
46[gitter-url]: https://gitter.im/census-instrumentation/lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge