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

Commit

Permalink
Update changelog and scripts for B3 propagation (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
draffensperger authored Sep 10, 2019
1 parent 06a6034 commit bb6db53
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- run: .circleci/publish.sh exporter-ocagent $WOMBAT_TOKEN_EXPORTER_OCAGENT
- run: .circleci/publish.sh instrumentation-perf $WOMBAT_TOKEN_INSTRUMENTATION_PERF
- run: .circleci/publish.sh propagation-tracecontext "$WOMBAT_TOKEN_PROPAGATION_TRACECONTEXT"
- run: .circleci/publish.sh propagation-b3 "$WOMBAT_TOKEN_PROPAGATION_B3"
- run: .circleci/publish.sh scripts "$WOMBAT_TOKEN_SCRIPTS"
- run: .circleci/publish.sh types "$WOMBAT_TOKEN_TYPES"
- run: .circleci/publish.sh instrumentation-zone $WOMBAT_TOKEN_INSTRUMENTATION_ZONE
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

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

## unreleased
## Unreleased

- Support for B3 propagation with new `@opencensus/web-propagation-b3` package
and the ability to pass it in via `startTracing({ propagation: Propagation })`.
Thanks @edvinasbartkus!

## 0.0.6 - 2019-08-26

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

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

Expand Down Expand Up @@ -448,6 +451,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[package-web-initial-load]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-initial-load
[package-web-instrumentation-perf]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-perf
[package-web-propagation-tracecontext]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-propagation-tracecontext
[package-web-propagation-b3]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-propagation-b3
[package-web-types]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-types
[package-web-instrumentation-zone]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-zone
[package-web-instrumentation-zone-peer-dep]: https://github.com/census-instrumentation/opencensus-web/tree/master/packages/opencensus-web-instrumentation-zone-peer-dep
Expand Down
3 changes: 3 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ publishes the packages to NPM. See the

## Update CHANGELOG and release versions in examples
* After releasing, you need to update all examples to the latest version.
* You will also need to update the `src` tags of `<script>` links in
`README.md` with not only their latest version but also their updated SHA
hashes. Use [srihash.org/](https://www.srihash.org/) to easily generate these.
* In addition, update the CHANGELOG.md and start new Unreleased label.
* Create a new commit with the exact title: `Post Release: update CHANGELOG, Examples and ReadMe`.
* Go through PR review and merge it to GitHub master branch.
Expand Down
18 changes: 18 additions & 0 deletions packages/opencensus-web-propagation-b3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ See the [OpenCensus Web readme][oc-web-readme-url] for details.
This is used to propagate trace contextspans for XHRs in the user interactions,
serializing a `B3` headers to send along to XHR calls.

It gets passed as an option to the `startTracing` function as follows:

```js
// Use @opencensus/web-instrumentation-zone-peer-dep instead in case your app
// already uses `Zone.js`.
import { startTracing } from '@opencensus/web-instrumentation-zone';
import { B3Format } from '@opencensus/web-propagation-b3';

window.ocAgent = 'https://example.com/my-opencensus-agent-endpoint';
window.ocSampleRate = 1.0; // Sample at 100% for test only. Default is 1/10000.
// Send the trace header to all hosts.
window.ocTraceHeaderHostRegex = /.*/;

// This methods starts the tracing and exports the initial page load trace.
// As the tracing has started, the coming user interactions ares also traced.
startTracing({ propagation: new B3Format() });
```

## Useful links
- For more information on OpenCensus, visit: <https://opencensus.io/>
- For more about OpenCensus Web: <https://github.com/census-instrumentation/opencensus-web>
Expand Down

0 comments on commit bb6db53

Please sign in to comment.