1 | # OpenCensus B3 Format Propagation for Node.js
|
2 | [![Gitter chat][gitter-image]][gitter-url]
|
3 |
|
4 | OpenCensus 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 |
|
6 | The library is in alpha stage and the API is subject to change.
|
7 |
|
8 | ## Installation
|
9 |
|
10 | Install OpenCensus B3 Propagation with:
|
11 | ```bash
|
12 | npm install @opencensus/propagation-b3
|
13 | ```
|
14 |
|
15 | ## Usage
|
16 |
|
17 | To propagate span context arround services with B3 Propagation, pass an instance of B3 Propagation to your tracing instance. For Javascript:
|
18 |
|
19 | ```javascript
|
20 | const tracing = require('@opencensus/nodejs');
|
21 | const propagation = require('@opencensus/propagation-b3');
|
22 |
|
23 | const b3 = new propagation.B3Format();
|
24 |
|
25 | tracing.start({propagation: b3});
|
26 | ```
|
27 |
|
28 | Similarly for Typescript:
|
29 |
|
30 | ```typescript
|
31 | import * as tracing from '@opencensus/nodejs';
|
32 | import { B3Format } from '@opencensus/propagation-b3';
|
33 |
|
34 | const b3 = new B3Format();
|
35 |
|
36 | tracing.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
|