Skip to content

Commit 7d38b14

Browse files
committed
chore: rename plugin to instrumentation
1 parent befe3f6 commit 7d38b14

14 files changed

Lines changed: 27 additions & 33 deletions

File tree

plugins/node/opentelemetry-plugin-koa/.eslintignore renamed to plugins/node/opentelemetry-koa-instrumentation/.eslintignore

File renamed without changes.

plugins/node/opentelemetry-plugin-koa/.eslintrc.js renamed to plugins/node/opentelemetry-koa-instrumentation/.eslintrc.js

File renamed without changes.
File renamed without changes.
File renamed without changes.

plugins/node/opentelemetry-plugin-koa/README.md renamed to plugins/node/opentelemetry-koa-instrumentation/README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ For automatic instrumentation see the
1212
## Installation
1313

1414
```bash
15-
npm install --save @opentelemetry/plugin-koa
15+
npm install --save @opentelemetry/koa-instrumentation
1616
```
1717
### Supported Versions
18-
- `^2.0.0`
18+
- Koa `^2.0.0`
1919

2020
## Usage
2121

2222
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.
2323

24-
To load a specific plugin (Koa in this case), specify it in the Node Tracer's configuration.
24+
To load a specific instrumentation (Koa in this case), specify it in the Node Tracer's configuration.
2525
```js
2626
const { NodeTracerProvider } = require('@opentelemetry/node');
2727

@@ -30,13 +30,13 @@ const provider = new NodeTracerProvider({
3030
koa: {
3131
enabled: true,
3232
// You may use a package name or absolute path to the file.
33-
path: '@opentelemetry/plugin-koa',
33+
path: '@opentelemetry/koa-instrumentation',
3434
}
3535
}
3636
});
3737
```
3838

39-
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.
39+
To load all of the [supported instrumentations](https://github.com/open-telemetry/opentelemetry-js#plugins), use below approach. Each instrumentation is only loaded when the module that it patches is loaded; in other words, there is no computational overhead for listing instrumentations for unused modules.
4040
```js
4141
const { NodeTracerProvider } = require('@opentelemetry/node');
4242

@@ -62,11 +62,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
6262
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
6363
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
6464
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
65-
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=plugins/node/opentelemetry-plugin-koa
66-
67-
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-plugin-koa
68-
69-
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/dev-status.svg?path=plugins/node/opentelemetry-plugin-koa
70-
71-
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-plugin-koa&type=dev
72-
65+
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=plugins/node/opentelemetry-koa-instrumentation
66+
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-koa-instrumentation
67+
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/dev-status.svg?path=plugins/node/opentelemetry-koa-instrumentation
68+
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-koa-instrumentation&type=dev

plugins/node/opentelemetry-plugin-koa/package.json renamed to plugins/node/opentelemetry-koa-instrumentation/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@opentelemetry/plugin-koa",
2+
"name": "@opentelemetry/koa-instrumentation",
33
"version": "0.8.0",
44
"description": "OpenTelemetry Koa automatic instrumentation package.",
55
"main": "build/src/index.js",
@@ -23,7 +23,8 @@
2323
"nodejs",
2424
"tracing",
2525
"profiling",
26-
"plugin"
26+
"plugin",
27+
"instrumentation"
2728
],
2829
"author": "OpenTelemetry Authors",
2930
"license": "Apache-2.0",
@@ -51,6 +52,7 @@
5152
"@types/node": "12.12.47",
5253
"@types/shimmer": "1.0.1",
5354
"codecov": "3.7.0",
55+
"eslint": "^7.4.0",
5456
"gts": "2.0.2",
5557
"koa": "^2.13.0",
5658
"mocha": "7.2.0",
@@ -65,7 +67,6 @@
6567
"dependencies": {
6668
"@opentelemetry/api": "^0.9.0",
6769
"@opentelemetry/core": "^0.9.0",
68-
"eslint": "^7.4.0",
6970
"shimmer": "^1.2.1"
7071
}
7172
}

plugins/node/opentelemetry-plugin-koa/src/index.ts renamed to plugins/node/opentelemetry-koa-instrumentation/src/index.ts

File renamed without changes.

plugins/node/opentelemetry-plugin-koa/src/koa.ts renamed to plugins/node/opentelemetry-koa-instrumentation/src/koa.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ import Router = require('@koa/router');
3333
*/
3434
export const kLayerPatched: unique symbol = Symbol('koa-layer-patched');
3535

36-
/** Koa instrumentation plugin for OpenTelemetry */
37-
export class KoaPlugin extends BasePlugin<typeof koa> {
36+
/** Koa instrumentation for OpenTelemetry */
37+
export class KoaInstrumentation extends BasePlugin<typeof koa> {
3838
static readonly component = KoaComponentName;
3939

4040
constructor(readonly moduleName: string) {
41-
super('@opentelemetry/plugin-koa', VERSION);
41+
super('@opentelemetry/koa-instrumentation', VERSION);
4242
}
4343

4444
protected patch(): typeof koa {
@@ -71,9 +71,9 @@ export class KoaPlugin extends BasePlugin<typeof koa> {
7171
) {
7272
let patchedFunction;
7373
if (middlewareFunction.router) {
74-
patchedFunction = plugin._patchRouterDispatch(middlewareFunction);
74+
patchedFunction = koaInstrumentation._patchRouterDispatch(middlewareFunction);
7575
} else {
76-
patchedFunction = plugin._patchLayer(middlewareFunction, false);
76+
patchedFunction = koaInstrumentation._patchLayer(middlewareFunction, false);
7777
}
7878

7979
args[0] = patchedFunction;
@@ -138,4 +138,4 @@ export class KoaPlugin extends BasePlugin<typeof koa> {
138138
}
139139
}
140140

141-
export const plugin = new KoaPlugin(KoaPlugin.component);
141+
export const koaInstrumentation = new KoaInstrumentation(KoaComponentName);

plugins/node/opentelemetry-plugin-koa/src/types.ts renamed to plugins/node/opentelemetry-koa-instrumentation/src/types.ts

File renamed without changes.

plugins/node/opentelemetry-plugin-koa/src/utils.ts renamed to plugins/node/opentelemetry-koa-instrumentation/src/utils.ts

File renamed without changes.

0 commit comments

Comments
 (0)