Skip to content

Commit

Permalink
Remove plugins (open-telemetry#429)
Browse files Browse the repository at this point in the history
* chore: remove plugins and update docs references

* chore: updating readme, versions, examples, fixing karma - have to downgrade

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
  • Loading branch information
obecny and dyladan authored Apr 19, 2021
1 parent 0238980 commit 692932e
Show file tree
Hide file tree
Showing 185 changed files with 376 additions and 11,261 deletions.
79 changes: 40 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<strong>
<a href="CONTRIBUTING.md">Contributing<a/>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="plugins/">Plugins<a/>
<a href="plugins/">Instrumentations<a/>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="propagators/">Propagators<a/>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
Expand All @@ -44,39 +44,38 @@ This is a repository for OpenTelemetry JavaScript contributions that are not par
[core repository](https://github.com/open-telemetry/opentelemetry-js) and
core distribution of the API and SDK.

## Plugins
## Instrumentations

OpenTelemetry can collect tracing data automatically using plugins. Vendors/Users can also create and use their own. Currently, OpenTelemetry supports automatic tracing for:
OpenTelemetry can collect tracing data automatically using instrumentations. Vendors/Users can also create and use their own. Currently, OpenTelemetry supports automatic tracing for:

### Node Plugins
### Node Instrumentations

- [@opentelemetry/plugin-grpc][otel-plugin-grpc]
- [@opentelemetry/plugin-http][otel-plugin-http]
- [@opentelemetry/plugin-https][otel-plugin-https]
- [@opentelemetry/plugin-mongodb][otel-plugin-mongodb]
- [@opentelemetry/plugin-mysql][otel-plugin-mysql]
- [@opentelemetry/plugin-pg][otel-plugin-pg]
- [@opentelemetry/plugin-pg-pool][otel-plugin-pg-pool]
- [@opentelemetry/plugin-redis][otel-plugin-redis]
- [@opentelemetry/plugin-ioredis][otel-plugin-ioredis]
- [@opentelemetry/plugin-express][otel-plugin-express]
- [@opentelemetry/plugin-dns][otel-plugin-dns]
- [@opentelemetry/hapi-instrumentation][otel-contrib-hapi-instrumentation]
- [@opentelemetry/instrumentation-grpc][otel-instrumentation-grpc]
- [@opentelemetry/instrumentation-http][otel-instrumentation-http]
- [@opentelemetry/instrumentation-mongodb][otel-contrib-instrumentation-mongodb]
- [@opentelemetry/instrumentation-mysql][otel-contrib-instrumentation-mysql]
- [@opentelemetry/instrumentation-pg][otel-contrib-instrumentation-pg]
- [@opentelemetry/instrumentation-redis][otel-contrib-instrumentation-redis]
- [@opentelemetry/instrumentation-ioredis][otel-contrib-instrumentation-ioredis]
- [@opentelemetry/instrumentation-express][otel-contrib-instrumentation-express]
- [@opentelemetry/instrumentation-dns][otel-contrib-instrumentation-dns]
- [@opentelemetry/instrumentation-hapi][otel-contrib-instrumentation-hapi]
- [@opentelemetry/instrumentation-koa][otel-contrib-instrumentation-koa]
- [@opentelemetry/instrumentation-graphql][otel-contrib-instrumentation-graphql]

### Web Plugins
### Web Instrumentations

- [@opentelemetry/instrumentation-document-load][otel-instrumentation-document-load]
- [@opentelemetry/instrumentation-xml-http-request][otel-instrumentation-xml-http-request]
- [@opentelemetry/instrumentation-user-interaction][otel-instrumentation-user-interaction]
- [@opentelemetry/plugin-react-load][otel-plugin-react-load]
- [@opentelemetry/instrumentation-document-load][otel-contrib-instrumentation-document-load]
- [@opentelemetry/instrumentation-user-interaction][otel-contrib-instrumentation-user-interaction]
- [@opentelemetry/plugin-react-load][otel-contrib-plugin-react-load]

### Metapackages

Multiple plugins may be leveraged via metapackages.
Multiple instrumentations may be leveraged via metapackages.

- [@opentelemetry/plugins-node-core-and-contrib][otel-plugins-node-core-and-contrib] - all officially supported core and contrib plugins.
- [@opentelemetry/auto-instrumentations-node][otel-contrib-auto-instr-node] - Metapackage which bundles opentelemetry node core and contrib instrumentations
- [@opentelemetry/auto-instrumentations-web][otel-contrib-auto-instr-web] - Metapackage which bundles opentelemetry web core and contrib instrumentations

## Supported Runtimes

Expand Down Expand Up @@ -116,22 +115,24 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[up-for-grabs-issues]: https://github.com/open-telemetry/opentelemetry-js-contrib/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
[good-first-issues]: https://github.com/open-telemetry/openTelemetry-js-contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[otel-plugin-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-grpc
[otel-plugin-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-http
[otel-plugin-https]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-https
[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-dns
[otel-instrumentation-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-document-load
[otel-plugin-react-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-plugin-react-load
[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-ioredis
[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mongodb
[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mysql
[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg-pool
[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg
[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-redis
[otel-instrumentation-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-user-interaction

[otel-instrumentation-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-grpc
[otel-instrumentation-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-http
[otel-instrumentation-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-xml-http-request
[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-express
[otel-plugins-node-core-and-contrib]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/plugins-node-core-and-contrib
[otel-contrib-hapi-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-hapi-instrumentation
[otel-contrib-instrumentation-koa]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-koa

[otel-contrib-instrumentation-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-dns
[otel-contrib-instrumentation-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-document-load
[otel-contrib-instrumentation-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express
[otel-contrib-instrumentation-graphql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-graphql
[otel-contrib-instrumentation-hapi]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-hapi
[otel-contrib-instrumentation-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-ioredis
[otel-contrib-instrumentation-koa]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-koa
[otel-contrib-instrumentation-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb
[otel-contrib-instrumentation-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql
[otel-contrib-instrumentation-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg
[otel-contrib-instrumentation-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis
[otel-contrib-instrumentation-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-user-interaction
[otel-contrib-plugin-react-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-plugin-react-load

[otel-contrib-auto-instr-node]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node
[otel-contrib-auto-instr-web]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-web
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"typescript": "4.1.3"
},
"dependencies": {
"@opentelemetry/resources": "^0.18.0"
"@opentelemetry/resources": "^0.18.2"
}
}
16 changes: 8 additions & 8 deletions examples/dns/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dns-example",
"private": true,
"version": "0.14.0",
"version": "0.15.0",
"description": "Example of DNS integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand All @@ -26,13 +26,13 @@
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
"dependencies": {
"@opentelemetry/api": "^0.18.0",
"@opentelemetry/exporter-jaeger": "^0.18.0",
"@opentelemetry/exporter-zipkin": "^0.18.0",
"@opentelemetry/instrumentation": "^0.18.0",
"@opentelemetry/instrumentation-dns": "^0.14.0",
"@opentelemetry/node": "^0.18.0",
"@opentelemetry/tracing": "^0.18.0"
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/exporter-jaeger": "^0.18.2",
"@opentelemetry/exporter-zipkin": "^0.18.2",
"@opentelemetry/instrumentation": "^0.18.2",
"@opentelemetry/instrumentation-dns": "^0.15.0",
"@opentelemetry/node": "^0.18.2",
"@opentelemetry/tracing": "^0.18.2"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"devDependencies": {
Expand Down
14 changes: 7 additions & 7 deletions examples/express/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "express-example",
"private": true,
"version": "0.14.0",
"version": "0.15.0",
"description": "Example of Express integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand All @@ -28,14 +28,14 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/api": "^0.18.0",
"@opentelemetry/exporter-jaeger": "^0.18.0",
"@opentelemetry/exporter-zipkin": "^0.18.0",
"@opentelemetry/instrumentation": "^0.18.0",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/exporter-jaeger": "^0.18.2",
"@opentelemetry/exporter-zipkin": "^0.18.2",
"@opentelemetry/instrumentation": "^0.18.2",
"@opentelemetry/instrumentation-express": "^0.15.0",
"@opentelemetry/instrumentation-http": "^0.18.2",
"@opentelemetry/node": "^0.18.0",
"@opentelemetry/tracing": "^0.18.0",
"@opentelemetry/node": "^0.18.2",
"@opentelemetry/tracing": "^0.18.2",
"axios": "^0.19.0",
"cross-env": "^7.0.3",
"express": "^4.17.1"
Expand Down
19 changes: 9 additions & 10 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opentelemetry-plugin-graphql-example",
"private": true,
"version": "0.14.0",
"version": "0.15.0",
"description": "Example of using @opentelemetry/plugin-graphql with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -31,15 +31,14 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/api": "^0.18.0",
"@opentelemetry/exporter-collector": "^0.18.0",
"@opentelemetry/instrumentation": "^0.18.0",
"@opentelemetry/instrumentation-graphql": "^0.14.0",
"@opentelemetry/node": "^0.18.0",
"@opentelemetry/plugin-express": "^0.14.0",
"@opentelemetry/plugin-http": "^0.18.0",
"@opentelemetry/plugin-https": "^0.18.0",
"@opentelemetry/tracing": "^0.18.0",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/exporter-collector": "^0.18.2",
"@opentelemetry/instrumentation": "^0.18.2",
"@opentelemetry/instrumentation-graphql": "^0.15.0",
"@opentelemetry/node": "^0.18.2",
"@opentelemetry/instrumentation-express": "^0.15.0",
"@opentelemetry/instrumentation-http": "^0.18.2",
"@opentelemetry/tracing": "^0.18.2",
"apollo-server": "^2.18.1",
"express": "^4.17.1",
"express-graphql": "^0.11.0",
Expand Down
11 changes: 4 additions & 7 deletions examples/graphql/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { GraphQLInstrumentation } = require('@opentelemetry/instrumentation-graph
const { ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector');
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express');

const exporter = new CollectorTraceExporter({
serviceName: 'basic-service',
Expand All @@ -23,12 +25,7 @@ registerInstrumentations({
// depth: 2,
// mergeItems: true,
}),
{
plugins: {
http: { enabled: false, path: '@opentelemetry/plugin-http' },
https: { enabled: false, path: '@opentelemetry/plugin-https' },
express: { enabled: false, path: '@opentelemetry/plugin-express' },
},
},
new HttpInstrumentation(),
new ExpressInstrumentation(),
],
});
16 changes: 8 additions & 8 deletions examples/grpc-census-prop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grpc-census-prop-example",
"version": "0.14.0",
"version": "0.15.0",
"description": "Example of using propagator-grpc-census-binary",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -34,13 +34,13 @@
"@opencensus/instrumentation-grpc": "0.0.21",
"@opencensus/nodejs": "0.0.21",
"@opencensus/propagation-binaryformat": "0.0.21",
"@opentelemetry/api": "^0.18.0",
"@opentelemetry/core": "^0.18.0",
"@opentelemetry/instrumentation": "^0.18.0",
"@opentelemetry/node": "^0.18.0",
"@opentelemetry/plugin-grpc": "^0.18.0",
"@opentelemetry/propagator-grpc-census-binary": "^0.14.0",
"@opentelemetry/tracing": "^0.18.0",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/core": "^0.18.2",
"@opentelemetry/instrumentation": "^0.18.2",
"@opentelemetry/instrumentation-grpc": "^0.18.2",
"@opentelemetry/node": "^0.18.2",
"@opentelemetry/propagator-grpc-census-binary": "^0.15.0",
"@opentelemetry/tracing": "^0.18.2",
"grpc": "^1.24.2",
"node-pre-gyp": "0.12.0"
},
Expand Down
18 changes: 9 additions & 9 deletions examples/grpc-census-prop/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const { SimpleSpanProcessor, ConsoleSpanExporter } = require('@opentelemetry/tracing');
const { HttpTraceContext } = require('@opentelemetry/core');
const { GrpcCensusPropagator } = require('@opentelemetry/propagator-grpc-census-binary');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GrpcInstrumentation } = require('@opentelemetry/instrumentation-grpc');

/**
* Return an OpenTelemetry tracer configured to use the gRPC plugin and with the
* requested propagator
*/
module.exports = (serviceName, binaryPropagator) => {
const provider = new NodeTracerProvider({
plugins: {
grpc: {
enabled: true,
// You may use a package name or absolute path to the file.
path: '@opentelemetry/plugin-grpc',
},
},
});
const provider = new NodeTracerProvider();

// It is recommended to use this `BatchSpanProcessor` for better performance
// and optimization, especially in production.
Expand All @@ -36,5 +30,11 @@ module.exports = (serviceName, binaryPropagator) => {
});
}

registerInstrumentations({
instrumentations: [
new GrpcInstrumentation(),
],
});

return opentelemetry.trace.getTracer(serviceName);
};
44 changes: 44 additions & 0 deletions examples/grpc_dynamic_codegen/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "grpc-dynamic-codegen-example",
"version": "0.15.0",
"description": "Example of gRPC integration with OpenTelemetry",
"main": "index.js",
"scripts": {
"zipkin:server": "cross-env EXPORTER=zipkin node ./capitalize_server.js",
"zipkin:client": "cross-env EXPORTER=zipkin node ./capitalize_client.js",
"jaeger:server": "cross-env EXPORTER=jaeger node ./capitalize_server.js",
"jaeger:client": "cross-env EXPORTER=jaeger node ./capitalize_client.js"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/open-telemetry/opentelemetry-js.git"
},
"keywords": [
"opentelemetry",
"grpc",
"tracing"
],
"engines": {
"node": ">=8"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@grpc/proto-loader": "^0.4.0",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/exporter-jaeger": "^0.18.2",
"@opentelemetry/exporter-zipkin": "^0.18.2",
"@opentelemetry/node": "^0.18.2",
"@opentelemetry/instrumentation-grpc": "^0.18.2",
"@opentelemetry/tracing": "^0.18.2",
"grpc": "^1.24.6",
"node-pre-gyp": "^0.17.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"devDependencies": {
"cross-env": "^7.0.3"
}
}
19 changes: 10 additions & 9 deletions examples/grpc_dynamic_codegen/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const { SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GrpcInstrumentation } = require('@opentelemetry/instrumentation-grpc');


const EXPORTER = process.env.EXPORTER || '';

module.exports = (serviceName) => {
const provider = new NodeTracerProvider({
plugins: {
grpc: {
enabled: true,
// You may use a package name or absolute path to the file.
path: '@opentelemetry/plugin-grpc',
},
},
});
const provider = new NodeTracerProvider();

let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
Expand All @@ -37,5 +32,11 @@ module.exports = (serviceName) => {
// Initialize the OpenTelemetry APIs to use the NodeTracerProvider bindings
provider.register();

registerInstrumentations({
instrumentations: [
new GrpcInstrumentation(),
],
});

return opentelemetry.trace.getTracer('grpc-dynamic-codegen-example');
};
Loading

0 comments on commit 692932e

Please sign in to comment.