Skip to content

Commit 532375d

Browse files
committed
chore: adding upgrading guidelines
1 parent 97effe8 commit 532375d

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,65 @@ To request automatic tracing support for a module not on this list, please [file
233233

234234
## Upgrade guidelines
235235

236+
### 0.16.0 to 0.17.0
237+
238+
[PR-1855](https://github.com/open-telemetry/opentelemetry-js/pull/1855) Use instrumentation loader to load plugins and instrumentations
239+
240+
- Providers do no load the plugins anymore. Also PluginLoader has been removed from providers, use `registerInstrumentations` instead
241+
242+
```javascript
243+
//Previously in node
244+
const provider = new NodeTracerProvider({
245+
plugins: {
246+
'@grpc/grpc-js': {
247+
enabled: true,
248+
path: '@opentelemetry/plugin-grpc-js',
249+
},
250+
}
251+
});
252+
253+
// Now
254+
const provider = new NodeTracerProvider();
255+
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
256+
registerInstrumentations({
257+
instrumentations: [
258+
{
259+
plugins: {
260+
'@grpc/grpc-js': {
261+
enabled: true,
262+
path: '@opentelemetry/plugin-grpc-js',
263+
},
264+
}
265+
}
266+
],
267+
tracerProvider: provider,
268+
});
269+
270+
// or if you want to load only default instrumentations / plugins
271+
registerInstrumentations({
272+
tracerProvider: provider,
273+
});
274+
275+
//Previously in browser
276+
const provider = new WebTracerProvider({
277+
plugins: [
278+
new DocumentLoad()
279+
]
280+
});
281+
// Now
282+
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
283+
const provider = new WebTracerProvider();
284+
registerInstrumentations({
285+
instrumentations: [
286+
new DocumentLoad(),
287+
],
288+
});
289+
```
290+
291+
- `registerInstrumentations` supports loading old plugins and instrumentations together. It also supports setting tracer provider and meter provider on instrumentations
292+
293+
## Upgrade guidelines
294+
236295
### 0.15.0 to 0.16.0
237296

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

0 commit comments

Comments
 (0)