Skip to content

Commit

Permalink
Merge branch 'master' into readme_0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 authored Jan 2, 2020
2 parents 4a298cf + e859b8e commit 21be729
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 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://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
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,62 @@ For automatic instrumentation see the

```bash
npm install --save @opentelemetry/plugin-pg
npm install --save @opentelemetry/plugin-pg-pool
```

## Usage

To load all of the [default supported plugins](https://github.com/open-telemetry/opentelemetry-js#plugins), use the 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 plugsin for unused modules.

```js
const { NodeTracer } = require('@opentelemetry/node');

const tracer = new NodeTracer(); // All default plugins will be used
```

If instead you would just load a specific plugin (**pg** in this case), specify it in the `NodeTracer` configuration.

```js
const opentelemetry = require('@opentelemetry/plugin-pg');
const { NodeTracer } = require('@opentelemetry/node');

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

If you are using any of the [`pg.Pool`](https://node-postgres.com/api/pool) APIs, you will also need to include the [`pg-pool` plugin](../opentelemetry-plugin-pg-pool).

```js
const { NodeTracer } = require('@opentelemetry/node');

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

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

## Supported Versions

- [pg](https://npmjs.com/package/pg): `7.x`
- [pg-pool](https://npmjs.com/package/pg-pool): `2.x` (Installed by `pg`)

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
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
2 changes: 2 additions & 0 deletions packages/opentelemetry-plugin-xml-http-request/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 21be729

Please sign in to comment.