Skip to content

Commit

Permalink
chore: update plugin readme with example links (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 authored and dyladan committed Dec 27, 2019
1 parent 093a738 commit e859b8e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
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:/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:/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:/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:/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:/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:/open-telemetry/opentelemetry-js/tree/master/examples/redis) for a short example. -->
See [examples/redis](https:/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:/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:/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:/open-telemetry/opentelemetry-js/tree/master/examples/opentracing-shim) for a short example.


## License

Expand Down

0 comments on commit e859b8e

Please sign in to comment.