From bfd04b0b40eb335541dd033521c13bb497d8757c Mon Sep 17 00:00:00 2001 From: Chengzhong Wu Date: Wed, 25 May 2022 23:56:17 +0800 Subject: [PATCH 1/5] chore(deps): upgrade actions/checkout to v3 (#2979) Co-authored-by: Daniel Dyla --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/peer-api.yml | 2 +- .github/workflows/unit-test.yml | 10 +++++----- .github/workflows/w3c-integration-test.yml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 10ad648c67..4b424dfb7d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 79cd35691c..232a90dc7d 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f6ad0e48ce..998cb4f00c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: with: node-version: '14' - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Lint changelog file uses: avto-dev/markdown-lint@v1 diff --git a/.github/workflows/peer-api.yml b/.github/workflows/peer-api.yml index 415166abbe..47daa6f20f 100644 --- a/.github/workflows/peer-api.yml +++ b/.github/workflows/peer-api.yml @@ -13,7 +13,7 @@ jobs: image: node:14 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install lerna run: npm install -g lerna diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index e70aeb73b0..f2bcef4f1c 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,7 +16,7 @@ jobs: NPM_CONFIG_UNSAFE_PERM: true steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -59,7 +59,7 @@ jobs: - name: Permission Setup run: sudo chmod -R 777 /github /__w - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore lerna id: cache @@ -92,14 +92,14 @@ jobs: webworker-tests: runs-on: ubuntu-latest container: - image: circleci/node:14-browsers + image: circleci/node:16-browsers env: NPM_CONFIG_UNSAFE_PERM: true steps: - - name: Checkout - uses: actions/checkout@v1 - name: Permission Setup run: sudo chmod -R 777 /github /__w + - name: Checkout + uses: actions/checkout@v3 - name: restore lerna id: cache diff --git a/.github/workflows/w3c-integration-test.yml b/.github/workflows/w3c-integration-test.yml index 8c68f29656..c2be63b9df 100644 --- a/.github/workflows/w3c-integration-test.yml +++ b/.github/workflows/w3c-integration-test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore lock files uses: actions/cache@master # must use unreleased master to cache multiple paths From 7149f6cdb3e44394a642c82bcf5957b591a49219 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Fri, 27 May 2022 16:20:11 +0200 Subject: [PATCH 2/5] fix(otlp-transformer): include esm and esnext in package files and update README (#2992) Co-authored-by: Daniel Dyla --- experimental/CHANGELOG.md | 1 + .../packages/otlp-transformer/README.md | 75 +------------------ .../packages/otlp-transformer/package.json | 6 ++ 3 files changed, 11 insertions(+), 71 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 027a58898f..60443a6693 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -26,6 +26,7 @@ All notable changes to experimental packages in this project will be documented * fix(opentelemetry-instrumentation-http): use correct origin when port is `null` #2948 @danielgblanco * fix(otlp-exporter-base): include esm and esnext in package files #2952 @dyladan * fix(otlp-http-exporter): update endpoint to match spec #2895 @svetlanabrennan +* fix(otlp-transformer): include esm and esnext in package files and update README #2992 @pichlermarc ### :books: (Refine Doc) diff --git a/experimental/packages/otlp-transformer/README.md b/experimental/packages/otlp-transformer/README.md index 2c53ce82ca..fc5c13af9e 100644 --- a/experimental/packages/otlp-transformer/README.md +++ b/experimental/packages/otlp-transformer/README.md @@ -3,9 +3,9 @@ [![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image] -This package provides everything needed to serialize [OpenTelemetry SDK][sdk] traces and metrics into the [OpenTelemetry Protocol][otlp] format using [protocol buffers][protobuf] or JSON. -It also contains service clients for exporting traces and metrics to the OpenTelemetry Collector or a compatible receiver using using OTLP over [gRPC][grpc]. -This module uses [`protobufjs`][protobufjs] for serialization and is compatible with [`@grpc/grpc-js`][grpc-js]. +**NOTE: This package is intended for internal use only.** + +This package provides everything needed to serialize [OpenTelemetry SDK][sdk] traces and metrics into the [OpenTelemetry Protocol][otlp] format. ## Quick Start @@ -14,9 +14,7 @@ To get started you will need to install a compatible OpenTelemetry API. ### Install Peer Dependencies ```sh -npm install \ - @opentelemetry/api \ - @grpc/grpc-js # only required if you are using gRPC +npm install @opentelemetry/api ``` ### Serialize Traces and Metrics @@ -30,65 +28,6 @@ const serializedSpans = createExportTraceServiceRequest(readableSpans); const serializedMetrics = createExportMetricsServiceRequest(readableMetrics); ``` -### Create gRPC Service Clients - -This module also contains gRPC service clients for exporting traces and metrics to an OpenTelemetry collector or compatible receiver over gRPC. -In order to avoid bundling a gRPC module with this module, it is required to construct an RPC implementation to pass to the constructor of the service clients. -Any RPC implementation compatible with `grpc` or `@grpc/grpc-js` may be used, but `@grpc/grpc-js` is recommended. - -```typescript -import type { RPCImpl } from 'protobufjs'; -import { makeGenericClientConstructor, credentials } from '@gprc/grpc-js'; -import { MetricServiceClient, TraceServiceClient } from "@opentelemetry/otlp-transformer"; - -// Construct a RPC Implementation according to protobufjs docs -const GrpcClientConstructor = makeGenericClientConstructor({}); - -const metricGRPCClient = new GrpcClientConstructor( - "http://localhost:4317/v1/metrics", // default collector metrics endpoint - credentials.createInsecure(), -); - -const traceGRPCClient = new GrpcClientConstructor( - "http://localhost:4317/v1/traces", // default collector traces endpoint - credentials.createInsecure(), -); - -const metricRpc: RPCImpl = function(method, requestData, callback) { - metricGRPCClient.makeUnaryRequest( - method.name, - arg => arg, - arg => arg, - requestData, - callback - ); -} - -const traceRpc: RPCImpl = function(method, requestData, callback) { - traceGRPCClient.makeUnaryRequest( - method.name, - arg => arg, - arg => arg, - requestData, - callback - ); -} - -// Construct service clients to use RPC Implementations -const metricServiceClient = new MetricServiceClient({ - rpcImpl: metricRpc, - startTime: Date.now(), // exporter start time in milliseconds -}); - -const traceServiceClient = new TraceServiceClient({ - rpcImpl: traceRpc, -}); - -// Export ReadableSpan[] and ReadableMetric[] over gRPC -await metricServiceClient.export(readableMetrics); -await traceServiceClient.export(readableSpans); -``` - ## Useful links - For more information on OpenTelemetry, visit: @@ -107,9 +46,3 @@ Apache 2.0 - See [LICENSE][license-url] for more information. [sdk]: https://github.com/open-telemetry/opentelemetry-js [otlp]: https://github.com/open-telemetry/opentelemetry-proto - -[protobuf]: https://developers.google.com/protocol-buffers -[grpc]: https://grpc.io/ - -[protobufjs]: https://www.npmjs.com/package/protobufjs -[grpc-js]: https://www.npmjs.com/package/@grpc/grpc-js diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index 540c5af84f..d25813a328 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -38,6 +38,12 @@ "node": ">=8.12.0" }, "files": [ + "build/esm/**/*.js", + "build/esm/**/*.js.map", + "build/esm/**/*.d.ts", + "build/esnext/**/*.js", + "build/esnext/**/*.js.map", + "build/esnext/**/*.d.ts", "build/src/**/*.js", "build/src/**/*.js.map", "build/src/**/*.d.ts", From 7196b7f9e7e83115c67077a4d4c021e843735eee Mon Sep 17 00:00:00 2001 From: Andy Fleming <721038+andyfleming@users.noreply.github.com> Date: Fri, 27 May 2022 08:26:38 -0700 Subject: [PATCH 3/5] fix(metrics): updates unit option behavior to be spec-compliant (#2983) Co-authored-by: Daniel Dyla --- experimental/CHANGELOG.md | 1 + .../test/metricsHelper.ts | 6 ++-- .../test/metricsHelper.ts | 12 +++---- .../test/metricsHelper.ts | 6 ++-- .../src/InstrumentDescriptor.ts | 2 +- .../test/InstrumentDescriptor.test.ts | 31 +++++++++++++++++++ .../test/Instruments.test.ts | 6 ++-- 7 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 experimental/packages/opentelemetry-sdk-metrics-base/test/InstrumentDescriptor.test.ts diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 60443a6693..6ff4ecb81d 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -27,6 +27,7 @@ All notable changes to experimental packages in this project will be documented * fix(otlp-exporter-base): include esm and esnext in package files #2952 @dyladan * fix(otlp-http-exporter): update endpoint to match spec #2895 @svetlanabrennan * fix(otlp-transformer): include esm and esnext in package files and update README #2992 @pichlermarc +* fix(metrics): specification compliant default metric unit #2983 @andyfleming ### :books: (Refine Doc) diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/metricsHelper.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/metricsHelper.ts index 997cd0ed86..36a45d1315 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/metricsHelper.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/metricsHelper.ts @@ -131,7 +131,7 @@ export function ensureExportedCounterIsCorrect( assert.deepStrictEqual(metric, { name: 'int-counter', description: 'sample counter description', - unit: '1', + unit: '', data: 'sum', sum: { dataPoints: [ @@ -159,7 +159,7 @@ export function ensureExportedObservableGaugeIsCorrect( assert.deepStrictEqual(metric, { name: 'double-observable-gauge', description: 'sample observable gauge description', - unit: '1', + unit: '', data: 'gauge', gauge: { dataPoints: [ @@ -187,7 +187,7 @@ export function ensureExportedHistogramIsCorrect( assert.deepStrictEqual(metric, { name: 'int-histogram', description: 'sample histogram description', - unit: '1', + unit: '', data: 'histogram', histogram: { dataPoints: [ diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/metricsHelper.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/metricsHelper.ts index 31e2bcb96d..a3c9571d3f 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/metricsHelper.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/metricsHelper.ts @@ -237,7 +237,7 @@ export function ensureCounterIsCorrect( assert.deepStrictEqual(metric, { name: 'int-counter', description: 'sample counter description', - unit: '1', + unit: '', sum: { dataPoints: [ { @@ -261,7 +261,7 @@ export function ensureDoubleCounterIsCorrect( assert.deepStrictEqual(metric, { name: 'double-counter', description: 'sample counter description', - unit: '1', + unit: '', doubleSum: { dataPoints: [ { @@ -287,7 +287,7 @@ export function ensureObservableGaugeIsCorrect( assert.deepStrictEqual(metric, { name, description: 'sample observable gauge description', - unit: '1', + unit: '', gauge: { dataPoints: [ { @@ -311,7 +311,7 @@ export function ensureObservableCounterIsCorrect( assert.deepStrictEqual(metric, { name, description: 'sample observable counter description', - unit: '1', + unit: '', doubleSum: { isMonotonic: true, dataPoints: [ @@ -337,7 +337,7 @@ export function ensureObservableUpDownCounterIsCorrect( assert.deepStrictEqual(metric, { name, description: 'sample observable up down counter description', - unit: '1', + unit: '', doubleSum: { isMonotonic: false, dataPoints: [ @@ -363,7 +363,7 @@ export function ensureHistogramIsCorrect( assert.deepStrictEqual(metric, { name: 'int-histogram', description: 'sample histogram description', - unit: '1', + unit: '', histogram: { dataPoints: [ { diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/test/metricsHelper.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/test/metricsHelper.ts index 0bacab995c..daa98a0d98 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/test/metricsHelper.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/test/metricsHelper.ts @@ -135,7 +135,7 @@ export function ensureExportedCounterIsCorrect( assert.deepStrictEqual(metric, { name: 'int-counter', description: 'sample counter description', - unit: '1', + unit: '', sum: { dataPoints: [ { @@ -158,7 +158,7 @@ export function ensureExportedObservableGaugeIsCorrect( assert.deepStrictEqual(metric, { name: 'double-observable-gauge', description: 'sample observable gauge description', - unit: '1', + unit: '', gauge: { dataPoints: [ { @@ -181,7 +181,7 @@ export function ensureExportedHistogramIsCorrect( assert.deepStrictEqual(metric, { name: 'int-histogram', description: 'sample histogram description', - unit: '1', + unit: '', histogram: { dataPoints: [ { diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts index 81b19b7ec1..fa2985ff9d 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts @@ -42,7 +42,7 @@ export function createInstrumentDescriptor(name: string, type: InstrumentType, o name, type, description: options?.description ?? '', - unit: options?.unit ?? '1', + unit: options?.unit ?? '', valueType: options?.valueType ?? ValueType.DOUBLE, }; } diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/test/InstrumentDescriptor.test.ts b/experimental/packages/opentelemetry-sdk-metrics-base/test/InstrumentDescriptor.test.ts new file mode 100644 index 0000000000..22397faea4 --- /dev/null +++ b/experimental/packages/opentelemetry-sdk-metrics-base/test/InstrumentDescriptor.test.ts @@ -0,0 +1,31 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as assert from 'assert'; +import {createInstrumentDescriptor, InstrumentType} from '../src/InstrumentDescriptor'; + +describe('InstrumentDescriptor', () => { + describe('createInstrumentDescriptor', () => { + for (const val of [null, undefined]) { + it(`should interpret an empty unit value as a blank string (${val})`, () => { + const result = createInstrumentDescriptor('example', InstrumentType.COUNTER, { + unit: val as any, + }); + assert.strictEqual(result.unit, ''); + }); + } + }); +}); diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/test/Instruments.test.ts b/experimental/packages/opentelemetry-sdk-metrics-base/test/Instruments.test.ts index 3de26bdf81..c0d7d77dfb 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/test/Instruments.test.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/test/Instruments.test.ts @@ -64,7 +64,7 @@ describe('Instruments', () => { descriptor: { name: 'test', description: '', - unit: '1', + unit: '', type: InstrumentType.COUNTER, valueType: ValueType.INT, }, @@ -180,7 +180,7 @@ describe('Instruments', () => { descriptor: { name: 'test', description: '', - unit: '1', + unit: '', type: InstrumentType.UP_DOWN_COUNTER, valueType: ValueType.INT, }, @@ -265,7 +265,7 @@ describe('Instruments', () => { descriptor: { name: 'test', description: '', - unit: '1', + unit: '', type: InstrumentType.HISTOGRAM, valueType: ValueType.INT, }, From eda0b092db484855ded8b4837ba7fc19a377c5a7 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 27 May 2022 15:24:18 -0400 Subject: [PATCH 4/5] Release proposal 1.3.0/0.29.0 (#2995) --- CHANGELOG.md | 12 ++++++++++ examples/otlp-exporter-node/package.json | 22 +++++++++---------- experimental/CHANGELOG.md | 12 ++++++++++ .../node10/package.json | 6 ++--- .../node12/package.json | 6 ++--- .../node8/package.json | 6 ++--- .../exporter-trace-otlp-grpc/package.json | 14 ++++++------ .../exporter-trace-otlp-http/package.json | 12 +++++----- .../exporter-trace-otlp-proto/package.json | 16 +++++++------- .../opentelemetry-api-metrics/package.json | 2 +- .../package.json | 16 +++++++------- .../package.json | 14 ++++++------ .../package.json | 18 +++++++-------- .../package.json | 8 +++---- .../package.json | 16 +++++++------- .../package.json | 16 +++++++------- .../package.json | 14 ++++++------ .../package.json | 16 +++++++------- .../package.json | 4 ++-- .../package.json | 8 +++---- .../opentelemetry-sdk-node/package.json | 18 +++++++-------- .../packages/otlp-exporter-base/package.json | 4 ++-- .../otlp-grpc-exporter-base/package.json | 14 ++++++------ .../otlp-proto-exporter-base/package.json | 6 ++--- .../packages/otlp-transformer/package.json | 12 +++++----- .../package.json | 8 +++---- .../package.json | 2 +- .../package.json | 2 +- .../opentelemetry-context-zone/package.json | 4 ++-- packages/opentelemetry-core/package.json | 4 ++-- .../package.json | 10 ++++----- .../package.json | 10 ++++----- .../opentelemetry-propagator-b3/package.json | 4 ++-- .../package.json | 4 ++-- packages/opentelemetry-resources/package.json | 6 ++--- .../opentelemetry-sdk-trace-base/package.json | 8 +++---- .../opentelemetry-sdk-trace-node/package.json | 16 +++++++------- .../opentelemetry-sdk-trace-web/package.json | 14 ++++++------ .../package.json | 2 +- .../package.json | 12 +++++----- packages/template/package.json | 2 +- selenium-tests/package.json | 22 +++++++++---------- 42 files changed, 223 insertions(+), 199 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2991926fa6..cfe79dbedb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file. ### :boom: Breaking Change +### :rocket: (Enhancement) + +### :bug: (Bug Fix) + +### :books: (Refine Doc) + +### :house: (Internal) + +## 1.3.0 + +### :boom: Breaking Change + * chore: remove unused InstrumentationConfig#path [#2944](https://github.com/open-telemetry/opentelemetry-js/pull/2944) @flarna ### :rocket: (Enhancement) diff --git a/examples/otlp-exporter-node/package.json b/examples/otlp-exporter-node/package.json index a43a114437..451048c7b7 100644 --- a/examples/otlp-exporter-node/package.json +++ b/examples/otlp-exporter-node/package.json @@ -1,7 +1,7 @@ { "name": "example-otlp-exporter-node", "private": true, - "version": "0.27.0", + "version": "0.28.0", "description": "Example of using @opentelemetry/collector-exporter in Node.js", "main": "index.js", "scripts": { @@ -29,18 +29,18 @@ }, "dependencies": { "@opentelemetry/api": "^1.0.2", - "@opentelemetry/api-metrics": "0.28.0", + "@opentelemetry/api-metrics": "0.29.0", "@opentelemetry/core": "1.1.1", - "@opentelemetry/exporter-trace-otlp-http": "0.28.0", - "@opentelemetry/exporter-metrics-otlp-http": "0.28.0", - "@opentelemetry/exporter-trace-otlp-grpc": "0.28.0", - "@opentelemetry/exporter-metrics-otlp-grpc": "0.28.0", - "@opentelemetry/exporter-trace-otlp-proto": "0.28.0", - "@opentelemetry/exporter-metrics-otlp-proto": "0.28.0", + "@opentelemetry/exporter-metrics-otlp-grpc": "0.29.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.29.0", + "@opentelemetry/exporter-metrics-otlp-proto": "0.29.0", + "@opentelemetry/exporter-trace-otlp-grpc": "0.29.0", + "@opentelemetry/exporter-trace-otlp-http": "0.29.0", + "@opentelemetry/exporter-trace-otlp-proto": "0.29.0", "@opentelemetry/resources": "1.1.1", - "@opentelemetry/semantic-conventions": "1.1.1", - "@opentelemetry/sdk-metrics-base": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.1.1" + "@opentelemetry/sdk-metrics-base": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.1.1", + "@opentelemetry/semantic-conventions": "1.1.1" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme" } diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 6ff4ecb81d..64cb31f1f9 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -6,6 +6,18 @@ All notable changes to experimental packages in this project will be documented ### :boom: Breaking Change +### :rocket: (Enhancement) + +### :bug: (Bug Fix) + +### :books: (Refine Doc) + +### :house: (Internal) + +## 0.29.0 + +### :boom: Breaking Change + * feat(metrics): metric readers and exporters now select aggregation temporality based on instrument type #2902 @seemk * refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope #2959 @pichlermarc * feat(metrics): multi-instrument async callback support #2966 @legendecas diff --git a/experimental/backwards-compatability/node10/package.json b/experimental/backwards-compatability/node10/package.json index e4e1e06cad..2bc636fd5e 100644 --- a/experimental/backwards-compatability/node10/package.json +++ b/experimental/backwards-compatability/node10/package.json @@ -1,6 +1,6 @@ { "name": "backcompat-node10", - "version": "0.28.0", + "version": "0.29.0", "private": true, "description": "Backwards compatability app for node8 types and the OpenTelemetry Node.js SDK", "main": "index.js", @@ -9,8 +9,8 @@ "peer-api-check": "node ../../../scripts/peer-api-check.js" }, "dependencies": { - "@opentelemetry/sdk-node": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0" + "@opentelemetry/sdk-node": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0" }, "devDependencies": { "@types/node": "10.17.60", diff --git a/experimental/backwards-compatability/node12/package.json b/experimental/backwards-compatability/node12/package.json index 2c0adce376..333aba452c 100644 --- a/experimental/backwards-compatability/node12/package.json +++ b/experimental/backwards-compatability/node12/package.json @@ -1,6 +1,6 @@ { "name": "backcompat-node12", - "version": "0.28.0", + "version": "0.29.0", "private": true, "description": "Backwards compatability app for node8 types and the OpenTelemetry Node.js SDK", "main": "index.js", @@ -9,8 +9,8 @@ "peer-api-check": "node ../../../scripts/peer-api-check.js" }, "dependencies": { - "@opentelemetry/sdk-node": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0" + "@opentelemetry/sdk-node": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0" }, "devDependencies": { "@types/node": "12.20.37", diff --git a/experimental/backwards-compatability/node8/package.json b/experimental/backwards-compatability/node8/package.json index e8e2b6eed6..172b4dfe1a 100644 --- a/experimental/backwards-compatability/node8/package.json +++ b/experimental/backwards-compatability/node8/package.json @@ -1,6 +1,6 @@ { "name": "backcompat-node8", - "version": "0.28.0", + "version": "0.29.0", "private": true, "description": "Backwards compatability app for node8 types and the OpenTelemetry Node.js SDK", "main": "index.js", @@ -9,8 +9,8 @@ "peer-api-check": "node ../../../scripts/peer-api-check.js" }, "dependencies": { - "@opentelemetry/sdk-node": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0" + "@opentelemetry/sdk-node": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0" }, "devDependencies": { "@types/node": "8.10.66", diff --git a/experimental/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json index fcc3bd3eff..e8c2a1996a 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-grpc", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/otlp-exporter-base": "0.28.0", + "@opentelemetry/otlp-exporter-base": "0.29.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -67,12 +67,12 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", "@grpc/grpc-js": "^1.5.9", "@grpc/proto-loader": "^0.6.9", - "@opentelemetry/otlp-transformer": "0.28.0", - "@opentelemetry/otlp-grpc-exporter-base": "0.28.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0" } } diff --git a/experimental/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json index f973ae4b43..fe34ec15eb 100644 --- a/experimental/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-http", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Trace Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -94,10 +94,10 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/otlp-exporter-base": "0.28.0", - "@opentelemetry/otlp-transformer": "0.28.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/otlp-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0" } } diff --git a/experimental/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json index c0a652e869..b9bce279a7 100644 --- a/experimental/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-proto", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector using protobuf over HTTP", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -66,13 +66,13 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.1.1", "@grpc/proto-loader": "^0.6.9", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/otlp-exporter-base": "0.28.0", - "@opentelemetry/otlp-proto-exporter-base": "0.28.0", - "protobufjs": "^6.9.0", - "@opentelemetry/otlp-transformer": "0.28.0" + "@opentelemetry/core": "1.1.1", + "@opentelemetry/otlp-exporter-base": "0.29.0", + "@opentelemetry/otlp-proto-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "protobufjs": "^6.9.0" } } diff --git a/experimental/packages/opentelemetry-api-metrics/package.json b/experimental/packages/opentelemetry-api-metrics/package.json index 07e5dfa5d1..89852dd701 100644 --- a/experimental/packages/opentelemetry-api-metrics/package.json +++ b/experimental/packages/opentelemetry-api-metrics/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/api-metrics", - "version": "0.28.0", + "version": "0.29.0", "description": "Public metrics API for OpenTelemetry", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json index 0b143e0cf1..effa755889 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-grpc", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/api-metrics": "0.28.0", + "@opentelemetry/api-metrics": "0.29.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -69,11 +69,11 @@ "dependencies": { "@grpc/grpc-js": "^1.5.9", "@grpc/proto-loader": "^0.6.9", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/exporter-metrics-otlp-http": "0.28.0", - "@opentelemetry/otlp-grpc-exporter-base": "0.28.0", - "@opentelemetry/otlp-transformer": "0.28.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.29.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0" } } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index fa25fe0707..61164a1b2c 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-http", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -94,11 +94,11 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/otlp-transformer": "0.28.0", - "@opentelemetry/otlp-exporter-base": "0.28.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0" + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/otlp-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0" } } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json index dafcc23c94..0640fed4b2 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-proto", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector using protobuf over HTTP", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/api-metrics": "0.28.0", + "@opentelemetry/api-metrics": "0.29.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -68,13 +68,13 @@ }, "dependencies": { "@grpc/proto-loader": "0.6.9", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/exporter-metrics-otlp-http": "0.28.0", - "@opentelemetry/otlp-proto-exporter-base": "0.28.0", - "@opentelemetry/otlp-exporter-base": "0.28.0", - "@opentelemetry/otlp-transformer": "0.28.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.29.0", + "@opentelemetry/otlp-exporter-base": "0.29.0", + "@opentelemetry/otlp-proto-exporter-base": "0.29.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0", "protobufjs": "^6.9.0" } } diff --git a/experimental/packages/opentelemetry-exporter-prometheus/package.json b/experimental/packages/opentelemetry-exporter-prometheus/package.json index 932bf72287..e9507a85d2 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/package.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-prometheus", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry Exporter Prometheus provides a metrics endpoint for Prometheus", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -59,8 +59,8 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0" + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0" } } diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index 8739ed75c5..3828525e74 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-fetch", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry fetch automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -56,9 +56,9 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-zone": "1.2.0", - "@opentelemetry/propagator-b3": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", + "@opentelemetry/context-zone": "1.3.0", + "@opentelemetry/propagator-b3": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -87,9 +87,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/instrumentation": "0.28.0", - "@opentelemetry/sdk-trace-web": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/instrumentation": "0.29.0", + "@opentelemetry/sdk-trace-web": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 1867d6fffe..0e095346f9 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-grpc", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry grpc automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,10 +48,10 @@ "@grpc/grpc-js": "1.5.9", "@grpc/proto-loader": "0.6.9", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "1.2.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/sdk-trace-node": "1.2.0", + "@opentelemetry/context-async-hooks": "1.3.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/sdk-trace-node": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/semver": "7.3.9", @@ -71,8 +71,8 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/instrumentation": "0.28.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/instrumentation": "0.29.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/experimental/packages/opentelemetry-instrumentation-http/package.json b/experimental/packages/opentelemetry-instrumentation-http/package.json index 3549375824..1ff6ba999a 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/package.json +++ b/experimental/packages/opentelemetry-instrumentation-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-http", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry http/https automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -46,9 +46,9 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/sdk-trace-node": "1.2.0", + "@opentelemetry/context-async-hooks": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/sdk-trace-node": "1.3.0", "@types/got": "9.6.12", "@types/mocha": "8.2.3", "@types/node": "14.17.33", @@ -74,9 +74,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/instrumentation": "0.28.0", - "@opentelemetry/semantic-conventions": "1.2.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/instrumentation": "0.29.0", + "@opentelemetry/semantic-conventions": "1.3.0", "semver": "^7.3.5" } } diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 99e812244b..a1b0f5a683 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-xml-http-request", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry XMLHttpRequest automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -56,9 +56,9 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-zone": "1.2.0", - "@opentelemetry/propagator-b3": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", + "@opentelemetry/context-zone": "1.3.0", + "@opentelemetry/propagator-b3": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -87,9 +87,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/instrumentation": "0.28.0", - "@opentelemetry/sdk-trace-web": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/instrumentation": "0.29.0", + "@opentelemetry/sdk-trace-web": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index 21e407bad9..d4c9c486bc 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation", - "version": "0.28.0", + "version": "0.29.0", "description": "Base class for node which OpenTelemetry instrumentation modules extend", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", @@ -68,7 +68,7 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", + "@opentelemetry/api-metrics": "0.29.0", "require-in-the-middle": "^5.0.3", "semver": "^7.3.2", "shimmer": "^1.2.1" diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/package.json b/experimental/packages/opentelemetry-sdk-metrics-base/package.json index 09dbd8c8b2..7f5a9a780f 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/package.json +++ b/experimental/packages/opentelemetry-sdk-metrics-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-metrics-base", - "version": "0.28.0", + "version": "0.29.0", "description": "Work in progress OpenTelemetry metrics SDK", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -77,9 +77,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/resources": "1.2.0", + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/resources": "1.3.0", "lodash.merge": "4.6.2" } } diff --git a/experimental/packages/opentelemetry-sdk-node/package.json b/experimental/packages/opentelemetry-sdk-node/package.json index ce20bb42d9..b1dfa1b84f 100644 --- a/experimental/packages/opentelemetry-sdk-node/package.json +++ b/experimental/packages/opentelemetry-sdk-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-node", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry SDK for Node.js", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -44,22 +44,22 @@ "access": "public" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/instrumentation": "0.28.0", + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/instrumentation": "0.29.0", "@opentelemetry/resource-detector-aws": "~1.0.0", "@opentelemetry/resource-detector-gcp": "~0.26.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/sdk-trace-node": "1.2.0" + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/sdk-trace-node": "1.3.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "devDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0", - "@opentelemetry/context-async-hooks": "1.2.0", + "@opentelemetry/context-async-hooks": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/semver": "7.3.9", diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index d153e2f246..0f90d12880 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-exporter-base", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry OTLP Exporter base (for internal use only)", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -61,7 +61,7 @@ "access": "public" }, "dependencies": { - "@opentelemetry/core": "1.2.0" + "@opentelemetry/core": "1.3.0" }, "devDependencies": { "@opentelemetry/api": "^1.0.0", diff --git a/experimental/packages/otlp-grpc-exporter-base/package.json b/experimental/packages/otlp-grpc-exporter-base/package.json index 26486d265c..1071091dde 100644 --- a/experimental/packages/otlp-grpc-exporter-base/package.json +++ b/experimental/packages/otlp-grpc-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-grpc-exporter-base", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry OTLP-gRPC Exporter base (for internal use only)", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -51,6 +51,9 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": "^1.0.0", + "@opentelemetry/otlp-transformer": "0.29.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -62,18 +65,15 @@ "sinon": "12.0.1", "ts-loader": "8.3.0", "ts-mocha": "9.0.2", - "typescript": "4.4.4", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/otlp-transformer": "0.28.0", - "@opentelemetry/resources": "1.2.0" + "typescript": "4.4.4" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", "@grpc/grpc-js": "^1.5.9", "@grpc/proto-loader": "^0.6.9", - "@opentelemetry/otlp-exporter-base": "0.28.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/otlp-exporter-base": "0.29.0" } } diff --git a/experimental/packages/otlp-proto-exporter-base/package.json b/experimental/packages/otlp-proto-exporter-base/package.json index 98e0e27c40..34c0e150ab 100644 --- a/experimental/packages/otlp-proto-exporter-base/package.json +++ b/experimental/packages/otlp-proto-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-proto-exporter-base", - "version": "0.28.0", + "version": "0.29.0", "description": "OpenTelemetry OTLP-HTTP-protobuf Exporter base (for internal use only)", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -65,9 +65,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", "@grpc/proto-loader": "^0.6.9", - "@opentelemetry/otlp-exporter-base": "0.28.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/otlp-exporter-base": "0.29.0", "protobufjs": "^6.9.0" } } diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index d25813a328..f44f5ef807 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "0.28.0", + "version": "0.29.0", "description": "Transform OpenTelemetry SDK data into OTLP", "module": "build/esm/index.js", "esnext": "build/esnext/index.js", @@ -76,10 +76,10 @@ "webpack": "4.46.0" }, "dependencies": { - "@opentelemetry/api-metrics": "0.28.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-metrics-base": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0" + "@opentelemetry/api-metrics": "0.29.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-metrics-base": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0" } } diff --git a/integration-tests/propagation-validation-server/package.json b/integration-tests/propagation-validation-server/package.json index 11c372c65a..7cea613fb3 100644 --- a/integration-tests/propagation-validation-server/package.json +++ b/integration-tests/propagation-validation-server/package.json @@ -1,6 +1,6 @@ { "name": "propagation-validation-server", - "version": "1.2.0", + "version": "1.3.0", "description": "server for w3c tests", "main": "validation_server.js", "private": true, @@ -12,9 +12,9 @@ }, "dependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "1.2.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", + "@opentelemetry/context-async-hooks": "1.3.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "axios": "0.24.0", "body-parser": "1.19.0", "express": "4.17.1" diff --git a/packages/opentelemetry-context-async-hooks/package.json b/packages/opentelemetry-context-async-hooks/package.json index 288e278499..4aca9b53f0 100644 --- a/packages/opentelemetry-context-async-hooks/package.json +++ b/packages/opentelemetry-context-async-hooks/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-async-hooks", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry AsyncHooks-based Context Manager", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index 382226ecc4..c00c07a71f 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-zone-peer-dep", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Context Zone with peer dependency for zone.js", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/packages/opentelemetry-context-zone/package.json b/packages/opentelemetry-context-zone/package.json index 38e377a1f4..faa09c4499 100644 --- a/packages/opentelemetry-context-zone/package.json +++ b/packages/opentelemetry-context-zone/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-zone", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Context Zone", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -74,7 +74,7 @@ "webpack-merge": "5.8.0" }, "dependencies": { - "@opentelemetry/context-zone-peer-dep": "1.2.0", + "@opentelemetry/context-zone-peer-dep": "1.3.0", "zone.js": "^0.11.0" }, "sideEffects": true diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 40ce2d42de..dd23d621d2 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/core", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -91,6 +91,6 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index 89996f6ee7..e705e53460 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-jaeger", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Exporter Jaeger allows user to send collected traces to Jaeger", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -45,7 +45,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/resources": "1.2.0", + "@opentelemetry/resources": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -62,9 +62,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0", "jaeger-client": "^3.15.0" } } diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 3823760b53..3307a31621 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-zipkin", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Zipkin Exporter allows the user to send collected traces to Zipkin.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -91,9 +91,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index 4378881407..1dc59da976 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-b3", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry B3 propagator provides context propagation for systems that are using the B3 header format", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -51,7 +51,7 @@ "access": "public" }, "dependencies": { - "@opentelemetry/core": "1.2.0" + "@opentelemetry/core": "1.3.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0" diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index d999c984d9..2e7dbdcd11 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-jaeger", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Jaeger propagator provides HTTP header propagation for systems that are using Jaeger HTTP header format.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -80,6 +80,6 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0" + "@opentelemetry/core": "1.3.0" } } diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index f728e93efc..eca04be76d 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resources", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry SDK resources", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -87,7 +87,7 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index 57486815d6..4929b3ed7f 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-base", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Tracing", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -88,8 +88,8 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/packages/opentelemetry-sdk-trace-node/package.json b/packages/opentelemetry-sdk-trace-node/package.json index cb06312053..4f89adf074 100644 --- a/packages/opentelemetry-sdk-trace-node/package.json +++ b/packages/opentelemetry-sdk-trace-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-node", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Node SDK provides automatic telemetry (tracing, metrics, etc) for Node.js applications", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -46,8 +46,8 @@ }, "devDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0", - "@opentelemetry/resources": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0", + "@opentelemetry/resources": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/semver": "7.3.9", @@ -64,11 +64,11 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/context-async-hooks": "1.2.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/propagator-b3": "1.2.0", - "@opentelemetry/propagator-jaeger": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", + "@opentelemetry/context-async-hooks": "1.3.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/propagator-b3": "1.3.0", + "@opentelemetry/propagator-jaeger": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "semver": "^7.3.5" } } diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index 00e3cee96f..8392cb5bb3 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-web", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry Web Tracer", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -57,9 +57,9 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": ">=1.0.0 <1.2.0", - "@opentelemetry/context-zone": "1.2.0", - "@opentelemetry/propagator-b3": "1.2.0", - "@opentelemetry/resources": "1.2.0", + "@opentelemetry/context-zone": "1.3.0", + "@opentelemetry/propagator-b3": "1.3.0", + "@opentelemetry/resources": "1.3.0", "@types/jquery": "3.5.8", "@types/mocha": "8.2.3", "@types/node": "14.17.33", @@ -91,8 +91,8 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0" + "@opentelemetry/core": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0" } } diff --git a/packages/opentelemetry-semantic-conventions/package.json b/packages/opentelemetry-semantic-conventions/package.json index df190a8b7d..17e1ca7b61 100644 --- a/packages/opentelemetry-semantic-conventions/package.json +++ b/packages/opentelemetry-semantic-conventions/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/semantic-conventions", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTelemetry semantic conventions", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/packages/opentelemetry-shim-opentracing/package.json b/packages/opentelemetry-shim-opentracing/package.json index 0e80137985..8fef5a6380 100644 --- a/packages/opentelemetry-shim-opentracing/package.json +++ b/packages/opentelemetry-shim-opentracing/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/shim-opentracing", - "version": "1.2.0", + "version": "1.3.0", "description": "OpenTracing to OpenTelemetry shim", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -43,9 +43,9 @@ }, "devDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0", - "@opentelemetry/propagator-b3": "1.2.0", - "@opentelemetry/propagator-jaeger": "1.2.0", - "@opentelemetry/sdk-trace-base": "1.2.0", + "@opentelemetry/propagator-b3": "1.3.0", + "@opentelemetry/propagator-jaeger": "1.3.0", + "@opentelemetry/sdk-trace-base": "1.3.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "codecov": "3.8.3", @@ -59,8 +59,8 @@ "@opentelemetry/api": ">=1.0.0 <1.2.0" }, "dependencies": { - "@opentelemetry/core": "1.2.0", - "@opentelemetry/semantic-conventions": "1.2.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/semantic-conventions": "1.3.0", "opentracing": "^0.14.4" } } diff --git a/packages/template/package.json b/packages/template/package.json index 233f971f5a..c7e2513652 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/template", - "version": "1.2.0", + "version": "1.3.0", "private": true, "publishConfig": { "access": "restricted" diff --git a/selenium-tests/package.json b/selenium-tests/package.json index 4285dde419..25b02ad946 100644 --- a/selenium-tests/package.json +++ b/selenium-tests/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/selenium-tests", - "version": "1.2.0", + "version": "1.3.0", "private": true, "description": "OpenTelemetry Selenium Tests", "main": "index.js", @@ -56,16 +56,16 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/context-zone-peer-dep": "1.2.0", - "@opentelemetry/core": "1.2.0", - "@opentelemetry/exporter-trace-otlp-http": "0.28.0", - "@opentelemetry/exporter-zipkin": "1.2.0", - "@opentelemetry/instrumentation": "0.28.0", - "@opentelemetry/instrumentation-fetch": "0.28.0", - "@opentelemetry/instrumentation-xml-http-request": "0.28.0", - "@opentelemetry/sdk-metrics-base": "0.28.0", - "@opentelemetry/sdk-trace-base": "1.2.0", - "@opentelemetry/sdk-trace-web": "1.2.0", + "@opentelemetry/context-zone-peer-dep": "1.3.0", + "@opentelemetry/core": "1.3.0", + "@opentelemetry/exporter-trace-otlp-http": "0.29.0", + "@opentelemetry/exporter-zipkin": "1.3.0", + "@opentelemetry/instrumentation": "0.29.0", + "@opentelemetry/instrumentation-fetch": "0.29.0", + "@opentelemetry/instrumentation-xml-http-request": "0.29.0", + "@opentelemetry/sdk-metrics-base": "0.29.0", + "@opentelemetry/sdk-trace-base": "1.3.0", + "@opentelemetry/sdk-trace-web": "1.3.0", "zone.js": "0.11.4" } } From edf6157900619ef669e613c0ff2ba7ec2c7eb1d5 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sat, 28 May 2022 10:40:17 +0200 Subject: [PATCH 5/5] fix(instrumentation): only patch core modules if enabled (#2993) Co-authored-by: Daniel Dyla Co-authored-by: Valentin Marchaud --- experimental/CHANGELOG.md | 1 + .../src/platform/node/instrumentation.ts | 4 +- .../test/node/InstrumentationBase.test.ts | 56 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 64cb31f1f9..5c2a8fbe12 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -38,6 +38,7 @@ All notable changes to experimental packages in this project will be documented * fix(opentelemetry-instrumentation-http): use correct origin when port is `null` #2948 @danielgblanco * fix(otlp-exporter-base): include esm and esnext in package files #2952 @dyladan * fix(otlp-http-exporter): update endpoint to match spec #2895 @svetlanabrennan +* fix(instrumentation): only patch core modules if enabled #2993 @santigimeno * fix(otlp-transformer): include esm and esnext in package files and update README #2992 @pichlermarc * fix(metrics): specification compliant default metric unit #2983 @andyfleming diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts index 09d6a86b29..1335170082 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts @@ -95,7 +95,9 @@ export abstract class InstrumentationBase if (!baseDir) { if (typeof module.patch === 'function') { module.moduleExports = exports; - return module.patch(exports); + if (this._enabled) { + return module.patch(exports); + } } return exports; } diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts index 4a44e91f61..84314a8fe0 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts @@ -23,6 +23,7 @@ const MODULE_FILE_NAME = 'test-module-file'; const MODULE_VERSION = '0.1.0'; const WILDCARD_VERSION = '*'; const MODULE_DIR = '/random/dir'; +const CORE_MODULE = 'random_core'; class TestInstrumentation extends InstrumentationBase { constructor() { @@ -33,6 +34,61 @@ class TestInstrumentation extends InstrumentationBase { } describe('InstrumentationBase', () => { + describe('_onRequire - core module', () => { + let instrumentation: TestInstrumentation; + let modulePatchSpy: sinon.SinonSpy; + beforeEach(() => { + instrumentation = new TestInstrumentation(); + modulePatchSpy = sinon.spy(); + }); + + describe('AND module is not enabled', () => { + it('should not patch the module', () => { + // @ts-expect-error access internal property for testing + instrumentation._enabled = false; + const moduleExports = {}; + const instrumentationModule = { + name: CORE_MODULE, + patch: modulePatchSpy as unknown, + } as InstrumentationModuleDefinition; + + // @ts-expect-error access internal property for testing + instrumentation._onRequire( + instrumentationModule, + moduleExports, + CORE_MODULE, + undefined + ); + + assert.strictEqual(instrumentationModule.moduleExports, moduleExports); + sinon.assert.notCalled(modulePatchSpy); + }); + }); + + describe('AND module is enabled', () => { + it('should patch the module', () => { + // @ts-expect-error access internal property for testing + instrumentation._enabled = true; + const moduleExports = {}; + const instrumentationModule = { + name: CORE_MODULE, + patch: modulePatchSpy as unknown, + } as InstrumentationModuleDefinition; + + // @ts-expect-error access internal property for testing + instrumentation._onRequire( + instrumentationModule, + moduleExports, + CORE_MODULE, + undefined + ); + + assert.strictEqual(instrumentationModule.moduleExports, moduleExports); + sinon.assert.calledOnceWithExactly(modulePatchSpy, moduleExports); + }); + }); + }); + describe('_onRequire - module version is not available', () => { // For all of these cases, there is no indication of the actual module version, // so we require there to be a wildcard supported version.