Skip to content

Commit 79b7415

Browse files
authored
Merge branch 'main' into main
2 parents 83841a8 + 9e94536 commit 79b7415

File tree

24 files changed

+177
-110
lines changed

24 files changed

+177
-110
lines changed

.github/workflows/benchmark.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ jobs:
1717
NPM_CONFIG_UNSAFE_PERM: true
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- uses: actions/setup-node@v4
2323
with:
24+
cache: 'npm'
25+
cache-dependency-path: |
26+
package-lock.json
2427
node-version: ${{ matrix.node_version }}
2528

2629
- run: npm install -g npm@latest

.github/workflows/docs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313

1414
- uses: actions/setup-node@v4
1515
with:
16+
cache: 'npm'
17+
cache-dependency-path: |
18+
package-lock.json
1619
node-version: '18'
1720

1821
- name: Install and Build 🔧

.github/workflows/lint.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
1517
- uses: actions/setup-node@v4
1618
with:
19+
cache: 'npm'
20+
cache-dependency-path: |
21+
package-lock.json
1722
node-version: '16'
1823

19-
- uses: actions/checkout@v4
20-
2124
- name: Lint changelog file
2225
uses: avto-dev/markdown-lint@v1
2326
with:

.github/workflows/unit-test.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- "14"
1616
- "16"
1717
- "18"
18+
- "20"
1819
runs-on: ubuntu-latest
1920
env:
2021
NPM_CONFIG_UNSAFE_PERM: true
@@ -24,6 +25,9 @@ jobs:
2425

2526
- uses: actions/setup-node@v4
2627
with:
28+
cache: 'npm'
29+
cache-dependency-path: |
30+
package-lock.json
2731
node-version: ${{ matrix.node_version }}
2832

2933
- run: npm install -g npm@latest
@@ -42,7 +46,7 @@ jobs:
4246
- name: Unit tests
4347
run: |
4448
# TODO(legendecas): webpack https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
45-
if [ "${{ matrix.node_version }}" = "18" ]; then
49+
if [ "${{ matrix.node_version }}" = "18" ] || [ "${{ matrix.node_version }}" == "20" ]; then
4650
export NODE_OPTIONS=--openssl-legacy-provider
4751
fi
4852
npm run test
@@ -59,6 +63,9 @@ jobs:
5963

6064
- uses: actions/setup-node@v4
6165
with:
66+
cache: 'npm'
67+
cache-dependency-path: |
68+
package-lock.json
6269
node-version: '18'
6370

6471
- run: npm install -g npm@latest
@@ -85,6 +92,9 @@ jobs:
8592

8693
- uses: actions/setup-node@v4
8794
with:
95+
cache: 'npm'
96+
cache-dependency-path: |
97+
package-lock.json
8898
node-version: 16
8999

90100
- name: Bootstrap
@@ -106,6 +116,9 @@ jobs:
106116
uses: actions/[email protected]
107117
- uses: actions/setup-node@v4
108118
with:
119+
cache: 'npm'
120+
cache-dependency-path: |
121+
package-lock.json
109122
node-version: 16
110123

111124
- name: Bootstrap
@@ -133,6 +146,9 @@ jobs:
133146

134147
- uses: actions/setup-node@v4
135148
with:
149+
cache: 'npm'
150+
cache-dependency-path: |
151+
package-lock.json
136152
node-version: ${{ matrix.node_version }}
137153

138154
- name: Build

.github/workflows/w3c-integration-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616

1717
- uses: actions/setup-node@v4
1818
with:
19+
cache: 'npm'
20+
cache-dependency-path: |
21+
package-lock.json
1922
node-version: '16'
2023

2124
- name: Install and Bootstrap 🔧

.npmrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
21
lockfile-version=2

CHANGELOG.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
1717

