-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove the non-publishing packages from the npm workspace (#1938)
* chore: remove the non-publishing packages from the npm workspace Because they cause difficulties with updating `@opentelemetry/*` dependencies. This is "Option 3" from #1917 Refs: #1917 * undo #1917 option 1 work (adding non-publishing packages to release-please config) from #1928 * move express example (haven't adjusted build / docs yet) * express example updates to get it working * remove non-publishing packages from release-please manifest * move koa example * fix up the koa-example-related files * move the mongodb/examples files to the top-level * fixup the mongodb-example files * move mysql-example files * fixup the mysql-example files * move redis-example files to top level examples/ dir * fixup redis-example files * update examples README to no longer suggest moving to instruemtnation package dirs * regenerate package-lock.json to rm the '.../examples' dir entries 'npm install --package-lock-only' did not accomplish this. This regen was necessary because those vestigial entries caused surprising breakage in some 'npm install --no-save ...' commands such as TAV is doing. It broke TAV tests with [email protected]. * compile:examples is no longer a thing * fix for 'npm ci' failures imported from PR #1955 * regenerate package-lock.json 'undici-types', required by the version of @types/node used by the new instrumentation-perf-hooks, was lost in the merge from main. * add some more test output information to try to help debug flaky test * fix tweaks to the test * undo the instr-perf-hooks test assert tweaks, leaving that to a separate PR
- Loading branch information
Showing
95 changed files
with
4,935 additions
and
6,666 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.28.6","detectors/node/opentelemetry-resource-detector-aws":"1.3.6","detectors/node/opentelemetry-resource-detector-azure":"0.2.4","detectors/node/opentelemetry-resource-detector-container":"0.3.6","detectors/node/opentelemetry-resource-detector-gcp":"0.29.6","detectors/node/opentelemetry-resource-detector-github":"0.28.1","detectors/node/opentelemetry-resource-detector-instana":"0.6.0","metapackages/auto-instrumentations-node":"0.41.1","metapackages/auto-instrumentations-web":"0.36.0","packages/opentelemetry-host-metrics":"0.35.0","packages/opentelemetry-id-generator-aws-xray":"1.2.1","packages/opentelemetry-propagation-utils":"0.30.6","packages/opentelemetry-redis-common":"0.36.1","packages/opentelemetry-sampler-aws-xray":"0.34.0","packages/opentelemetry-sql-common":"0.40.0","packages/opentelemetry-test-utils":"0.36.0","plugins/node/instrumentation-amqplib":"0.34.0","plugins/node/instrumentation-cucumber":"0.3.0","plugins/node/instrumentation-dataloader":"0.6.0","plugins/node/instrumentation-fs":"0.9.0","plugins/node/instrumentation-lru-memoizer":"0.34.0","plugins/node/instrumentation-mongoose":"0.35.0","plugins/node/instrumentation-perf-hooks": "0.1.0","plugins/node/instrumentation-socket.io":"0.36.0","plugins/node/instrumentation-tedious":"0.7.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.38.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.38.1","plugins/node/opentelemetry-instrumentation-bunyan":"0.35.0","plugins/node/opentelemetry-instrumentation-bunyan/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.35.0","plugins/node/opentelemetry-instrumentation-connect":"0.33.0","plugins/node/opentelemetry-instrumentation-dns":"0.33.0","plugins/node/opentelemetry-instrumentation-express":"0.35.0","plugins/node/opentelemetry-instrumentation-express/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-fastify":"0.33.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.33.0","plugins/node/opentelemetry-instrumentation-graphql":"0.37.0","plugins/node/opentelemetry-instrumentation-hapi":"0.34.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.37.0","plugins/node/opentelemetry-instrumentation-knex":"0.33.0","plugins/node/opentelemetry-instrumentation-koa":"0.37.0","plugins/node/opentelemetry-instrumentation-koa/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-memcached":"0.33.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.39.0","plugins/node/opentelemetry-instrumentation-mongodb/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-mysql":"0.35.0","plugins/node/opentelemetry-instrumentation-mysql/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.35.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.34.0","plugins/node/opentelemetry-instrumentation-net":"0.33.0","plugins/node/opentelemetry-instrumentation-pg":"0.38.0","plugins/node/opentelemetry-instrumentation-pino":"0.35.0","plugins/node/opentelemetry-instrumentation-redis":"0.36.0","plugins/node/opentelemetry-instrumentation-redis/examples":"0.1.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.36.0","plugins/node/opentelemetry-instrumentation-restify":"0.35.0","plugins/node/opentelemetry-instrumentation-router":"0.34.0","plugins/node/opentelemetry-instrumentation-winston":"0.34.0","plugins/web/opentelemetry-instrumentation-document-load":"0.35.0","plugins/web/opentelemetry-instrumentation-long-task":"0.35.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.35.0","plugins/web/opentelemetry-plugin-react-load":"0.30.0","propagators/opentelemetry-propagator-aws-xray":"1.3.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.27.1","propagators/opentelemetry-propagator-instana":"0.3.1","propagators/opentelemetry-propagator-ot-trace":"0.27.1"} | ||
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.28.6","detectors/node/opentelemetry-resource-detector-aws":"1.3.6","detectors/node/opentelemetry-resource-detector-azure":"0.2.4","detectors/node/opentelemetry-resource-detector-container":"0.3.6","detectors/node/opentelemetry-resource-detector-gcp":"0.29.6","detectors/node/opentelemetry-resource-detector-github":"0.28.1","detectors/node/opentelemetry-resource-detector-instana":"0.6.0","metapackages/auto-instrumentations-node":"0.41.1","metapackages/auto-instrumentations-web":"0.36.0","packages/opentelemetry-host-metrics":"0.35.0","packages/opentelemetry-id-generator-aws-xray":"1.2.1","packages/opentelemetry-propagation-utils":"0.30.6","packages/opentelemetry-redis-common":"0.36.1","packages/opentelemetry-sql-common":"0.40.0","packages/opentelemetry-test-utils":"0.36.0","plugins/node/instrumentation-amqplib":"0.34.0","plugins/node/instrumentation-cucumber":"0.3.0","plugins/node/instrumentation-dataloader":"0.6.0","plugins/node/instrumentation-fs":"0.9.0","plugins/node/instrumentation-lru-memoizer":"0.34.0","plugins/node/instrumentation-mongoose":"0.35.0","plugins/node/instrumentation-perf-hooks": "0.1.0","plugins/node/instrumentation-socket.io":"0.36.0","plugins/node/instrumentation-tedious":"0.7.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.38.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.38.1","plugins/node/opentelemetry-instrumentation-bunyan":"0.35.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.35.0","plugins/node/opentelemetry-instrumentation-connect":"0.33.0","plugins/node/opentelemetry-instrumentation-dns":"0.33.0","plugins/node/opentelemetry-instrumentation-express":"0.35.0","plugins/node/opentelemetry-instrumentation-fastify":"0.33.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.33.0","plugins/node/opentelemetry-instrumentation-graphql":"0.37.0","plugins/node/opentelemetry-instrumentation-hapi":"0.34.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.37.0","plugins/node/opentelemetry-instrumentation-knex":"0.33.0","plugins/node/opentelemetry-instrumentation-koa":"0.37.0","plugins/node/opentelemetry-instrumentation-memcached":"0.33.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.39.0","plugins/node/opentelemetry-instrumentation-mysql":"0.35.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.35.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.34.0","plugins/node/opentelemetry-instrumentation-net":"0.33.0","plugins/node/opentelemetry-instrumentation-pg":"0.38.0","plugins/node/opentelemetry-instrumentation-pino":"0.35.0","plugins/node/opentelemetry-instrumentation-redis":"0.36.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.36.0","plugins/node/opentelemetry-instrumentation-restify":"0.35.0","plugins/node/opentelemetry-instrumentation-router":"0.34.0","plugins/node/opentelemetry-instrumentation-winston":"0.34.0","plugins/web/opentelemetry-instrumentation-document-load":"0.35.0","plugins/web/opentelemetry-instrumentation-long-task":"0.35.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.35.0","plugins/web/opentelemetry-plugin-react-load":"0.30.0","propagators/opentelemetry-propagator-aws-xray":"1.3.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.27.1","propagators/opentelemetry-propagator-instana":"0.3.1","propagators/opentelemetry-propagator-ot-trace":"0.27.1"} |
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 |
---|---|---|
@@ -1,41 +1,6 @@ | ||
# Instrumentation Examples | ||
|
||
:warning: Note: We are working on migrating these examples to their respective package directories. | ||
:warning: Some of these examples may be out of date. Compare the version of the `@opentelemetry/instrumentation-{module}` dependency in the example's "package.json" file to the latest published version of that dependency to know. | ||
|
||
For instance, examples of using `express` instrumentation have moved from this directory to [plugins/node/opentelemetry-instrumentation-express](https://github.com/open-telemetry/opentelemetry-js/tree/main/plugins/node/opentelemetry-instrumentation-express). | ||
|
||
## Instructions for Migrating an Example | ||
|
||
* [ ] Move the files | ||
* [ ] Choose an instrumentation package to migrate examples for. | ||
* [ ] Move the examples from `./examples/[name]` to `./plugins/[node or web]]/opentelemetry-instrumentation-[name]/examples`. | ||
* [ ] Update the `./plugins/[node or web]]/opentelemetry-instrumentation-[name]/README.md` and replace the path `examples/[name]` with the new path of the examples. | ||
* [ ] Update the `package.json` in the examples folder | ||
* [ ] Remove the `@opentelemetry/instrumentation-[name]` dependency. | ||
* [ ] Install `typescript` and `ts-node` in the examples directory. | ||
* [ ] Replace usage of `node` in scripts with `ts-node`. | ||
* [ ] Add a script for compiling the code in scripts: `"compile": "tsc -p ."` | ||
* [ ] Add a tsconfig.json file in the examples folder. (Example below) | ||
* [ ] Update the code | ||
* [ ] Change code to use a relative import of the library. | ||
* [ ] Add types to the code | ||
* [ ] Update the instrumentation package's `package.json` | ||
* [ ] Add a script `"compile:examples": "cd examples && npm run compile",`. | ||
* [ ] Test the updated code | ||
* [ ] Test building the examples by running `npm run compile:examples` | ||
* [ ] Test that the actual exapmle code runs as expected | ||
|
||
Example tsconfig.json file: | ||
|
||
```json | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"rootDir": ".", | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
] | ||
} | ||
``` | ||
This directory holds a number of examples demonstrating using OpenTelemetry | ||
instrumentation with a particular module. |
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 @@ | ||
package-lock=false |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
package-lock=false |
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,71 @@ | ||
# Overview | ||
|
||
OpenTelemetry Express Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems. | ||
|
||
This is a simple example that demonstrates tracing calls made to Express API. The example | ||
shows key aspects of tracing such as | ||
|
||
- Root Span (on Client) | ||
- Child Span (on Client) | ||
- Span Events | ||
- Span Attributes | ||
|
||
## Installation | ||
|
||
```sh | ||
# from this directory | ||
npm install | ||
``` | ||
|
||
Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html) | ||
or | ||
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one) | ||
|
||
## Run the Application | ||
|
||
### Zipkin | ||
|
||
Run the server: | ||
|
||
```sh | ||
npm run zipkin:server | ||
``` | ||
|
||
Then run the client in a separate terminal: | ||
|
||
```sh | ||
npm run zipkin:client | ||
``` | ||
|
||
After a short time, the generated traces should be available in the Zipkin UI. | ||
Visit <http://localhost:9411/zipkin> and click the "RUN QUERY" button to view | ||
recent traces, then click "SHOW" on a given trace. | ||
|
||
<p align="center"><img src="./images/zipkin.jpg?raw=true"/></p> | ||
|
||
### Jaeger | ||
|
||
Run the server: | ||
|
||
```sh | ||
npm run jaeger:server | ||
``` | ||
|
||
Then run the client in a separate terminal: | ||
|
||
```sh | ||
npm run jaeger:client | ||
``` | ||
|
||
Visit the Jaeger UI at <http://localhost:16686/search>, select a service (e.g. "example-express-client"), click "Find Traces", then click on a trace to view it. | ||
|
||
<p align="center"><img src="images/jaeger.jpg?raw=true"/></p> | ||
|
||
## Useful links | ||
|
||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/> | ||
- For more information on OpenTelemetry for Node.js, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node> | ||
|
||
## LICENSE | ||
|
||
Apache License 2.0 |
File renamed without changes
File renamed without changes
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 |
---|---|---|
|
@@ -8,13 +8,12 @@ | |
"zipkin:client": "cross-env EXPORTER=zipkin ts-node src/client.ts", | ||
"jaeger:server": "cross-env EXPORTER=jaeger ts-node src/server.ts", | ||
"jaeger:client": "cross-env EXPORTER=jaeger ts-node src/client.ts", | ||
"compile": "tsc -p .", | ||
"setup": "cd ../../../../ && npm ci && cd plugins/node/opentelemetry-instrumentation-express && npm run compile && cd examples && npm run compile" | ||
"compile": "tsc -p ." | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/open-telemetry/opentelemetry-js-contrib.git", | ||
"directory": "plugins/node/opentelemetry-instrumentation-express" | ||
"directory": "examples/express" | ||
}, | ||
"keywords": [ | ||
"opentelemetry", | ||
|
@@ -29,7 +28,7 @@ | |
"bugs": { | ||
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express/examples#readme", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/express#readme", | ||
"dependencies": { | ||
"@opentelemetry/api": "^1.3.0", | ||
"@opentelemetry/exporter-jaeger": "^1.18.1", | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nstrumentation-koa/examples/tsconfig.json → examples/express/tsconfig.json
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
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 @@ | ||
package-lock=false |
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
File renamed without changes
File renamed without changes
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
"private": true, | ||
"version": "0.1.0", | ||
"description": "Example of Koa and @koa/router integration with OpenTelemetry", | ||
"main": "index.js", | ||
"scripts": { | ||
"zipkin:server": "cross-env EXPORTER=zipkin ts-node src/server.ts", | ||
"zipkin:client": "cross-env EXPORTER=zipkin ts-node src/client.ts", | ||
|
@@ -13,7 +12,8 @@ | |
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/open-telemetry/opentelemetry-js-contrib.git" | ||
"url": "git+ssh://[email protected]/open-telemetry/opentelemetry-js-contrib.git", | ||
"directory": "examples/koa" | ||
}, | ||
"keywords": [ | ||
"opentelemetry", | ||
|
@@ -42,7 +42,7 @@ | |
"axios": "^1.6.0", | ||
"koa": "^2.13.0" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/koa#readme", | ||
"devDependencies": { | ||
"cross-env": "^7.0.0", | ||
"ts-node": "^10.6.0", | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...umentation-mongodb/examples/tsconfig.json → examples/koa/tsconfig.json
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
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 @@ | ||
package-lock=false |
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
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...umentation-express/examples/tsconfig.json → examples/mongodb/tsconfig.json
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
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 @@ | ||
package-lock=false |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
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
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...trumentation-mysql/examples/tsconfig.json → examples/mysql/tsconfig.json
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
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 @@ | ||
package-lock=false |
Oops, something went wrong.