-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c684fc
commit 5241daa
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# OpenTelemetry Koa Instrumentation for Node.js | ||
[![Gitter chat][gitter-image]][gitter-url] | ||
[![dependencies][dependencies-image]][dependencies-url] | ||
[![devDependencies][devDependencies-image]][devDependencies-url] | ||
[![Apache License][license-image]][license-image] | ||
|
||
This module provides automatic instrumentation for [`Koa`](https://github.com/koajs/koa). | ||
|
||
For automatic instrumentation see the | ||
[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install --save @opentelemetry/plugin-koa | ||
``` | ||
### Supported Versions | ||
TBD | ||
|
||
## Usage | ||
|
||
OpenTelemetry Koa Instrumentation allows the user to automatically collect trace data and export them to their backend of choice, to give observability to distributed systems. | ||
|
||
To load a specific plugin (Koa in this case), specify it in the Node Tracer's configuration. | ||
```js | ||
const { NodeTracerProvider } = require('@opentelemetry/node'); | ||
|
||
const provider = new NodeTracerProvider({ | ||
plugins: { | ||
koa: { | ||
enabled: true, | ||
// You may use a package name or absolute path to the file. | ||
path: '@opentelemetry/plugin-koa', | ||
} | ||
} | ||
}); | ||
``` | ||
|
||
To load all of 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 { NodeTracerProvider } = require('@opentelemetry/node'); | ||
|
||
const provider = new NodeTracerProvider(); | ||
``` | ||
|
||
## Useful links | ||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/> | ||
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js> | ||
- For help or feedback on this project, join us on [gitter][gitter-url] | ||
|
||
## License | ||
|
||
Apache 2.0 - See [LICENSE][license-url] for more information. | ||
|
||
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg | ||
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
|