1818
* chore: type reference on zone.js [#4257](https://github.com/open-telemetry/opentelemetry-js/pull/4257) @legendecas
1919
* chore: no need for 'packages' in lerna.json [#4264](https://github.com/open-telemetry/opentelemetry-js/pull/4264) @trentm
20+
* test: add node 20 to test matrix [#4336](https://github.com/open-telemetry/opentelemetry-js/pull/4336) @dyladan
2021

2122
### :bug: (Bug Fix)
2223

@@ -365,16 +366,8 @@ There are no changes between 1.0.0 and the previous 0.33.0 version.
365366

366367
* fix(sdk-web): parse url with relative url string [#2972](https://github.com/open-telemetry/opentelemetry-js/pull/2972) @legendecas
367368

368-
### :books: (Refine Doc)
369-
370-
### :house: (Internal)
371-
372369
## 1.2.0
373370

374-
### :boom: Breaking Change
375-
376-
### :rocket: (Enhancement)
377-
378371
### :bug: (Bug Fix)
379372

380373
* fix: sanitize attributes inputs [#2881](https://github.com/open-telemetry/opentelemetry-js/pull/2881) @legendecas
@@ -2290,7 +2283,9 @@ Released 2020-03-19
22902283

22912284
Released 2020-03-16
22922285

2293-
### This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality but makes no promises around breaking changes
2286+
### First official beta release
2287+
2288+
* provides almost fully complete metrics, tracing, and context propagation functionality but makes **no promises** around breaking changes
22942289

22952290
### :boom: Breaking Change
22962291

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you are a library author looking to build OpenTelemetry into your library, pl
111111

112112
| Platform Version | Supported |
113113
|---------------------|-----------------------------------------------|
114+
| Node.JS `v20` | :heavy_check_mark: |
114115
| Node.JS `v18` | :heavy_check_mark: |
115116
| Node.JS `v16` | :heavy_check_mark: |
116117
| Node.JS `v14` | :heavy_check_mark: |

experimental/CHANGELOG.md

+1-14
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ All notable changes to experimental packages in this project will be documented
1313
* fix(sdk-logs): avoid map attribute set when count limit exceeded
1414
* fix(instrumentation-fetch): only access navigator if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063)
1515
* allows for experimental usage of this instrumentation with non-browser runtimes
16-
17-
### :books: (Refine Doc)
18-
19-
### :house: (Internal)
16+
* fix(instrumentation-http): memory leak when responses are not resumed
2017

2118
## 0.45.1
2219

@@ -183,8 +180,6 @@ All notable changes to experimental packages in this project will be documented
183180

184181
* doc(instrumentation): add limitiations section to readme [#3786](https://github.com/open-telemetry/opentelemetry-js/pull/3786) @flarna
185182

186-
### :house: (Internal)
187-
188183
## 0.38.0
189184

190185
### :boom: Breaking Change
@@ -401,10 +396,6 @@ All notable changes to experimental packages in this project will be documented
401396
* fix(histogram): fix maximum when only values < -1 are provided [#3086](https://github.com/open-telemetry/opentelemetry-js/pull/3086) @pichlermarc
402397
* fix(instrumentation-grpc): always set grpc semcov status code attribute with numeric value [#3076](https://github.com/open-telemetry/opentelemetry-js/pull/3076) @blumamir
403398

404-
### :books: (Refine Doc)
405-
406-
### :house: (Internal)
407-
408399
## 0.30.0
409400

410401
### :boom: Breaking Change
@@ -479,10 +470,6 @@ All notable changes to experimental packages in this project will be documented
479470
* fix(metrics): specification compliant default metric unit [#2983](https://github.com/open-telemetry/opentelemetry-js/pull/2983) @andyfleming
480471
* fix(opentelemetry-instrumentation): use all provided patches for the same file [#2963](https://github.com/open-telemetry/opentelemetry-js/pull/2963) @Ugzuzg
481472

482-
### :books: (Refine Doc)
483-
484-
### :house: (Internal)
485-
486473
## 0.28.0
487474

488475
### :boom: Breaking Change

experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ describe('PrometheusExporter', () => {
360360
.get('http://localhost:9464/metrics', res => {
361361
errorHandler(done)(new Error('unreachable'));
362362
})
363-
.on('error', err => {
364-
assert(`${err}`.match('ECONNREFUSED'));
363+
.on('error', (err: any) => {
364+
assert.equal(err.code, 'ECONNREFUSED');
365365
done();
366366
});
367367
});

experimental/packages/opentelemetry-instrumentation-http/src/http.ts

+3
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
330330
'response',
331331
(response: http.IncomingMessage & { aborted?: boolean }) => {
332332
this._diag.debug('outgoingRequest on response()');
333+
if (request.listenerCount('response') <= 1) {
334+
response.resume();
335+
}
333336
const responseAttributes =
334337
utils.getOutgoingRequestAttributesOnResponse(response);
335338
span.setAttributes(responseAttributes);

experimental/packages/opentelemetry-instrumentation-http/test/utils/rawRequest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function sendRequestTwice(
2222
port: number
2323
): Promise<Buffer> {
2424
return new Promise((resolve, reject) => {
25-
const request = 'GET /raw HTTP/1.1\n\n';
25+
const request = `GET /raw HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`;
2626
const socket = net.createConnection({ host, port }, () => {
2727
socket.write(`${request}${request}`, err => {
2828
if (err) reject(err);

experimental/packages/opentelemetry-instrumentation/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
export * from './autoLoader';
18-
export * from './platform/index';
18+
export { InstrumentationBase } from './platform/index';
19+
export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition';
20+
export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile';
1921
export * from './types';
2022
export * from './types_internal';
2123
export * from './utils';

experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ import {
2525
TracerProvider,
2626
} from '@opentelemetry/api';
2727
import * as shimmer from 'shimmer';
28-
import { InstrumentationModuleDefinition } from './platform/node';
29-
import * as types from './types';
28+
import {
29+
InstrumentationModuleDefinition,
30+
Instrumentation,
31+
InstrumentationConfig,
32+
} from './types';
3033

3134
/**
3235
* Base abstract internal class for instrumenting node and web plugins
3336
*/
3437
export abstract class InstrumentationAbstract<T = any>
35-
implements types.Instrumentation
38+
implements Instrumentation
3639
{
37-
protected _config: types.InstrumentationConfig;
40+
protected _config: InstrumentationConfig;
3841

3942
private _tracer: Tracer;
4043
private _meter: Meter;
@@ -43,7 +46,7 @@ export abstract class InstrumentationAbstract<T = any>
4346
constructor(
4447
public readonly instrumentationName: string,
4548
public readonly instrumentationVersion: string,
46-
config: types.InstrumentationConfig = {}
49+
config: InstrumentationConfig = {}
4750
) {
4851
this._config = {
4952
enabled: true,
@@ -95,15 +98,15 @@ export abstract class InstrumentationAbstract<T = any>
9598
}
9699

97100
/* Returns InstrumentationConfig */
98-
public getConfig(): types.InstrumentationConfig {
101+
public getConfig(): InstrumentationConfig {
99102
return this._config;
100103
}
101104

102105
/**
103106
* Sets InstrumentationConfig to this plugin
104107
* @param InstrumentationConfig
105108
*/
106-
public setConfig(config: types.InstrumentationConfig = {}): void {
109+
public setConfig(config: InstrumentationConfig = {}): void {
107110
this._config = Object.assign({}, config);
108111
}
109112

experimental/packages/opentelemetry-instrumentation/src/platform/browser/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
* limitations under the License.
1515
*/
1616

17-
export * from './instrumentation';
17+
export { InstrumentationBase } from './instrumentation';

experimental/packages/opentelemetry-instrumentation/src/platform/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
* limitations under the License.
1515
*/
1616

17-
export * from './node';
17+
export { InstrumentationBase } from './node';

experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
export * from './instrumentation';
17-
export * from './instrumentationNodeModuleDefinition';
18-
export * from './instrumentationNodeModuleFile';
19-
export * from './types';
16+
export { InstrumentationBase } from './instrumentation';

experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
} from './RequireInTheMiddleSingleton';
2727
import type { HookFn } from 'import-in-the-middle';
2828
import * as ImportInTheMiddle from 'import-in-the-middle';
29-
import { InstrumentationModuleDefinition } from './types';
29+
import { InstrumentationModuleDefinition } from '../../types';
3030
import { diag } from '@opentelemetry/api';
3131
import type { OnRequireFn } from 'require-in-the-middle';
3232
import { Hook } from 'require-in-the-middle';

experimental/packages/opentelemetry-instrumentation/src/platform/node/types.ts

-59
This file was deleted.

0 commit comments

Comments
 (0)