Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: creating one auto loader for instrumentation and old plugins #1731

Merged
merged 13 commits into from
Jan 7, 2021
Prev Previous commit
Next Next commit
chore: linting
  • Loading branch information
obecny committed Dec 18, 2020
commit 6d785964e1ea02950b2bf43dc8a6af335c126f5b
5 changes: 5 additions & 0 deletions packages/opentelemetry-instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ myPLugin.enable();
```

## AutoLoader

Successor of loading plugins through TracerProvider "plugins" option.
It also supersedes PluginLoader for node. The old configurations usually looks like

### NODE - old way using TracerProvider

```javascript
const { NodeTracerProvider } = require('@opentelemetry/node');
const { B3Propagator } = require('@opentelemetry/propagator-b3');
Expand All @@ -177,6 +179,7 @@ provider.register({
```

### WEB - old way using TracerProvider

```javascript
const { WebTracerProvider } = require('@opentelemetry/web');
const { UserInteractionPlugin } = require('@opentelemetry/plugin-user-interaction');
Expand All @@ -202,6 +205,7 @@ After change it will look like this - mixing plugins and instrumentations togeth
All plugins will be bound to TracerProvider as well as instrumentations

### NODE - Auto Loader

```javascript
const { B3Propagator } = require('@opentelemetry/propagator-b3');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
Expand Down Expand Up @@ -231,6 +235,7 @@ tracerProvider.register({
```

### WEB - Auto Loader

```javascript
const { B3Propagator } = require('@opentelemetry/propagator-b3');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
Expand Down