Skip to content

Commit

Permalink
Merge branch 'main' into docs/readme-remove-lists
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 authored Apr 18, 2022
2 parents 97cea5c + b55b79b commit 0f28d5f
Show file tree
Hide file tree
Showing 52 changed files with 85 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Cache Dependencies
if: ${{ steps.release.outputs.releases_created }}
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
node_modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-all-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
node_modules
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
node_modules
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
run: npm run test:ci:changed -- ${{ matrix.lerna-extra-args }}
- name: Report Coverage
if: matrix.node == '14'
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
verbose: true

Expand All @@ -176,7 +176,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
node_modules
Expand All @@ -201,6 +201,6 @@ jobs:
- name: Unit tests
run: npm run test:browser
- name: Report Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
verbose: true
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
"build/src/**/*.js.map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
3 changes: 3 additions & 0 deletions metapackages/auto-instrumentations-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"author": "OpenTelemetry Authors",
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"publishConfig": {
"access": "public"
},
Expand Down
3 changes: 3 additions & 0 deletions metapackages/auto-instrumentations-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"author": "OpenTelemetry Authors",
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"keywords": [],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-id-generator-aws-xray/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/esm/**/*.js",
Expand Down
3 changes: 3 additions & 0 deletions packages/opentelemetry-propagation-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"bugs": {
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/opentelemetry-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.12.0"
},
"bugs": {
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
"engines": {
"node": ">=10.0.0"
}
}
}
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-tedious/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=10.0.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@
"typescript": "4.3.4"
},
"engines": {
"node": ">=12"
"node": ">=12.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ export class ExpressInstrumentation extends InstrumentationBase<
(moduleExports, moduleVersion) => {
if (moduleExports === undefined) return;
diag.debug(`Removing patch for express@${moduleVersion}`);
this._unwrap(moduleExports.Router.prototype, 'route');
this._unwrap(moduleExports.Router.prototype, 'use');
this._unwrap(moduleExports.application.prototype, 'use');
const routerProto = moduleExports.Router as unknown as express.Router;
this._unwrap(routerProto, 'route');
this._unwrap(routerProto, 'use');
this._unwrap(moduleExports.application, 'use');
}
),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,12 @@ describe('ExpressInstrumentation', () => {
describe('Instrumenting normal get operations', () => {
it('should create a child span for middlewares', async () => {
const rootSpan = tracer.startSpan('rootSpan');
const app = express();
app.use((req, res, next) =>
context.with(trace.setSpan(context.active(), rootSpan), next)
);
app.use(express.json());
const customMiddleware: express.RequestHandler = (req, res, next) => {
for (let i = 0; i < 1000000; i++) {
continue;
}
return next();
};
app.use(customMiddleware);
const router = express.Router();
app.use('/toto', router);
let finishListenerCount: number | undefined;
const { server, port } = await serverWithMiddleware(
tracer,
Expand Down Expand Up @@ -289,22 +281,30 @@ describe('ExpressInstrumentation', () => {

describe('Disabling plugin', () => {
it('should not create new spans', async () => {
instrumentation.disable();
const rootSpan = tracer.startSpan('rootSpan');
const app = express();
app.use(express.json());
app.use((req, res, next) => {
for (let i = 0; i < 1000; i++) {
continue;
const { server, port } = await serverWithMiddleware(
tracer,
rootSpan,
app => {
app.use(express.json());
const customMiddleware: express.RequestHandler = (req, res, next) => {
for (let i = 0; i < 1000; i++) {
continue;
}
return next();
};
app.use(customMiddleware);
}
return next();
});
const { server, port } = await createServer(app);
);
assert.strictEqual(memoryExporter.getFinishedSpans().length, 0);
await context.with(
trace.setSpan(context.active(), rootSpan),
async () => {
await httpRequest.get(`http://localhost:${port}/toto/tata`);
rootSpan.end();
// There should be exactly one span, and it should be the root span.
// There should not be any spans from the Express instrumentation.
assert.deepEqual(memoryExporter.getFinishedSpans().length, 1);
assert.notStrictEqual(
memoryExporter.getFinishedSpans()[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.5.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
"node": ">=8.12.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=12"
"node": ">=12.0.0"
},
"files": [
"build/src/**/*.js",
Expand Down
Loading

0 comments on commit 0f28d5f

Please sign in to comment.