diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..10ad648c67 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,35 @@ +name: "CodeQL Analysis" + +on: + workflow_dispatch: + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * + - cron: '30 1 * * *' + +jobs: + CodeQL-Build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: javascript + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1370e0cb6c..68227b0d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. ## Unreleased +## 0.12.1 + +#### :bug: Bug Fix + +* [#299](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/299) chore: fixing parent span for graphql ([@obecny](https://github.com/obecny)) +* [#300](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/300) chore: fixing async resolvers for graphql ([@obecny](https://github.com/obecny)) +* [#290](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/290) docs: fix links to examples ([@aabmass](https://github.com/aabmass)) + +#### :rocket: Enhancement + +* [#273](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/273) feat: enable root span route instrumentation without any express layer spans ([@shyimo](https://github.com/shyimo)) +* [#298](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/298) Add CodeQL Security Scans ([@amanbrar1999](https://github.com/amanbrar1999)) + +#### Committers: 7 + +* Aaron Abbott ([@aabmass](https://github.com/aabmass)) +* Aman Brar ([@amanbrar1999](https://github.com/amanbrar1999)) +* Bartlomiej Obecny ([@obecny](https://github.com/obecny)) +* Dobes Vandermeer ([@dobesv](https://github.com/dobesv)) +* Gerhard Stöbich ([@Flarna](https://github.com/Flarna)) +* Johannes Würbach ([@johanneswuerbach](https://github.com/johanneswuerbach)) +* Shai Moria ([@shyimo](https://github.com/shyimo)) + ## 0.12.0 ### :bug: Bug Fix diff --git a/detectors/node/opentelemetry-resource-detector-github/package.json b/detectors/node/opentelemetry-resource-detector-github/package.json index bf972ab26a..4b80ebe7c4 100644 --- a/detectors/node/opentelemetry-resource-detector-github/package.json +++ b/detectors/node/opentelemetry-resource-detector-github/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-github", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry SDK resource detector for GitHub", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/detectors/node/opentelemetry-resource-detector-github/src/version.ts b/detectors/node/opentelemetry-resource-detector-github/src/version.ts index 707690f363..c032ed99f3 100644 --- a/detectors/node/opentelemetry-resource-detector-github/src/version.ts +++ b/detectors/node/opentelemetry-resource-detector-github/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/examples/dns/package.json b/examples/dns/package.json index bffeb99e2b..20c80d5b4e 100644 --- a/examples/dns/package.json +++ b/examples/dns/package.json @@ -1,7 +1,7 @@ { "name": "dns-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of DNS integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -30,7 +30,7 @@ "@opentelemetry/exporter-jaeger": "^0.14.0", "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/node": "^0.14.0", - "@opentelemetry/plugin-dns": "^0.12.0", + "@opentelemetry/plugin-dns": "^0.12.1", "@opentelemetry/tracing": "^0.14.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", diff --git a/examples/express/package.json b/examples/express/package.json index 3e3d0202c3..6ffcf5a6ab 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -1,7 +1,7 @@ { "name": "express-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of Express integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -32,7 +32,7 @@ "@opentelemetry/exporter-jaeger": "^0.14.0", "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/node": "^0.14.0", - "@opentelemetry/plugin-express": "^0.12.0", + "@opentelemetry/plugin-express": "^0.12.1", "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0", diff --git a/examples/graphql/docker/docker-compose.yaml b/examples/graphql/docker/docker-compose.yaml index d4e0a42a19..cae7e1f510 100644 --- a/examples/graphql/docker/docker-compose.yaml +++ b/examples/graphql/docker/docker-compose.yaml @@ -3,7 +3,7 @@ services: # Collector collector: # image: otel/opentelemetry-collector:latest - image: otel/opentelemetry-collector:0.13.0 + image: otel/opentelemetry-collector:0.16.0 command: ["--config=/conf/collector-config.yaml", "--log-level=DEBUG"] volumes: - ./collector-config.yaml:/conf/collector-config.yaml diff --git a/examples/graphql/package.json b/examples/graphql/package.json index a03cd14e46..ae18e578b7 100644 --- a/examples/graphql/package.json +++ b/examples/graphql/package.json @@ -1,7 +1,7 @@ { "name": "opentelemetry-plugin-graphql-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of using @opentelemetry/plugin-graphql with OpenTelemetry", "main": "index.js", "scripts": { @@ -33,9 +33,9 @@ "dependencies": { "@opentelemetry/api": "^0.14.0", "@opentelemetry/exporter-collector": "^0.14.0", - "@opentelemetry/instrumentation-graphql": "^0.12.0", + "@opentelemetry/instrumentation-graphql": "^0.12.1", "@opentelemetry/node": "^0.14.0", - "@opentelemetry/plugin-express": "^0.12.0", + "@opentelemetry/plugin-express": "^0.12.1", "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/plugin-https": "^0.14.0", "@opentelemetry/tracing": "^0.14.0", diff --git a/examples/grpc-census-prop/package.json b/examples/grpc-census-prop/package.json index 02d3a9c556..9347aeecb6 100644 --- a/examples/grpc-census-prop/package.json +++ b/examples/grpc-census-prop/package.json @@ -1,6 +1,6 @@ { "name": "grpc-census-prop-example", - "version": "0.12.0", + "version": "0.12.1", "description": "Example of using propagator-grpc-census-binary", "main": "index.js", "scripts": { @@ -38,7 +38,7 @@ "@opentelemetry/core": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-grpc": "^0.14.0", - "@opentelemetry/propagator-grpc-census-binary": "^0.12.0", + "@opentelemetry/propagator-grpc-census-binary": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "grpc": "^1.24.2", "node-pre-gyp": "0.12.0" diff --git a/examples/hapi/package.json b/examples/hapi/package.json index 7a92ebb904..165851a60e 100644 --- a/examples/hapi/package.json +++ b/examples/hapi/package.json @@ -1,7 +1,7 @@ { "name": "hapi-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of Hapi auto-instrumentation with OpenTelemetry", "main": "index.js", "scripts": { @@ -35,7 +35,7 @@ "@opentelemetry/api": "^0.14.0", "@opentelemetry/exporter-jaeger": "^0.14.0", "@opentelemetry/exporter-zipkin": "^0.14.0", - "@opentelemetry/hapi-instrumentation": "^0.12.0", + "@opentelemetry/hapi-instrumentation": "^0.12.1", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/tracing": "^0.14.0", diff --git a/examples/host-metrics/package.json b/examples/host-metrics/package.json index d224c1c4b6..3dc3eebffe 100644 --- a/examples/host-metrics/package.json +++ b/examples/host-metrics/package.json @@ -1,7 +1,7 @@ { "name": "host-metrics-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of using @opentelemetry/host-metrics", "main": "index.js", "scripts": { @@ -30,7 +30,7 @@ "@opentelemetry/core": "^0.14.0", "@opentelemetry/exporter-collector": "^0.14.0", "@opentelemetry/exporter-prometheus": "^0.14.0", - "@opentelemetry/host-metrics": "^0.12.0", + "@opentelemetry/host-metrics": "^0.12.1", "@opentelemetry/metrics": "^0.14.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme" diff --git a/examples/ioredis/package.json b/examples/ioredis/package.json index ce4860225e..ff982ea23f 100644 --- a/examples/ioredis/package.json +++ b/examples/ioredis/package.json @@ -1,7 +1,7 @@ { "name": "ioredis-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of HTTP integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -31,7 +31,7 @@ "@opentelemetry/api": "^0.14.0", "@opentelemetry/exporter-jaeger": "^0.14.0", "@opentelemetry/node": "^0.14.0", - "@opentelemetry/plugin-ioredis": "^0.12.0", + "@opentelemetry/plugin-ioredis": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "ioredis": "^4.14.1" }, diff --git a/examples/koa/package.json b/examples/koa/package.json index 996e831e50..18f5154ec3 100644 --- a/examples/koa/package.json +++ b/examples/koa/package.json @@ -1,7 +1,7 @@ { "name": "koa-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of Koa and @koa/router integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -35,7 +35,7 @@ "@opentelemetry/api": "^0.14.0", "@opentelemetry/exporter-jaeger": "^0.14.0", "@opentelemetry/exporter-zipkin": "^0.14.0", - "@opentelemetry/koa-instrumentation": "^0.12.0", + "@opentelemetry/koa-instrumentation": "^0.12.1", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/tracing": "^0.14.0", diff --git a/examples/mysql/package.json b/examples/mysql/package.json index 1f2a982ad3..0c58c347bb 100644 --- a/examples/mysql/package.json +++ b/examples/mysql/package.json @@ -1,7 +1,7 @@ { "name": "mysql-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of mysql integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -33,7 +33,7 @@ "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-http": "^0.14.0", - "@opentelemetry/plugin-mysql": "^0.12.0", + "@opentelemetry/plugin-mysql": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "mysql": "*" }, diff --git a/examples/postgres/package.json b/examples/postgres/package.json index 7ed803c5e8..60bc2f13a7 100644 --- a/examples/postgres/package.json +++ b/examples/postgres/package.json @@ -1,7 +1,7 @@ { "name": "postgres-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of Postgres integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -35,8 +35,8 @@ "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-http": "^0.14.0", - "@opentelemetry/plugin-pg": "^0.12.0", - "@opentelemetry/plugin-pg-pool": "^0.12.0", + "@opentelemetry/plugin-pg": "^0.12.1", + "@opentelemetry/plugin-pg-pool": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "express": "^4.17.1", "pg": "^7.12.1" diff --git a/examples/redis/package.json b/examples/redis/package.json index f4881da9f1..ccbd8a47da 100644 --- a/examples/redis/package.json +++ b/examples/redis/package.json @@ -1,7 +1,7 @@ { "name": "redis-example", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Example of HTTP integration with OpenTelemetry", "main": "index.js", "scripts": { @@ -35,7 +35,7 @@ "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-http": "^0.14.0", - "@opentelemetry/plugin-redis": "^0.12.0", + "@opentelemetry/plugin-redis": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0", "express": "^4.17.1", diff --git a/lerna.json b/lerna.json index b22dc0fbeb..1bbdff1c58 100644 --- a/lerna.json +++ b/lerna.json @@ -9,7 +9,7 @@ "propagators/*", "detectors/node/*" ], - "version": "0.12.0", + "version": "0.12.1", "changelog": { "repo": "open-telemetry/opentelemetry-js-contrib", "labels": { diff --git a/metapackages/plugins-node-core-and-contrib/package.json b/metapackages/plugins-node-core-and-contrib/package.json index 8c3c5efe99..0baf75d6f3 100644 --- a/metapackages/plugins-node-core-and-contrib/package.json +++ b/metapackages/plugins-node-core-and-contrib/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugins-node-core-and-contrib", - "version": "0.12.0", + "version": "0.12.1", "description": "Metapackage which bundles opentelemetry node core and contrib plugins", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", @@ -16,13 +16,13 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/plugin-express": "^0.12.0", - "@opentelemetry/plugin-ioredis": "^0.12.0", - "@opentelemetry/plugin-mongodb": "^0.12.0", - "@opentelemetry/plugin-mysql": "^0.12.0", - "@opentelemetry/plugin-pg": "^0.12.0", - "@opentelemetry/plugin-pg-pool": "^0.12.0", - "@opentelemetry/plugin-redis": "^0.12.0", + "@opentelemetry/plugin-express": "^0.12.1", + "@opentelemetry/plugin-ioredis": "^0.12.1", + "@opentelemetry/plugin-mongodb": "^0.12.1", + "@opentelemetry/plugin-mysql": "^0.12.1", + "@opentelemetry/plugin-pg": "^0.12.1", + "@opentelemetry/plugin-pg-pool": "^0.12.1", + "@opentelemetry/plugin-redis": "^0.12.1", "@opentelemetry/plugins-node-core": "^0.14.0" } } diff --git a/package.json b/package.json index 2e4607533b..c9ec44c635 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opentelemetry-contrib", - "version": "0.12.0", + "version": "0.12.1", "description": "This is a repository for OpenTelemetry JavaScript contributions.", "repository": { "type": "git", diff --git a/packages/opentelemetry-host-metrics/package.json b/packages/opentelemetry-host-metrics/package.json index be2102f221..fab6285677 100644 --- a/packages/opentelemetry-host-metrics/package.json +++ b/packages/opentelemetry-host-metrics/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/host-metrics", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry Host Metrics for Node.js", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/packages/opentelemetry-host-metrics/src/version.ts b/packages/opentelemetry-host-metrics/src/version.ts index 707690f363..c032ed99f3 100644 --- a/packages/opentelemetry-host-metrics/src/version.ts +++ b/packages/opentelemetry-host-metrics/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/packages/opentelemetry-test-utils/package.json b/packages/opentelemetry-test-utils/package.json index ed2c342971..e23b157817 100644 --- a/packages/opentelemetry-test-utils/package.json +++ b/packages/opentelemetry-test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@opentelemetry/test-utils", "private": true, - "version": "0.12.0", + "version": "0.12.1", "description": "Test utilities.", "main": "build/testUtils.js", "scripts": { diff --git a/plugins/node/opentelemetry-hapi-instrumentation/package.json b/plugins/node/opentelemetry-hapi-instrumentation/package.json index 9097182e7d..39535f34d6 100644 --- a/plugins/node/opentelemetry-hapi-instrumentation/package.json +++ b/plugins/node/opentelemetry-hapi-instrumentation/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/hapi-instrumentation", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry Hapi automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-hapi-instrumentation/src/version.ts b/plugins/node/opentelemetry-hapi-instrumentation/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-hapi-instrumentation/src/version.ts +++ b/plugins/node/opentelemetry-hapi-instrumentation/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index c63856d7d9..83b26371ee 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-graphql", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry @opentelemetry/instrumentation-graphql automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/graphql.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/graphql.ts index a197abf89a..0dee195030 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/graphql.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/graphql.ts @@ -26,7 +26,7 @@ import { Maybe } from 'graphql/jsutils/Maybe'; import type * as graphqlTypes from 'graphql'; import { GraphQLFieldResolver } from 'graphql/type/definition'; import { SpanAttributes, SpanNames } from './enum'; -import { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_SPAN_SYMBOL } from './symbols'; +import { OTEL_GRAPHQL_DATA_SYMBOL } from './symbols'; import { executeFunctionWithObj, @@ -38,7 +38,6 @@ import { GraphQLInstrumentationParsedConfig, OtelExecutionArgs, ObjectWithGraphQLData, - ObjectWithOtelSpan, OPERATION_NOT_SUPPORTED, } from './types'; import { @@ -283,7 +282,6 @@ export class GraphQLInstrumentation extends InstrumentationBase { }, (err, result) => { if (result) { - (result as ObjectWithOtelSpan)[OTEL_SPAN_SYMBOL] = span; const operation = getOperation(result); if (!operation) { span.updateName(SpanNames.SCHEMA_PARSE); @@ -306,16 +304,7 @@ export class GraphQLInstrumentation extends InstrumentationBase { typeInfo?: graphqlTypes.TypeInfo, options?: { maxErrors?: number } ): ReadonlyArray { - const document = documentAST as ObjectWithOtelSpan; - const parentSpan = document[OTEL_SPAN_SYMBOL]; - const span = this.tracer.startSpan( - SpanNames.VALIDATE, - {}, - parentSpan - ? api.setActiveSpan(api.context.active(), parentSpan) - : undefined - ); - document[OTEL_SPAN_SYMBOL] = span; + const span = this.tracer.startSpan(SpanNames.VALIDATE, {}); return this.tracer.withSpan(span, () => { return safeExecuteInTheMiddle>( @@ -350,16 +339,8 @@ export class GraphQLInstrumentation extends InstrumentationBase { processedArgs: graphqlTypes.ExecutionArgs ): api.Span { const config = this._getConfig(); - const document = processedArgs.document as ObjectWithOtelSpan; - - const parentSpan = document[OTEL_SPAN_SYMBOL]; - const span = this.tracer.startSpan( - SpanNames.EXECUTE, - {}, - parentSpan - ? api.setActiveSpan(api.context.active(), parentSpan) - : undefined - ); + + const span = this.tracer.startSpan(SpanNames.EXECUTE, {}); if (operation) { const name = (operation as graphqlTypes.OperationDefinitionNode) .operation; diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/symbols.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/symbols.ts index 88cff1c233..dd9adcd2c3 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/symbols.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/symbols.ts @@ -19,5 +19,3 @@ export const OTEL_PATCHED_SYMBOL = Symbol.for('opentelemetry.patched'); export const OTEL_GRAPHQL_DATA_SYMBOL = Symbol.for( 'opentelemetry.graphql_data' ); - -export const OTEL_SPAN_SYMBOL = Symbol.for('opentelemetry.span'); diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/types.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/types.ts index c3c78b3653..5390c37887 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/types.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/types.ts @@ -25,11 +25,7 @@ import { GraphQLTypeResolver, } from 'graphql/type/definition'; import { GraphQLSchema } from 'graphql/type/schema'; -import { - OTEL_GRAPHQL_DATA_SYMBOL, - OTEL_PATCHED_SYMBOL, - OTEL_SPAN_SYMBOL, -} from './symbols'; +import { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_PATCHED_SYMBOL } from './symbols'; export const OPERATION_NOT_SUPPORTED = 'Operation$operationName$not' + ' supported'; @@ -130,10 +126,6 @@ interface OtelGraphQLData { fields: { [key: string]: GraphQLField }; } -export interface ObjectWithOtelSpan { - [OTEL_SPAN_SYMBOL]?: api.Span; -} - export interface ObjectWithGraphQLData { [OTEL_GRAPHQL_DATA_SYMBOL]?: OtelGraphQLData; } diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts index e3b066d1c9..de7e6c80ba 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation'; import type * as graphqlTypes from 'graphql'; import * as api from '@opentelemetry/api'; import type { Maybe } from 'graphql/jsutils/Maybe'; @@ -358,8 +357,11 @@ export function wrapFieldResolver( } return tracer.withSpan(field.span, () => { - return safeExecuteInTheMiddle< - Maybe> + return safeExecuteInTheMiddleAsync< + | Maybe> + | Promise< + Maybe> + > >( () => { return fieldResolver.call(this, source, args, contextValue, info); @@ -377,3 +379,32 @@ export function wrapFieldResolver( return wrappedFieldResolver; } + +/** + * Async version of safeExecuteInTheMiddle from instrumentation package + * can be removed once this will be added to instrumentation package + * @param execute + * @param onFinish + * @param preventThrowingError + */ +async function safeExecuteInTheMiddleAsync( + execute: () => T, + onFinish: (e: Error | undefined, result: T | undefined) => void, + preventThrowingError?: boolean +): Promise { + let error: Error | undefined; + let result: T | undefined; + try { + result = await execute(); + } catch (e) { + error = e; + } finally { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + // eslint-disable-next-line no-unsafe-finally + return result as T; + } +} diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/version.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/version.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts index 0b05712e63..4016a7fc3f 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts @@ -130,19 +130,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -158,15 +153,12 @@ describe('graphql', () => { 'query' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; const span2 = spans[5]; const span3 = spans[6]; @@ -240,19 +232,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -268,15 +255,12 @@ describe('graphql', () => { 'query' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -334,19 +318,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -366,15 +345,12 @@ describe('graphql', () => { undefined ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -434,19 +410,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { const executeSpan = spans[2]; - const validateSpan = spans[1]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -462,10 +433,7 @@ describe('graphql', () => { 'query' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); }); }); @@ -506,19 +474,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -534,10 +497,7 @@ describe('graphql', () => { 'query' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); }); @@ -601,19 +561,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -629,15 +584,12 @@ describe('graphql', () => { 'query' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -698,19 +650,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -729,15 +676,12 @@ describe('graphql', () => { 'mutation' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -795,19 +739,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -827,15 +766,12 @@ describe('graphql', () => { 2 ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -898,19 +834,14 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); }); it('should instrument execute', () => { - const executeSpan = spans[3]; - const validateSpan = spans[1]; + const executeSpan = spans[2]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -929,15 +860,12 @@ describe('graphql', () => { 'mutation' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); it('should instrument resolvers', () => { - const executeSpan = spans[3]; - const resolveParentSpan = spans[2]; + const executeSpan = spans[2]; + const resolveParentSpan = spans[3]; const span1 = spans[4]; assertResolveSpan( @@ -1027,14 +955,10 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); const event = validateSpan.events[0]; assert.deepStrictEqual(event.name, 'exception'); @@ -1084,14 +1008,10 @@ describe('graphql', () => { }); it('should instrument validate', () => { - const parseSpan = spans[0]; const validateSpan = spans[1]; assert.deepStrictEqual(validateSpan.name, SpanNames.VALIDATE); - assert.deepStrictEqual( - validateSpan.parentSpanId, - parseSpan.spanContext.spanId - ); + assert.deepStrictEqual(validateSpan.parentSpanId, undefined); const event = validateSpan.events[0]; assert.ok(!event); @@ -1099,7 +1019,6 @@ describe('graphql', () => { it('should instrument execute', () => { const executeSpan = spans[2]; - const validateSpan = spans[1]; assert.deepStrictEqual( executeSpan.attributes[SpanAttributes.SOURCE], @@ -1115,10 +1034,7 @@ describe('graphql', () => { 'Operation "foo" not supported' ); assert.deepStrictEqual(executeSpan.name, SpanNames.EXECUTE); - assert.deepStrictEqual( - executeSpan.parentSpanId, - validateSpan.spanContext.spanId - ); + assert.deepStrictEqual(executeSpan.parentSpanId, undefined); }); }); }); diff --git a/plugins/node/opentelemetry-koa-instrumentation/package.json b/plugins/node/opentelemetry-koa-instrumentation/package.json index b7cfd12125..6ed5f4c222 100644 --- a/plugins/node/opentelemetry-koa-instrumentation/package.json +++ b/plugins/node/opentelemetry-koa-instrumentation/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/koa-instrumentation", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry Koa automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-koa-instrumentation/src/version.ts b/plugins/node/opentelemetry-koa-instrumentation/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-koa-instrumentation/src/version.ts +++ b/plugins/node/opentelemetry-koa-instrumentation/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-dns/package.json b/plugins/node/opentelemetry-plugin-dns/package.json index 888b09b2a2..6c525f9607 100644 --- a/plugins/node/opentelemetry-plugin-dns/package.json +++ b/plugins/node/opentelemetry-plugin-dns/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-dns", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry dns automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-plugin-dns/src/version.ts b/plugins/node/opentelemetry-plugin-dns/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-dns/src/version.ts +++ b/plugins/node/opentelemetry-plugin-dns/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-express/package.json b/plugins/node/opentelemetry-plugin-express/package.json index 8820b9f966..897bdc28e7 100644 --- a/plugins/node/opentelemetry-plugin-express/package.json +++ b/plugins/node/opentelemetry-plugin-express/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-express", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry express automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -50,6 +50,7 @@ "@types/node": "14.0.27", "@types/shimmer": "1.0.1", "codecov": "3.7.2", + "eslint-plugin-header": "^3.1.0", "express": "4.17.1", "gts": "2.0.2", "mocha": "7.2.0", diff --git a/plugins/node/opentelemetry-plugin-express/src/express.ts b/plugins/node/opentelemetry-plugin-express/src/express.ts index d5d66cefd3..a43adbc7c6 100644 --- a/plugins/node/opentelemetry-plugin-express/src/express.ts +++ b/plugins/node/opentelemetry-plugin-express/src/express.ts @@ -29,6 +29,7 @@ import { _LAYERS_STORE_PROPERTY, ExpressPluginConfig, ExpressLayerType, + ExpressPluginSpan, } from './types'; import { getLayerMetadata, storeLayerPath, isLayerIgnored } from './utils'; import { VERSION } from './version'; @@ -170,7 +171,7 @@ export class ExpressPlugin extends BasePlugin { ) { storeLayerPath(req, layerPath); const route = (req[_LAYERS_STORE_PROPERTY] as string[]) - .filter(path => path !== '/') + .filter(path => path !== '/' && path !== '/*') .join(''); const attributes: Attributes = { [AttributeNames.COMPONENT]: ExpressPlugin.component, @@ -180,6 +181,22 @@ export class ExpressPlugin extends BasePlugin { const type = metadata.attributes[ AttributeNames.EXPRESS_TYPE ] as ExpressLayerType; + + // Rename the root http span in case we haven't done it already + // once we reach the request handler + if ( + metadata.attributes[AttributeNames.EXPRESS_TYPE] === + ExpressLayerType.REQUEST_HANDLER + ) { + const parent = plugin._tracer.getCurrentSpan() as ExpressPluginSpan; + if (parent?.name) { + const parentRoute = parent.name.split(' ')[1]; + if (!route.includes(parentRoute)) { + parent.updateName(`${req.method} ${route}`); + } + } + } + // verify against the config if the layer should be ignored if (isLayerIgnored(metadata.name, type, plugin._config)) { return original.apply(this, arguments); @@ -187,16 +204,7 @@ export class ExpressPlugin extends BasePlugin { if (plugin._tracer.getCurrentSpan() === undefined) { return original.apply(this, arguments); } - // Rename the root http span once we reach the request handler - if ( - metadata.attributes[AttributeNames.EXPRESS_TYPE] === - ExpressLayerType.REQUEST_HANDLER - ) { - const parent = plugin._tracer.getCurrentSpan(); - if (parent) { - parent.updateName(`${req.method} ${route}`); - } - } + const span = plugin._tracer.startSpan(metadata.name, { attributes: Object.assign(attributes, metadata.attributes), }); @@ -242,7 +250,9 @@ export class ExpressPlugin extends BasePlugin { * the layer directly end the http response, so we'll hook into the "finish" * event to handle the later case. */ - req.res?.once('finish', onResponseFinish); + if (!spanHasEnded) { + req.res?.once('finish', onResponseFinish); + } return result; }; }); diff --git a/plugins/node/opentelemetry-plugin-express/src/types.ts b/plugins/node/opentelemetry-plugin-express/src/types.ts index c4bde0108a..051eed6431 100644 --- a/plugins/node/opentelemetry-plugin-express/src/types.ts +++ b/plugins/node/opentelemetry-plugin-express/src/types.ts @@ -16,7 +16,7 @@ import { kLayerPatched } from './express'; import { Request } from 'express'; -import { Attributes } from '@opentelemetry/api'; +import { Attributes, Span } from '@opentelemetry/api'; import { PluginConfig } from '@opentelemetry/core'; /** @@ -93,3 +93,10 @@ export interface ExpressPluginConfig extends PluginConfig { /** Ignore specific layers based on their type */ ignoreLayersType?: ExpressLayerType[]; } + +/** + * extends opentelemetry/api Span object to instrument the root span name of http plugin + */ +export interface ExpressPluginSpan extends Span { + name?: string; +} diff --git a/plugins/node/opentelemetry-plugin-express/src/version.ts b/plugins/node/opentelemetry-plugin-express/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-express/src/version.ts +++ b/plugins/node/opentelemetry-plugin-express/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-express/test/express.test.ts b/plugins/node/opentelemetry-plugin-express/test/express.test.ts index 81f4d3259c..33bdd50915 100644 --- a/plugins/node/opentelemetry-plugin-express/test/express.test.ts +++ b/plugins/node/opentelemetry-plugin-express/test/express.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { context } from '@opentelemetry/api'; +import { context, Span, Tracer } from '@opentelemetry/api'; import { NoopLogger } from '@opentelemetry/core'; import { NodeTracerProvider } from '@opentelemetry/node'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; @@ -31,6 +31,7 @@ import { AttributeNames, ExpressLayerType, ExpressPluginConfig, + ExpressPluginSpan, } from '../src/types'; const httpRequest = { @@ -52,6 +53,37 @@ const httpRequest = { }, }; +const serverWithMiddleware = async ( + tracer: Tracer, + rootSpan: Span, + addMiddlewares: (app: express.Express) => void +): Promise => { + const app = express(); + if (tracer) { + app.use((req, res, next) => tracer.withSpan(rootSpan, next)); + } + + app.use(express.json()); + + addMiddlewares(app); + + const router = express.Router(); + app.use('/toto', router); + router.get('/:id', (req, res) => { + setImmediate(() => { + res.status(200).end(req.params.id); + }); + }); + const server = http.createServer(app); + await new Promise(resolve => + server.listen(0, () => { + resolve(); + }) + ); + + return server; +}; + describe('Express Plugin', () => { const logger = new NoopLogger(); const provider = new NodeTracerProvider(); @@ -77,31 +109,41 @@ describe('Express Plugin', () => { describe('Instrumenting normal get operations', () => { it('should create a child span for middlewares', async () => { - const rootSpan = tracer.startSpan('rootSpan'); + const rootSpan = tracer.startSpan('rootSpan') as ExpressPluginSpan; const app = express(); app.use((req, res, next) => tracer.withSpan(rootSpan, next)); app.use(express.json()); - // eslint-disable-next-line prefer-arrow-callback - app.use(function customMiddleware(req, res, next) { + 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); - router.get('/:id', (req, res) => { - setImmediate(() => { - res.status(200).end(); + let finishListenerCount: number | undefined; + const server = await serverWithMiddleware(tracer, rootSpan, app => { + app.use((req, res, next) => { + res.on('finish', () => { + finishListenerCount = res.listenerCount('finish'); + }); + next(); }); + for (let index = 0; index < 15; index++) { + app.use(customMiddleware); + } }); - const server = http.createServer(app); - await new Promise(resolve => server.listen(0, resolve)); const port = (server.address() as AddressInfo).port; assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); await tracer.withSpan(rootSpan, async () => { - await httpRequest.get(`http://localhost:${port}/toto/tata`); + const response = await httpRequest.get( + `http://localhost:${port}/toto/tata` + ); + assert.strictEqual(response, 'tata'); rootSpan.end(); + assert.strictEqual(rootSpan.name, 'GET /toto/:id'); + assert.strictEqual(finishListenerCount, 2); assert.notStrictEqual( memoryExporter .getFinishedSpans() @@ -138,13 +180,129 @@ describe('Express Plugin', () => { server.close(); }); + it('supports sync middlewares directly responding', async () => { + const rootSpan = tracer.startSpan('rootSpan'); + let finishListenerCount: number | undefined; + const server = await serverWithMiddleware(tracer, rootSpan, app => { + app.use((req, res, next) => { + res.on('finish', () => { + finishListenerCount = res.listenerCount('finish'); + }); + next(); + }); + const syncMiddleware: express.RequestHandler = (req, res, next) => { + for (let i = 0; i < 1000000; i++) { + continue; + } + res.status(200).end('middleware'); + }; + for (let index = 0; index < 15; index++) { + app.use(syncMiddleware); + } + }); + const port = (server.address() as AddressInfo).port; + assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); + await tracer.withSpan(rootSpan, async () => { + const response = await httpRequest.get( + `http://localhost:${port}/toto/tata` + ); + assert.strictEqual(response, 'middleware'); + rootSpan.end(); + assert.strictEqual(finishListenerCount, 3); + assert.notStrictEqual( + memoryExporter + .getFinishedSpans() + .find(span => span.name.includes('syncMiddleware')), + undefined, + 'no syncMiddleware span' + ); + }); + server.close(); + }); + + it('supports async middlewares', async () => { + const rootSpan = tracer.startSpan('rootSpan'); + let finishListenerCount: number | undefined; + const server = await serverWithMiddleware(tracer, rootSpan, app => { + app.use((req, res, next) => { + res.on('finish', () => { + finishListenerCount = res.listenerCount('finish'); + }); + next(); + }); + const asyncMiddleware: express.RequestHandler = (req, res, next) => { + setTimeout(() => { + next(); + }, 50); + }; + for (let index = 0; index < 15; index++) { + app.use(asyncMiddleware); + } + }); + const port = (server.address() as AddressInfo).port; + assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); + await tracer.withSpan(rootSpan, async () => { + const response = await httpRequest.get( + `http://localhost:${port}/toto/tata` + ); + assert.strictEqual(response, 'tata'); + rootSpan.end(); + assert.strictEqual(finishListenerCount, 2); + assert.notStrictEqual( + memoryExporter + .getFinishedSpans() + .find(span => span.name.includes('asyncMiddleware')), + undefined, + 'no asyncMiddleware span' + ); + }); + server.close(); + }); + + it('supports async middlewares directly responding', async () => { + const rootSpan = tracer.startSpan('rootSpan'); + let finishListenerCount: number | undefined; + const server = await serverWithMiddleware(tracer, rootSpan, app => { + app.use((req, res, next) => { + res.on('finish', () => { + finishListenerCount = res.listenerCount('finish'); + }); + next(); + }); + const asyncMiddleware: express.RequestHandler = (req, res, next) => { + setTimeout(() => { + res.status(200).end('middleware'); + }, 50); + }; + for (let index = 0; index < 15; index++) { + app.use(asyncMiddleware); + } + }); + const port = (server.address() as AddressInfo).port; + assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); + await tracer.withSpan(rootSpan, async () => { + const response = await httpRequest.get( + `http://localhost:${port}/toto/tata` + ); + assert.strictEqual(response, 'middleware'); + rootSpan.end(); + assert.strictEqual(finishListenerCount, 3); + assert.notStrictEqual( + memoryExporter + .getFinishedSpans() + .find(span => span.name.includes('asyncMiddleware')), + undefined, + 'no asyncMiddleware span' + ); + }); + server.close(); + }); + it('should not create span because there are no parent', async () => { const app = express(); app.use(express.json()); app.use((req, res, next) => { - for (let i = 0; i < 1000000; i++) { - continue; - } + for (let i = 0; i < 1000000; i++) {} return next(); }); const router = express.Router(); @@ -206,6 +364,82 @@ describe('Express Plugin', () => { }); }); + describe('when route exists', () => { + let server: http.Server; + let rootSpan: ExpressPluginSpan; + const config: ExpressPluginConfig = { + ignoreLayersType: [ + ExpressLayerType.MIDDLEWARE, + ExpressLayerType.ROUTER, + ExpressLayerType.REQUEST_HANDLER, + ], + }; + + beforeEach(async () => { + plugin.disable(); + plugin.enable(express, provider, logger, config); + rootSpan = tracer.startSpan('rootSpan') as ExpressPluginSpan; + const app = express(); + app.use((req, res, next) => tracer.withSpan(rootSpan, next)); + app.use(express.json()); + app.use((req, res, next) => { + for (let i = 0; i < 1000; i++) {} + return next(); + }); + const router = express.Router(); + app.use('/toto', router); + router.get('/:id', (req, res) => { + setImmediate(() => { + res.status(200).end(); + }); + }); + + server = http.createServer(app); + await new Promise(resolve => server.listen(0, resolve)); + }); + + afterEach(() => { + server.close(); + }); + + it('should ignore all ExpressLayerType based on config', async () => { + const port = (server.address() as AddressInfo).port; + assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); + await tracer.withSpan(rootSpan, async () => { + await httpRequest.get(`http://localhost:${port}/toto/tata`); + rootSpan.end(); + assert.deepStrictEqual( + memoryExporter + .getFinishedSpans() + .filter( + span => + span.attributes[AttributeNames.EXPRESS_TYPE] === + ExpressLayerType.MIDDLEWARE || + span.attributes[AttributeNames.EXPRESS_TYPE] === + ExpressLayerType.ROUTER || + span.attributes[AttributeNames.EXPRESS_TYPE] === + ExpressLayerType.REQUEST_HANDLER + ).length, + 0 + ); + }); + }); + + it('root span name should be modified to GET /todo/:id', async () => { + const port = (server.address() as AddressInfo).port; + assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); + await tracer.withSpan(rootSpan, async () => { + await httpRequest.get(`http://localhost:${port}/toto/tata`); + rootSpan.end(); + assert.strictEqual(rootSpan.name, 'GET /toto/:id'); + const exportedRootSpan = memoryExporter + .getFinishedSpans() + .find(span => span.name === 'GET /toto/:id'); + assert.notStrictEqual(exportedRootSpan, undefined); + }); + }); + }); + describe('Disabling plugin', () => { it('should not create new spans', async () => { plugin.disable(); diff --git a/plugins/node/opentelemetry-plugin-ioredis/package.json b/plugins/node/opentelemetry-plugin-ioredis/package.json index f7e1a0dab3..224bf9b943 100644 --- a/plugins/node/opentelemetry-plugin-ioredis/package.json +++ b/plugins/node/opentelemetry-plugin-ioredis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-ioredis", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry ioredis automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -47,7 +47,7 @@ "@opentelemetry/context-async-hooks": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/semantic-conventions": "^0.14.0", - "@opentelemetry/test-utils": "^0.12.0", + "@opentelemetry/test-utils": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "@types/ioredis": "4.17.3", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-plugin-ioredis/src/version.ts b/plugins/node/opentelemetry-plugin-ioredis/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-ioredis/src/version.ts +++ b/plugins/node/opentelemetry-plugin-ioredis/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts b/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts index 6cedb6a763..f10729a933 100644 --- a/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts +++ b/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts @@ -145,6 +145,11 @@ describe('ioredis', () => { }); describe('#send_internal_message()', () => { + // use a random part in key names because redis instance is used for parallel running tests + const randomId = ((Math.random() * 2 ** 32) >>> 0).toString(16); + const testKeyName = `test-${randomId}`; + const hashKeyName = `hash-${randomId}`; + let client: ioredisTypes.Redis; const IOREDIS_CALLBACK_OPERATIONS: Array<{ @@ -156,16 +161,16 @@ describe('ioredis', () => { { description: 'insert', name: 'hset', - args: ['hash', 'testField', 'testValue'], + args: [hashKeyName, 'testField', 'testValue'], method: (cb: ioredisTypes.CallbackFunction) => - client.hset('hash', 'testField', 'testValue', cb), + client.hset(hashKeyName, 'testField', 'testValue', cb), }, { description: 'get', name: 'get', - args: ['test'], + args: [testKeyName], method: (cb: ioredisTypes.CallbackFunction) => - client.get('test', cb), + client.get(testKeyName, cb), }, ]; @@ -178,7 +183,7 @@ describe('ioredis', () => { }); beforeEach(async () => { - await client.set('test', 'data'); + await client.set(testKeyName, 'data'); memoryExporter.reset(); }); @@ -187,7 +192,8 @@ describe('ioredis', () => { }); afterEach(async () => { - client.del('hash'); + await client.del(hashKeyName); + await client.del(testKeyName); memoryExporter.reset(); }); @@ -228,12 +234,12 @@ describe('ioredis', () => { it('should create a child span for hset promise', async () => { const attributes = { ...DEFAULT_ATTRIBUTES, - [DatabaseAttribute.DB_STATEMENT]: 'hset hash random random', + [DatabaseAttribute.DB_STATEMENT]: `hset ${hashKeyName} random random`, }; const span = provider.getTracer('ioredis-test').startSpan('test span'); await provider.getTracer('ioredis-test').withSpan(span, async () => { try { - await client.hset('hash', 'random', 'random'); + await client.hset(hashKeyName, 'random', 'random'); assert.strictEqual(memoryExporter.getFinishedSpans().length, 1); span.end(); const endedSpans = memoryExporter.getFinishedSpans(); @@ -350,8 +356,7 @@ describe('ioredis', () => { it('should create a child span for lua', done => { const attributes = { ...DEFAULT_ATTRIBUTES, - [DatabaseAttribute.DB_STATEMENT]: - 'evalsha bfbf458525d6a0b19200bfd6db3af481156b367b 1 test', + [DatabaseAttribute.DB_STATEMENT]: `evalsha bfbf458525d6a0b19200bfd6db3af481156b367b 1 ${testKeyName}`, }; const span = provider.getTracer('ioredis-test').startSpan('test span'); @@ -363,16 +368,21 @@ describe('ioredis', () => { }); // Now `echo` can be used just like any other ordinary command, // and ioredis will try to use `EVALSHA` internally when possible for better performance. - client.echo('test', (err, result) => { + client.echo(testKeyName, (err, result) => { assert.ifError(err); - assert.strictEqual(memoryExporter.getFinishedSpans().length, 2); span.end(); const endedSpans = memoryExporter.getFinishedSpans(); - assert.strictEqual(endedSpans.length, 3); - assert.strictEqual(endedSpans[2].name, 'test span'); - assert.strictEqual(endedSpans[1].name, 'eval'); - assert.strictEqual(endedSpans[0].name, 'evalsha'); + // the script may be already cached on server therefore we get either 2 or 3 spans + if (endedSpans.length === 3) { + assert.strictEqual(endedSpans[2].name, 'test span'); + assert.strictEqual(endedSpans[1].name, 'eval'); + assert.strictEqual(endedSpans[0].name, 'evalsha'); + } else { + assert.strictEqual(endedSpans.length, 2); + assert.strictEqual(endedSpans[1].name, 'test span'); + assert.strictEqual(endedSpans[0].name, 'evalsha'); + } testUtils.assertSpan( endedSpans[0], SpanKind.CLIENT, @@ -459,12 +469,12 @@ describe('ioredis', () => { it('should create a child span for get promise', async () => { const attributes = { ...DEFAULT_ATTRIBUTES, - [DatabaseAttribute.DB_STATEMENT]: 'get test', + [DatabaseAttribute.DB_STATEMENT]: `get ${testKeyName}`, }; const span = provider.getTracer('ioredis-test').startSpan('test span'); await provider.getTracer('ioredis-test').withSpan(span, async () => { try { - const value = await client.get('test'); + const value = await client.get(testKeyName); assert.strictEqual(value, 'data'); assert.strictEqual(memoryExporter.getFinishedSpans().length, 1); span.end(); @@ -488,12 +498,12 @@ describe('ioredis', () => { it('should create a child span for del', async () => { const attributes = { ...DEFAULT_ATTRIBUTES, - [DatabaseAttribute.DB_STATEMENT]: 'del test', + [DatabaseAttribute.DB_STATEMENT]: `del ${testKeyName}`, }; const span = provider.getTracer('ioredis-test').startSpan('test span'); await provider.getTracer('ioredis-test').withSpan(span, async () => { try { - const result = await client.del('test'); + const result = await client.del(testKeyName); assert.strictEqual(result, 1); assert.strictEqual(memoryExporter.getFinishedSpans().length, 1); span.end(); @@ -521,8 +531,8 @@ describe('ioredis', () => { plugin.enable(ioredis, provider, new NoopLogger(), {}); }); it('should not create child span', async () => { - await client.set('test', 'data'); - const result = await client.del('test'); + await client.set(testKeyName, 'data'); + const result = await client.del(testKeyName); assert.strictEqual(result, 1); assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); }); @@ -602,7 +612,7 @@ describe('ioredis', () => { const span = provider.getTracer('ioredis-test').startSpan('test span'); await provider.getTracer('ioredis-test').withSpan(span, async () => { try { - await client.hset('hash', 'random', 'random'); + await client.hset(hashKeyName, 'random', 'random'); assert.strictEqual(memoryExporter.getFinishedSpans().length, 0); span.end(); const endedSpans = memoryExporter.getFinishedSpans(); diff --git a/plugins/node/opentelemetry-plugin-mongodb/package.json b/plugins/node/opentelemetry-plugin-mongodb/package.json index f962ac394e..6a67fe26f5 100644 --- a/plugins/node/opentelemetry-plugin-mongodb/package.json +++ b/plugins/node/opentelemetry-plugin-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-mongodb", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry mongodb automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-plugin-mongodb/src/version.ts b/plugins/node/opentelemetry-plugin-mongodb/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-mongodb/src/version.ts +++ b/plugins/node/opentelemetry-plugin-mongodb/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-mysql/package.json b/plugins/node/opentelemetry-plugin-mysql/package.json index 5d21981f4b..934b63a5a0 100644 --- a/plugins/node/opentelemetry-plugin-mysql/package.json +++ b/plugins/node/opentelemetry-plugin-mysql/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-mysql", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry mysql automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -44,7 +44,7 @@ "@opentelemetry/context-async-hooks": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/semantic-conventions": "^0.14.0", - "@opentelemetry/test-utils": "^0.12.0", + "@opentelemetry/test-utils": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/mysql": "2.15.15", diff --git a/plugins/node/opentelemetry-plugin-mysql/src/version.ts b/plugins/node/opentelemetry-plugin-mysql/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-mysql/src/version.ts +++ b/plugins/node/opentelemetry-plugin-mysql/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-pg-pool/package.json b/plugins/node/opentelemetry-plugin-pg-pool/package.json index ca26a62047..8e615b521d 100644 --- a/plugins/node/opentelemetry-plugin-pg-pool/package.json +++ b/plugins/node/opentelemetry-plugin-pg-pool/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-pg-pool", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry postgres pool automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,8 +48,8 @@ }, "devDependencies": { "@opentelemetry/context-async-hooks": "^0.14.0", - "@opentelemetry/plugin-pg": "^0.12.0", - "@opentelemetry/test-utils": "^0.12.0", + "@opentelemetry/plugin-pg": "^0.12.1", + "@opentelemetry/test-utils": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", diff --git a/plugins/node/opentelemetry-plugin-pg-pool/src/version.ts b/plugins/node/opentelemetry-plugin-pg-pool/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-pg-pool/src/version.ts +++ b/plugins/node/opentelemetry-plugin-pg-pool/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-pg/package.json b/plugins/node/opentelemetry-plugin-pg/package.json index 38216b3475..fefc09341f 100644 --- a/plugins/node/opentelemetry-plugin-pg/package.json +++ b/plugins/node/opentelemetry-plugin-pg/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-pg", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry postgres automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,7 +48,7 @@ "devDependencies": { "@opentelemetry/context-async-hooks": "^0.14.0", "@opentelemetry/node": "^0.14.0", - "@opentelemetry/test-utils": "^0.12.0", + "@opentelemetry/test-utils": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", diff --git a/plugins/node/opentelemetry-plugin-pg/src/version.ts b/plugins/node/opentelemetry-plugin-pg/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-pg/src/version.ts +++ b/plugins/node/opentelemetry-plugin-pg/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/node/opentelemetry-plugin-redis/package.json b/plugins/node/opentelemetry-plugin-redis/package.json index 1634eef2ee..d6fe8faa70 100644 --- a/plugins/node/opentelemetry-plugin-redis/package.json +++ b/plugins/node/opentelemetry-plugin-redis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-redis", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry redis automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -46,7 +46,7 @@ "@opentelemetry/context-async-hooks": "^0.14.0", "@opentelemetry/node": "^0.14.0", "@opentelemetry/semantic-conventions": "^0.14.0", - "@opentelemetry/test-utils": "^0.12.0", + "@opentelemetry/test-utils": "^0.12.1", "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", diff --git a/plugins/node/opentelemetry-plugin-redis/src/version.ts b/plugins/node/opentelemetry-plugin-redis/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/node/opentelemetry-plugin-redis/src/version.ts +++ b/plugins/node/opentelemetry-plugin-redis/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/web/opentelemetry-plugin-document-load/package.json b/plugins/web/opentelemetry-plugin-document-load/package.json index fdcc166572..053a0355be 100644 --- a/plugins/web/opentelemetry-plugin-document-load/package.json +++ b/plugins/web/opentelemetry-plugin-document-load/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-document-load", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry document-load automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/web/opentelemetry-plugin-document-load/src/version.ts b/plugins/web/opentelemetry-plugin-document-load/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/web/opentelemetry-plugin-document-load/src/version.ts +++ b/plugins/web/opentelemetry-plugin-document-load/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/web/opentelemetry-plugin-react-load/package.json b/plugins/web/opentelemetry-plugin-react-load/package.json index e164d85526..3e353ab16d 100644 --- a/plugins/web/opentelemetry-plugin-react-load/package.json +++ b/plugins/web/opentelemetry-plugin-react-load/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-react-load", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry React loading automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/web/opentelemetry-plugin-react-load/src/version.ts b/plugins/web/opentelemetry-plugin-react-load/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/web/opentelemetry-plugin-react-load/src/version.ts +++ b/plugins/web/opentelemetry-plugin-react-load/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/plugins/web/opentelemetry-plugin-user-interaction/package.json b/plugins/web/opentelemetry-plugin-user-interaction/package.json index a8136866e1..0bb8098eb6 100644 --- a/plugins/web/opentelemetry-plugin-user-interaction/package.json +++ b/plugins/web/opentelemetry-plugin-user-interaction/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/plugin-user-interaction", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry UserInteraction automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/web/opentelemetry-plugin-user-interaction/src/version.ts b/plugins/web/opentelemetry-plugin-user-interaction/src/version.ts index 707690f363..c032ed99f3 100644 --- a/plugins/web/opentelemetry-plugin-user-interaction/src/version.ts +++ b/plugins/web/opentelemetry-plugin-user-interaction/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/package.json b/propagators/opentelemetry-propagator-grpc-census-binary/package.json index 121568004f..f68c342b32 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/package.json +++ b/propagators/opentelemetry-propagator-grpc-census-binary/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-grpc-census-binary", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry gRPC Census propagator provides a context propagator for OpenTelemetry that can use the gRPC binary header: 'grpc-trace-bin' for interoperability with OpenCensus", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/src/version.ts b/propagators/opentelemetry-propagator-grpc-census-binary/src/version.ts index 707690f363..c032ed99f3 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/src/version.ts +++ b/propagators/opentelemetry-propagator-grpc-census-binary/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1'; diff --git a/propagators/opentelemetry-propagator-jaeger/package.json b/propagators/opentelemetry-propagator-jaeger/package.json index 99f97c5368..a80a52a1ea 100644 --- a/propagators/opentelemetry-propagator-jaeger/package.json +++ b/propagators/opentelemetry-propagator-jaeger/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-jaeger", - "version": "0.12.0", + "version": "0.12.1", "description": "OpenTelemetry Jaeger propagator provides HTTP header propagation for systems that are using Jaeger HTTP header format.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/propagators/opentelemetry-propagator-jaeger/src/version.ts b/propagators/opentelemetry-propagator-jaeger/src/version.ts index 707690f363..c032ed99f3 100644 --- a/propagators/opentelemetry-propagator-jaeger/src/version.ts +++ b/propagators/opentelemetry-propagator-jaeger/src/version.ts @@ -15,4 +15,4 @@ */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '0.12.0'; +export const VERSION = '0.12.1';