Skip to content

Commit

Permalink
chore: adding upgrading guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
obecny committed Feb 5, 2021
1 parent 97effe8 commit 8f79bb3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,62 @@ To request automatic tracing support for a module not on this list, please [file

## Upgrade guidelines

### 0.16.0 to 0.17.0

[PR-1855](https://github.com/open-telemetry/opentelemetry-js/pull/1855) Use instrumentation loader to load plugins and instrumentations

- Providers do no load the plugins anymore. Also PluginLoader has been removed from providers, use `registerInstrumentations` instead
```javascript
//Previously in node
const provider = new NodeTracerProvider({
plugins: {
'@grpc/grpc-js': {
enabled: true,
path: '@opentelemetry/plugin-grpc-js',
},
}
});
// Now
const provider = new NodeTracerProvider();
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
registerInstrumentations({
instrumentations: [
{
plugins: {
'@grpc/grpc-js': {
enabled: true,
path: '@opentelemetry/plugin-grpc-js',
},
}
}
],
tracerProvider: provider,
});

// or if you want to load only default instrumentations / plugins
registerInstrumentations({
tracerProvider: provider,
});

//Previously in browser
const provider = new WebTracerProvider({
plugins: [
new DocumentLoad()
]
});
// Now
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const provider = new WebTracerProvider();
registerInstrumentations({
instrumentations: [
new DocumentLoad(),
],
});
```
- `registerInstrumentations` supports loading old plugins and instrumentations together. It also supports setting tracer provider and meter provider on instrumentations

## Upgrade guidelines

### 0.15.0 to 0.16.0

[PR-1874](https://github.com/open-telemetry/opentelemetry-js/pull/1874) More specific API type names
Expand Down

0 comments on commit 8f79bb3

Please sign in to comment.