Skip to content

Commit

Permalink
Merge branch 'main' into prometheus-serialiser
Browse files Browse the repository at this point in the history
# Conflicts:
#	experimental/CHANGELOG.md
  • Loading branch information
tapico-weyert committed Jul 28, 2022
2 parents 177ce69 + 776656b commit 9c92ad8
Show file tree
Hide file tree
Showing 115 changed files with 2,299 additions and 1,180 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
with:
node-version: ${{ matrix.node_version }}

- run: npm install -g npm@latest

- name: restore lerna
id: cache
uses: actions/cache@v3
Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,23 @@ All notable changes to this project will be documented in this file.

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)

## 1.5.0

### :rocket: (Enhancement)

* feat(sdk-trace-base): Improve extensibility of BasicTracerProvider [#3023](https://github.com/open-telemetry/opentelemetry-js/pull/3023) @Rauno56

## 1.4.0

### :rocket: (Enhancement)

* fix(resources): fix browser compatibility for host and os detectors [#3004](https://github.com/open-telemetry/opentelemetry-js/pull/3004) @legendecas
* fix(sdk-trace-base): fix crash on environments without global document [#3000](https://github.com/open-telemetry/opentelemetry-js/pull/3000) @legendecas

### :books: (Refine Doc)

### :house: (Internal)

* test: add node 18 and remove EoL node versions [#3048](https://github.com/open-telemetry/opentelemetry-js/pull/3048) @dyladan
Expand Down
57 changes: 51 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Please also see [GitHub workflow](https://github.com/open-telemetry/community/bl
- [TypeScript](https://www.typescriptlang.org/)
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts.
- [MochaJS](https://mochajs.org/) for tests
- [gts](https://github.com/google/gts)
- [eslint](https://eslint.org/)

Most of the commands needed for development are accessed as [npm scripts](https://docs.npmjs.com/cli/v6/using-npm/scripts). It is recommended that you use the provided npm scripts instead of using `lerna run` in most cases.
Expand Down Expand Up @@ -167,9 +166,16 @@ cd packages/opentelemetry-module-name
npm test
```

To run the unit tests continuously in watch mode while developing, use:

```sh
# Run test in watch mode
npm run tdd
```

### Linting

This project uses a combination of `gts` and `eslint`. Just like tests and compilation, linting can be done for all packages or only a single package.
This project uses `eslint` to lint source code. Just like tests and compilation, linting can be done for all packages or only a single package.

```sh
# Lint all modules
Expand All @@ -191,6 +197,19 @@ cd packages/opentelemetry-module-name
npm run lint:fix
```

### Generating docs

We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.

To generate the docs, use:

```sh
# Generate docs in the root 'docs' directory
npm run docs
```

The document will be available under `docs` path.

### Adding a package

To add a new package, copy `packages/template` to your new package directory and modify the `package.json` file to reflect your desired package settings. If the package will not support browser, the `karma.conf` and `tsconifg.esm.json` files may be deleted. If the package will support es5 targets, the reference to `tsconfig.base.json` in `tsconfig.json` should be changed to `tsconfig.es5.json`.
Expand Down Expand Up @@ -226,11 +245,37 @@ After adding the package, run `npm install` from the root of the project. This w

If all of the above requirements are met and there are no unresolved discussions, a pull request may be merged by either a maintainer or an approver.

### Generating API documentation

- `npm run docs` to generate API documentation. Generates the documentation in `packages/opentelemetry-api/docs/out`

### Generating CHANGELOG documentation

- Generate and export your [Github access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token): `export GITHUB_AUTH=<your_token>`
- `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).

### Platform conditional exports

Universal packages are packages that can be used in both web browsers and
Node.js environment. These packages may be implemented on top of different
platform APIs to achieve the same goal. Like accessing the _global_ reference,
we have different preferred ways to do it:

- In Node.js, we access the _global_ reference with `globalThis` or `global`:

```js
/// packages/opentelemetry-core/src/platform/node/globalThis.ts
export const _globalThis = typeof globalThis === 'object' ? globalThis : global;
```

- In web browser, we access the _global_ reference with the following definition:

```js
/// packages/opentelemetry-core/src/platform/browser/globalThis.ts
export const _globalThis: typeof globalThis =
typeof globalThis === 'object' ? globalThis :
typeof self === 'object' ? self :
typeof window === 'object' ? window :
typeof global === 'object' ? global :
{} as typeof globalThis;
```

Even though the implementation may differ, the exported names must be aligned.
It can be confusing if exported names present in one environment but not in the
others.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
<strong>
<a href="https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md">Contributing</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/development-guide.md">Development Guide</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="https://github.com/open-telemetry/opentelemetry-js/tree/main/examples">Examples</a>
</strong>
</p>
Expand All @@ -47,6 +45,8 @@ This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a

| API Version | Core version | Experimental Packages |
| ----------- | ------------ | --------------------- |
| 1.1.x | 1.3.x | 0.30.x |
| 1.1.x | 1.2.x | 0.29.x |
| 1.1.x | 1.1.x | 0.28.x |
| 1.0.x | 1.0.x | 0.26.x, 0.27.x |
| 1.0.x | 0.26.x | ----- |
Expand Down
94 changes: 0 additions & 94 deletions doc/development-guide.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basic-tracer-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"@opentelemetry/semantic-conventions": "0.25.0",
"@opentelemetry/sdk-trace-base": "0.25.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/basic-tracer-node"
}
2 changes: 1 addition & 1 deletion examples/grpc-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@opentelemetry/sdk-trace-node": "^1.0.1",
"google-protobuf": "^3.9.2"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/grpc-js",
"devDependencies": {
"cross-env": "^6.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"grpc": "^1.23.3",
"node-pre-gyp": "0.14.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/grpc",
"devDependencies": {
"cross-env": "^6.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/
#### Zipkin UI

`zipkin:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`).
Go to Zipkin with your browser <http://localhost:9411/zipkin/traces/(your-trace-id)> (e.g <http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6)>
Go to Zipkin with your browser <http://localhost:9411/zipkin/traces/(your-trace-id)> (e.g <http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6>)

<p align="center"><img src="./images/zipkin-ui.png?raw=true"/></p>

Expand All @@ -67,7 +67,7 @@ Go to Zipkin with your browser <http://localhost:9411/zipkin/traces/(your-trace-
#### Jaeger UI

`jaeger:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`).
Go to Jaeger with your browser <http://localhost:16686/trace/(your-trace-id)> (e.g <http://localhost:16686/trace/4815c3d576d930189725f1f1d1bdfcc6)>
Go to Jaeger with your browser <http://localhost:16686/trace/(your-trace-id)> (e.g <http://localhost:16686/trace/4815c3d576d930189725f1f1d1bdfcc6>)

<p align="center"><img src="images/jaeger-ui.png?raw=true"/></p>

Expand Down
2 changes: 1 addition & 1 deletion examples/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@opentelemetry/sdk-trace-node": "0.25.0",
"@opentelemetry/sdk-trace-base": "0.25.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/http",
"devDependencies": {
"cross-env": "^6.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@opentelemetry/sdk-trace-node": "0.25.0",
"@opentelemetry/sdk-trace-base": "0.25.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/https",
"devDependencies": {
"cross-env": "^6.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/opentracing-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@opentelemetry/sdk-trace-base": "0.25.0",
"opentracing": "^0.14.4"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/opentracing-shim",
"devDependencies": {
"cross-env": "^6.0.0"
}
Expand Down
28 changes: 14 additions & 14 deletions examples/otlp-exporter-node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "example-otlp-exporter-node",
"private": true,
"version": "0.29.2",
"version": "0.31.0",
"description": "Example of using @opentelemetry/collector-exporter in Node.js",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,18 +29,18 @@
},
"dependencies": {
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/api-metrics": "0.29.2",
"@opentelemetry/core": "1.3.1",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.29.2",
"@opentelemetry/exporter-metrics-otlp-http": "0.29.2",
"@opentelemetry/exporter-metrics-otlp-proto": "0.29.2",
"@opentelemetry/exporter-trace-otlp-grpc": "0.29.2",
"@opentelemetry/exporter-trace-otlp-http": "0.29.2",
"@opentelemetry/exporter-trace-otlp-proto": "0.29.2",
"@opentelemetry/resources": "1.3.1",
"@opentelemetry/sdk-metrics-base": "0.29.2",
"@opentelemetry/sdk-trace-base": "1.3.1",
"@opentelemetry/semantic-conventions": "1.3.1"
"@opentelemetry/api-metrics": "0.31.0",
"@opentelemetry/core": "1.5.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.31.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.31.0",
"@opentelemetry/exporter-metrics-otlp-proto": "0.31.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.31.0",
"@opentelemetry/exporter-trace-otlp-http": "0.31.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.31.0",
"@opentelemetry/resources": "1.5.0",
"@opentelemetry/sdk-metrics-base": "0.31.0",
"@opentelemetry/sdk-trace-base": "1.5.0",
"@opentelemetry/semantic-conventions": "1.5.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/otlp-exporter-node"
}
2 changes: 1 addition & 1 deletion examples/tracer-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"@opentelemetry/exporter-metrics-otlp-http": "0.27.0",
"@opentelemetry/sdk-metrics-base": "0.27.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
Loading

0 comments on commit 9c92ad8

Please sign in to comment.