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

chore: update plugin readme with example links #647

Merged
merged 3 commits into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/opentelemetry-plugin-document-load/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Because the browser does not send a trace context header for the initial page na
</body>
```

See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/tracer-web) for a short example.

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
Expand Down
24 changes: 22 additions & 2 deletions packages/opentelemetry-plugin-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,32 @@ npm install --save @opentelemetry/plugin-mysql

## Usage

OpenTelemetry MySQL Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with [mysql](https://www.npmjs.com/package/mysql).

To load a specific plugin (**MySQL** in this case), specify it in the Node Tracer's configuration
```js
const { NodeTracer } = require('@opentelemetry/node');

const tracer = new NodeTracer({
plugins: {
mysql: {
enabled: true,
// You may use a package name or absolute path to the file.
path: '@opentelemetry/plugin-mysql',
}
}
});
```

To load all the [supported plugins](https://github.com/open-telemetry/opentelemetry-js#plugins), use below approach. Each plugin is only loaded when the module that it patches is loaded; in other words, there is no computational overhead for listing plugins for unused modules.
```js
const opentelemetry = require('@opentelemetry/plugin-mysql');
const { NodeTracer } = require('@opentelemetry/node');

// TODO: DEMONSTRATE API
const tracer = new NodeTracer();
```

See [examples/mysql](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/mysql) for a short example.

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-plugin-redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const { NodeTracer } = require('@opentelemetry/node');
const tracer = new NodeTracer();
```

<!-- See [examples/redis](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/redis) for a short example. -->
See [examples/redis](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/redis) for a short example.

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
Expand Down
4 changes: 3 additions & 1 deletion packages/opentelemetry-plugin-xml-http-request/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const webTracerWithZone = new WebTracer({
scopeManager: new ZoneScopeManager(),
plugins: [
new XMLHttpRequestPlugin({
propagateTraceHeaderCorsUrls: ['http://localhost:8090']
propagateTraceHeaderCorsUrls: ['http://localhost:8090']
})
]
});
Expand All @@ -43,6 +43,8 @@ req.send();
![Screenshot of the running example](images/request.jpg)
![Screenshot of the running example](images/cors.jpg)

See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/tracer-web) for a short example.

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
Expand Down
2 changes: 2 additions & 0 deletions packages/opentelemetry-shim-opentracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ opentracing.initGlobalTracer(new TracerShim(tracer));

```

See [examples/opentracing-shim](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/opentracing-shim) for a short example.


## License

Expand Down