Skip to content

Commit

Permalink
Update documentation for new propagator API (open-telemetry#482)
Browse files Browse the repository at this point in the history
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
  • Loading branch information
willarmiros and vmarchaud authored May 25, 2021
1 parent 7a1511d commit 95af57a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions propagators/opentelemetry-propagator-aws-xray/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ npm install --save @opentelemetry/propagator-aws-xray
In the [global tracer configuration file](https://github.com/open-telemetry/opentelemetry-js/blob/master/getting-started/README.md#initialize-a-global-tracer), configure the following:

```js
const { propagation } = require("@opentelemetry/api");
const { NodeTracerProvider } = require('@opentelemetry/node');
const { AWSXRayPropagator } = require('@opentelemetry/propagator-aws-xray');
// ...

module.exports = ("service_name_here") => {
// set global propagator
propagation.setGlobalPropagator(new AWSXRayPropagator());
// ...}
const provider = new NodeTracerProvider();

// Set the global trace context propagator to use X-Ray formatted trace header
provider.register({
propagator: new AWSXRayPropagator()
});
```

### Propagator Details
Expand Down

0 comments on commit 95af57a

Please sign in to comment.