Skip to content

Commit e859b8e

Browse files
mayurkale22dyladan
authored andcommitted
chore: update plugin readme with example links (#647)
1 parent 093a738 commit e859b8e

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

packages/opentelemetry-plugin-document-load/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Because the browser does not send a trace context header for the initial page na
5757
</body>
5858
```
5959

60+
See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/tracer-web) for a short example.
61+
6062
## Useful links
6163
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
6264
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>

packages/opentelemetry-plugin-mysql/README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,32 @@ npm install --save @opentelemetry/plugin-mysql
2020

2121
## Usage
2222

23+
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).
24+
25+
To load a specific plugin (**MySQL** in this case), specify it in the Node Tracer's configuration
26+
```js
27+
const { NodeTracer } = require('@opentelemetry/node');
28+
29+
const tracer = new NodeTracer({
30+
plugins: {
31+
mysql: {
32+
enabled: true,
33+
// You may use a package name or absolute path to the file.
34+
path: '@opentelemetry/plugin-mysql',
35+
}
36+
}
37+
});
38+
```
39+
40+
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.
2341
```js
24-
const opentelemetry = require('@opentelemetry/plugin-mysql');
42+
const { NodeTracer } = require('@opentelemetry/node');
2543

26-
// TODO: DEMONSTRATE API
44+
const tracer = new NodeTracer();
2745
```
2846

47+
See [examples/mysql](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/mysql) for a short example.
48+
2949
## Useful links
3050
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
3151
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>

packages/opentelemetry-plugin-redis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const { NodeTracer } = require('@opentelemetry/node');
4444
const tracer = new NodeTracer();
4545
```
4646

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

4949
## Useful links
5050
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>

packages/opentelemetry-plugin-xml-http-request/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const webTracerWithZone = new WebTracer({
2525
scopeManager: new ZoneScopeManager(),
2626
plugins: [
2727
new XMLHttpRequestPlugin({
28-
propagateTraceHeaderCorsUrls: ['http://localhost:8090']
28+
propagateTraceHeaderCorsUrls: ['http://localhost:8090']
2929
})
3030
]
3131
});
@@ -43,6 +43,8 @@ req.send();
4343
![Screenshot of the running example](images/request.jpg)
4444
![Screenshot of the running example](images/cors.jpg)
4545

46+
See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/tracer-web) for a short example.
47+
4648
## Useful links
4749
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
4850
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>

packages/opentelemetry-shim-opentracing/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ opentracing.initGlobalTracer(new TracerShim(tracer));
3434

3535
```
3636

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

3840
## License
3941

0 commit comments

Comments
 (0)