Skip to content

Commit

Permalink
Merge branch 'main' into dropped-attributes-count
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunnoH authored Dec 5, 2023
2 parents 1ca1786 + 9e94536 commit 7dd0dfa
Show file tree
Hide file tree
Showing 25 changed files with 178 additions and 111 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ jobs:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}

- run: npm install -g npm@latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '18'

- name: Install and Build 🔧
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '16'

- uses: actions/checkout@v4

- name: Lint changelog file
uses: avto-dev/markdown-lint@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/peer-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: npm install -g lerna@6.6.2

- name: Install semver
run: npm install semver
run: npm install -g semver

- name: Check API dependency semantics
working-directory: packages
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- "14"
- "16"
- "18"
- "20"
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
Expand All @@ -24,6 +25,9 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}

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

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '18'

- run: npm install -g npm@latest
Expand All @@ -85,6 +92,9 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: 16

- name: Bootstrap
Expand All @@ -106,6 +116,9 @@ jobs:
uses: actions/checkout@v4.0.0
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: 16

- name: Bootstrap
Expand Down Expand Up @@ -133,6 +146,9 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}

- name: Build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/w3c-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '16'

- name: Install and Bootstrap 🔧
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
lockfile-version=2
13 changes: 4 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

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

### :bug: (Bug Fix)

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

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

### :books: (Refine Doc)

### :house: (Internal)

## 1.2.0

### :boom: Breaking Change

### :rocket: (Enhancement)

### :bug: (Bug Fix)

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

Released 2020-03-16

### 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
### First official beta release

* provides almost fully complete metrics, tracing, and context propagation functionality but makes **no promises** around breaking changes

### :boom: Breaking Change

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ If you are a library author looking to build OpenTelemetry into your library, pl

| Platform Version | Supported |
|---------------------|-----------------------------------------------|
| Node.JS `v20` | :heavy_check_mark: |
| Node.JS `v18` | :heavy_check_mark: |
| Node.JS `v16` | :heavy_check_mark: |
| Node.JS `v14` | :heavy_check_mark: |
Expand Down
15 changes: 1 addition & 14 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ All notable changes to experimental packages in this project will be documented
* fix(sdk-logs): avoid map attribute set when count limit exceeded
* fix(instrumentation-fetch): only access navigator if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063)
* allows for experimental usage of this instrumentation with non-browser runtimes

### :books: (Refine Doc)

### :house: (Internal)
* fix(instrumentation-http): memory leak when responses are not resumed

## 0.45.1

Expand Down Expand Up @@ -185,8 +182,6 @@ All notable changes to experimental packages in this project will be documented

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

### :house: (Internal)

## 0.38.0

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

### :books: (Refine Doc)

### :house: (Internal)

## 0.30.0

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

### :books: (Refine Doc)

### :house: (Internal)

## 0.28.0

### :boom: Breaking Change
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ describe('PrometheusExporter', () => {
.get('http://localhost:9464/metrics', res => {
errorHandler(done)(new Error('unreachable'));
})
.on('error', err => {
assert(`${err}`.match('ECONNREFUSED'));
.on('error', (err: any) => {
assert.equal(err.code, 'ECONNREFUSED');
done();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
'response',
(response: http.IncomingMessage & { aborted?: boolean }) => {
this._diag.debug('outgoingRequest on response()');
if (request.listenerCount('response') <= 1) {
response.resume();
}
const responseAttributes =
utils.getOutgoingRequestAttributesOnResponse(response);
span.setAttributes(responseAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function sendRequestTwice(
port: number
): Promise<Buffer> {
return new Promise((resolve, reject) => {
const request = 'GET /raw HTTP/1.1\n\n';
const request = `GET /raw HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`;
const socket = net.createConnection({ host, port }, () => {
socket.write(`${request}${request}`, err => {
if (err) reject(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

export * from './autoLoader';
export * from './platform/index';
export { InstrumentationBase } from './platform/index';
export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition';
export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile';
export * from './types';
export * from './types_internal';
export * from './utils';
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ import {
TracerProvider,
} from '@opentelemetry/api';
import * as shimmer from 'shimmer';
import { InstrumentationModuleDefinition } from './platform/node';
import * as types from './types';
import {
InstrumentationModuleDefinition,
Instrumentation,
InstrumentationConfig,
} from './types';

/**
* Base abstract internal class for instrumenting node and web plugins
*/
export abstract class InstrumentationAbstract<T = any>
implements types.Instrumentation
implements Instrumentation
{
protected _config: types.InstrumentationConfig;
protected _config: InstrumentationConfig;

private _tracer: Tracer;
private _meter: Meter;
Expand All @@ -43,7 +46,7 @@ export abstract class InstrumentationAbstract<T = any>
constructor(
public readonly instrumentationName: string,
public readonly instrumentationVersion: string,
config: types.InstrumentationConfig = {}
config: InstrumentationConfig = {}
) {
this._config = {
enabled: true,
Expand Down Expand Up @@ -95,15 +98,15 @@ export abstract class InstrumentationAbstract<T = any>
}

/* Returns InstrumentationConfig */
public getConfig(): types.InstrumentationConfig {
public getConfig(): InstrumentationConfig {
return this._config;
}

/**
* Sets InstrumentationConfig to this plugin
* @param InstrumentationConfig
*/
public setConfig(config: types.InstrumentationConfig = {}): void {
public setConfig(config: InstrumentationConfig = {}): void {
this._config = Object.assign({}, config);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export * from './instrumentation';
export { InstrumentationBase } from './instrumentation';
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export * from './node';
export { InstrumentationBase } from './node';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './instrumentation';
export * from './instrumentationNodeModuleDefinition';
export * from './instrumentationNodeModuleFile';
export * from './types';
export { InstrumentationBase } from './instrumentation';
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from './RequireInTheMiddleSingleton';
import type { HookFn } from 'import-in-the-middle';
import * as ImportInTheMiddle from 'import-in-the-middle';
import { InstrumentationModuleDefinition } from './types';
import { InstrumentationModuleDefinition } from '../../types';
import { diag } from '@opentelemetry/api';
import type { OnRequireFn } from 'require-in-the-middle';
import { Hook } from 'require-in-the-middle';
Expand Down
Loading

0 comments on commit 7dd0dfa

Please sign in to comment.