Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit bb6db53

Browse files
Update changelog and scripts for B3 propagation (#176)
1 parent 06a6034 commit bb6db53

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
- run: .circleci/publish.sh exporter-ocagent $WOMBAT_TOKEN_EXPORTER_OCAGENT
5757
- run: .circleci/publish.sh instrumentation-perf $WOMBAT_TOKEN_INSTRUMENTATION_PERF
5858
- run: .circleci/publish.sh propagation-tracecontext "$WOMBAT_TOKEN_PROPAGATION_TRACECONTEXT"
59+
- run: .circleci/publish.sh propagation-b3 "$WOMBAT_TOKEN_PROPAGATION_B3"
5960
- run: .circleci/publish.sh scripts "$WOMBAT_TOKEN_SCRIPTS"
6061
- run: .circleci/publish.sh types "$WOMBAT_TOKEN_TYPES"
6162
- run: .circleci/publish.sh instrumentation-zone $WOMBAT_TOKEN_INSTRUMENTATION_ZONE

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## unreleased
5+
## Unreleased
6+
7+
- Support for B3 propagation with new `@opencensus/web-propagation-b3` package
8+
and the ability to pass it in via `startTracing({ propagation: Propagation })`.
9+
Thanks @edvinasbartkus!
610

711
## 0.0.6 - 2019-08-26
812

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ If you already have a JS build pipeline using e.g. webpack or similar, you can d
307307
// As the tracing has started, the coming user interactions ares also traced.
308308
startTracing();
309309
```
310+
The default propagation uses the [W3C Trace Context](https://www.w3.org/TR/trace-context/) format. You can also use
311+
[Zipkin's B3 Propagation](https://github.com/openzipkin/b3-propagation). See the
312+
[@opencensus/web-propagation-b3 README][package-web-propagation-b3] for details.
310313

311314
### 3. Optional: Send a trace parent and sampling decision from your server
312315

@@ -448,6 +451,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
448451
[package-web-initial-load]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-initial-load
449452
[package-web-instrumentation-perf]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-perf
450453
[package-web-propagation-tracecontext]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-propagation-tracecontext
454+
[package-web-propagation-b3]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-propagation-b3
451455
[package-web-types]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-types
452456
[package-web-instrumentation-zone]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-zone
453457
[package-web-instrumentation-zone-peer-dep]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-zone-peer-dep

RELEASING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ publishes the packages to NPM. See the
6262

6363
## Update CHANGELOG and release versions in examples
6464
* After releasing, you need to update all examples to the latest version.
65+
* You will also need to update the `src` tags of `<script>` links in
66+
`README.md` with not only their latest version but also their updated SHA
67+
hashes. Use [srihash.org/](https://www.srihash.org/) to easily generate these.
6568
* In addition, update the CHANGELOG.md and start new Unreleased label.
6669
* Create a new commit with the exact title: `Post Release: update CHANGELOG, Examples and ReadMe`.
6770
* Go through PR review and merge it to GitHub master branch.

packages/opencensus-web-propagation-b3/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ See the [OpenCensus Web readme][oc-web-readme-url] for details.
2020
This is used to propagate trace contextspans for XHRs in the user interactions,
2121
serializing a `B3` headers to send along to XHR calls.
2222

23+
It gets passed as an option to the `startTracing` function as follows:
24+
25+
```js
26+
// Use @opencensus/web-instrumentation-zone-peer-dep instead in case your app
27+
// already uses `Zone.js`.
28+
import { startTracing } from '@opencensus/web-instrumentation-zone';
29+
import { B3Format } from '@opencensus/web-propagation-b3';
30+
31+
window.ocAgent = 'https://example.com/my-opencensus-agent-endpoint';
32+
window.ocSampleRate = 1.0; // Sample at 100% for test only. Default is 1/10000.
33+
// Send the trace header to all hosts.
34+
window.ocTraceHeaderHostRegex = /.*/;
35+
36+
// This methods starts the tracing and exports the initial page load trace.
37+
// As the tracing has started, the coming user interactions ares also traced.
38+
startTracing({ propagation: new B3Format() });
39+
```
40+
2341
## Useful links
2442
- For more information on OpenCensus, visit: <https://opencensus.io/>
2543
- For more about OpenCensus Web: <https://github.com/census-instrumentation/opencensus-web>

0 commit comments

Comments
 (0)