Skip to content

Commit 9a344a1

Browse files
authored
Merge branch 'master' into use_trace_context
2 parents 813c3cd + 28b9b74 commit 9a344a1

244 files changed

Lines changed: 5629 additions & 2143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ node_test_env: &node_test_env
1818
MYSQL_PASSWORD: secret
1919
MYSQL_DATABASE: circle_database
2020
MYSQL_PORT: 3306
21+
NPM_CONFIG_UNSAFE_PERM: true
2122

2223
postgres_service: &postgres_service
2324
image: circleci/postgres:9.6-alpine
@@ -39,10 +40,10 @@ mysql_service: &mysql_service
3940
MYSQL_ROOT_PASSWORD: rootpw
4041

4142
cache_1: &cache_1
42-
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
43+
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
4344
paths:
4445
- ./node_modules
45-
- ./yarn.lock
46+
- ./package-lock.json
4647
- packages/opentelemetry-base/node_modules
4748
- packages/opentelemetry-scope-base/node_modules
4849
- packages/opentelemetry-api/node_modules
@@ -59,7 +60,7 @@ cache_1: &cache_1
5960
- packages/opentelemetry-plugin-dns/node_modules
6061

6162
cache_2: &cache_2
62-
key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-2
63+
key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
6364
paths:
6465
- packages/opentelemetry-plugin-grpc/node_modules
6566
- packages/opentelemetry-plugin-http/node_modules
@@ -74,8 +75,10 @@ cache_2: &cache_2
7475
- packages/opentelemetry-exporter-collector/node_modules
7576
- packages/opentelemetry-plugin-xml-http-request/node_modules
7677
- packages/opentelemetry-exporter-stackdriver-trace/node_modules
78+
- packages/opentelemetry-plugin-express/node_modules
7779

7880
node_unit_tests: &node_unit_tests
81+
resource_class: large
7982
steps:
8083
- checkout
8184
- run:
@@ -93,28 +96,29 @@ node_unit_tests: &node_unit_tests
9396
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
9497
- restore_cache:
9598
keys:
96-
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
99+
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
97100
- restore_cache:
98101
keys:
99-
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-2
102+
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
100103
- run:
101-
name: Install Dependencies
102-
command: yarn install
104+
name: Install Root Dependencies
105+
command: npm install --ignore-scripts
106+
- run:
107+
name: Boostrap dependencies
108+
command: npx lerna bootstrap --no-ci
103109
- save_cache:
104110
<<: *cache_1
105111
- save_cache:
106112
<<: *cache_2
107-
- run:
108-
name: Compile code
109-
command: yarn compile
110113
- run:
111114
name: Unit tests
112-
command: yarn test
115+
command: npm run test
113116
- run:
114117
name: report coverage
115-
command: if [ "${CIRCLE_NODE_VERSION}" = "v12" ]; then yarn codecov; fi
118+
command: if [ "${CIRCLE_NODE_VERSION}" = "v12" ]; then npm run codecov; fi
116119

117120
browsers_unit_tests: &browsers_unit_tests
121+
resource_class: large
118122
steps:
119123
- checkout
120124
- run:
@@ -132,49 +136,57 @@ browsers_unit_tests: &browsers_unit_tests
132136
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
133137
- restore_cache:
134138
keys:
135-
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
139+
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
136140
- restore_cache:
137141
keys:
138-
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
142+
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
139143
- run:
140-
name: Install Dependencies
141-
command: yarn install
144+
name: Install Root Dependencies
145+
command: npm install --ignore-scripts
146+
- run:
147+
name: Boostrap dependencies
148+
command: npx lerna bootstrap --no-ci
142149
- save_cache:
143150
<<: *cache_1
144151
- save_cache:
145152
<<: *cache_2
146153
- run:
147154
name: Unit tests
148-
command: yarn test:browser
155+
command: npm run test:browser
149156
- run:
150157
name: report coverage
151-
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then yarn codecov:browser; fi
158+
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then npm run codecov:browser; fi
152159

153160
jobs:
154161
lint_&_docs:
155162
docker:
156163
- image: node:12
164+
environment:
165+
NPM_CONFIG_UNSAFE_PERM: true
157166
steps:
158167
- checkout
159168
- run:
160169
name: Install minimal doc and lint modules globally
161-
command: yarn global add lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib
170+
command: npm i -g tslint lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib
162171
- run:
163172
name: Symlink global modules into all lerna packages
164-
command: lerna exec 'ln -s $(yarn global dir)/node_modules node_modules'
173+
command: lerna exec 'npm link tslint lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib'
165174
- run:
166175
name: Check code style and linting
167-
command: yarn run check
176+
command: npm run check
177+
- run:
178+
name: Install doc dependencies
179+
command: lerna bootstrap --no-ci --scope @opentelemetry/api --include-filtered-dependencies -- --only dev
168180
- run:
169181
name: Docs tests
170-
command: yarn docs-test
182+
command: npm run docs-test
171183
- persist_to_workspace:
172184
root: packages/opentelemetry-api/docs
173185
paths:
174186
- out
175187
- run:
176188
name: Install minimal modules to lint examples
177-
command: npm i -D eslint eslint-plugin-import eslint-config-airbnb-base
189+
command: npm i --no-save eslint eslint-plugin-import eslint-config-airbnb-base
178190
- run:
179191
name: Lint examples
180192
command: npm run lint-examples

CHANGELOG.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
## 0.4.0
8+
9+
Released 2020-02-05
10+
11+
#### :rocket: (Enhancement)
12+
* `opentelemetry-api`
13+
* [#727](https://github.com/open-telemetry/opentelemetry-js/pull/727) Api separation (deprecate `opentelemetry-types`)
14+
* [#749](https://github.com/open-telemetry/opentelemetry-js/pull/749) chore: rename registry to provider
15+
16+
17+
#### :sparkles: (Feature)
18+
* `opentelemetry-plugin-http`
19+
* [#719](https://github.com/open-telemetry/opentelemetry-js/pull/719) feat(plugin-http): sync. specs for statuscode
20+
* `opentelemetry-exporter-jaeger`
21+
* [#735](https://github.com/open-telemetry/opentelemetry-js/pull/735) feat: decode jaeger header
22+
* `opentelemetry-plugin-user-interaction`
23+
* [#658](https://github.com/open-telemetry/opentelemetry-js/pull/658) feat: plugin user interaction for web
24+
25+
#### :books: (Refine Doc)
26+
* [#689](https://github.com/open-telemetry/opentelemetry-js/pull/689) Add benchmark README and latest numbers
27+
* [#733](https://github.com/open-telemetry/opentelemetry-js/pull/733) chore: add instruction for pg-pool plugin
28+
* [#665](https://github.com/open-telemetry/opentelemetry-js/pull/665) docs: add ioredis example
29+
* [#731](https://github.com/open-telemetry/opentelemetry-js/pull/731) Update Stackdriver exporter example
30+
31+
#### :bug: (Bug Fix)
32+
* `opentelemetry-exporter-jaeger`
33+
* [#715](https://github.com/open-telemetry/opentelemetry-js/pull/715) fix: unref jaeger socket to prevent process running indefinitely
34+
* `opentelemetry-plugin-ioredis`
35+
* [#671](https://github.com/open-telemetry/opentelemetry-js/pull/671) [ioredis plugin] fix: change supportedVersions to >1 <5
36+
37+
738
## 0.3.3
839

940
Released 2020-01-22
@@ -15,11 +46,11 @@ Released 2020-01-22
1546
* [#662](https://github.com/open-telemetry/opentelemetry-js/pull/662) feat: add pg-pool to default list of instrumented plugins
1647
* [#708](https://github.com/open-telemetry/opentelemetry-js/pull/708) Simplify and speed up trace context parsing
1748
* `opentelemetry-metrics`
18-
* [#700](https://github.com/open-telemetry/opentelemetry-js/pull/700) implement named meter
49+
* [#700](https://github.com/open-telemetry/opentelemetry-js/pull/700) implement named meter
1950

2051
#### :sparkles: (Feature)
2152
* `opentelemetry-propagator-jaeger`
22-
* [#701](https://github.com/open-telemetry/opentelemetry-js/pull/701) add jaeger http trace format
53+
* [#701](https://github.com/open-telemetry/opentelemetry-js/pull/701) add jaeger http trace format
2354
* `opentelemetry-exporter-stackdriver-trace`
2455
* [#648](https://github.com/open-telemetry/opentelemetry-js/pull/648) Stackdriver Trace exporter
2556

@@ -28,7 +59,7 @@ Released 2020-01-22
2859

2960
#### :bug: (Bug Fix)
3061
* `opentelemetry-plugin-ioredis`
31-
* [#714](https://github.com/open-telemetry/opentelemetry-js/pull/714) fix: return module exports from ioredis
62+
* [#714](https://github.com/open-telemetry/opentelemetry-js/pull/714) fix: return module exports from ioredis
3263

3364
## 0.3.2
3465

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ Please also see [GitHub workflow](https://github.com/open-telemetry/community/bl
5757

5858
The `opentelemetry-js` project is written in TypeScript.
5959

60-
- `yarn install` or `npm install` to install dependencies.
61-
- `yarn compile` or `npm run compile` compiles the code, checking for type errors.
62-
- `yarn bootstrap` or `npm run bootstrap` Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.
63-
- `yarn test` or `npm test` tests code the same way that our CI will test it.
64-
- `yarn fix` or `npm run fix` lint (and maybe fix) any changes.
60+
- `npm install` to install dependencies.
61+
- `npm run compile` compiles the code, checking for type errors.
62+
- `npm run bootstrap` Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.
63+
- `npm test` tests code the same way that our CI will test it.
64+
- `npm run fix` lint (and maybe fix) any changes.
6565

6666

6767
### Generating API documentation
68-
- `yarn docs` or `npm run docs` to generate API documentation. Generates the documentation in `packages/opentelemetry-api/docs/out`
68+
- `npm run docs` to generate API documentation. Generates the documentation in `packages/opentelemetry-api/docs/out`
6969

7070
### Generating CHANGELOG documentation
71-
- `yarn changelog` or `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).
71+
- `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).
7272

7373
### Benchmarks
7474
When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm.
7575

76-
- `yarn bench` or `npm run bench` to run your benchmark.
76+
- `npm run bench` to run your benchmark.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telem
9696

9797
| Package | Description |
9898
| ----------------------- | -----------------|
99-
| [@opentelemetry/api][otel-api] | This package provides TypeScript interfaces and enums for the OpenTelemetry core trace and metrics model. It is intended for use both on the server and in the browser. |
99+
| [@opentelemetry/api][otel-api] | This package provides TypeScript interfaces, enums and no-op implementations for the OpenTelemetry core trace and metrics model. It is intended for use both on the server and in the browser. |
100100
| [@opentelemetry/core][otel-core] | This package provides default and no-op implementations of the OpenTelemetry api for trace and metrics. It's intended for use both on the server and in the browser. |
101101

102102
### Implementation / SDKs
@@ -137,10 +137,12 @@ OpenTelemetry can collect tracing data automatically using plugins. Vendors/User
137137
- [@opentelemetry/plugin-redis][otel-plugin-redis]
138138
- [@opentelemetry/plugin-ioredis][otel-plugin-ioredis]
139139
- [@opentelemetry/plugin-dns][otel-plugin-dns] - By default, this plugin is not loaded [#612](https://github.com/open-telemetry/opentelemetry-js/issues/612)
140+
- [@opentelemetry/plugin-express][otel-plugin-express] - By default, this plugin is not loaded
140141

141142
#### Web Plugins
142143
- [@opentelemetry/plugin-document-load][otel-plugin-document-load]
143144
- [@opentelemetry/plugin-xml-http-request][otel-plugin-xml-http-request]
145+
- [@opentelemetry/plugin-user-interaction][otel-plugin-user-interaction]
144146

145147
To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, you can [write a plugin yourself](https://github.com/open-telemetry/opentelemetry-js/blob/master/doc/plugin-guide.md).
146148

@@ -191,7 +193,9 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
191193
[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool
192194
[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg
193195
[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-redis
196+
[otel-plugin-user-interaction]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-user-interaction
194197
[otel-plugin-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-xml-http-request
198+
[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-express
195199
[otel-shim-opentracing]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-shim-opentracing
196200
[otel-tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-tracing
197201
[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-web

benchmark/tracer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22

33
const benchmark = require('./benchmark');
4-
const opentelemetry = require('../packages/opentelemetry-core');
4+
const opentelemetry = require('../packages/opentelemetry-api');
5+
const { NoopLogger } = require('../packages/opentelemetry-core');
56
const { BasicTracerProvider, BatchSpanProcessor, InMemorySpanExporter, SimpleSpanProcessor } = require('../packages/opentelemetry-tracing');
67

7-
const logger = new opentelemetry.NoopLogger();
8+
const logger = new NoopLogger();
89

910
const setups = [
1011
{
1112
name: 'NoopTracerProvider',
12-
provider: opentelemetry.getTracerProvider()
13+
provider: new opentelemetry.NoopTracerProvider()
1314
},
1415
{
1516
name: 'BasicTracerProvider',

doc/development-guide.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
Before contributing to this open source project, read our [CONTRIBUTING](../CONTRIBUTING.md). We gratefully welcome improvements to documentation as well as to code.
44

5-
The code base is a monorepo. We use [Lerna](https://lerna.js.org/) for managing inter-module dependencies, which makes it easier to develop coordinated changes between the modules. Instead of running lerna directly, the commands are wrapped with `yarn`;
5+
The code base is a monorepo. We use [Lerna](https://lerna.js.org/) for managing inter-module dependencies, which makes it easier to develop coordinated changes between the modules. Instead of running lerna directly, the commands are wrapped with `npm`;
66

77
### Requirements
88

99
Since this project supports multiple Node versions, using a version
1010
manager such as [nvm](https://github.com/creationix/nvm) is recommended.
1111

12-
We use [yarn](https://yarnpkg.com/) for its workspace functionality, so make sure to install that as well.
13-
14-
To get started once you have Node and yarn installed, run:
12+
To get started once you have Node installed, run:
1513

1614
```sh
17-
$ yarn
15+
$ npm install
1816
```
1917

2018
This will install all the necessary modules.
@@ -26,13 +24,13 @@ This will install all the necessary modules.
2624
To run the all unit tests, use:
2725

2826
```sh
29-
$ yarn test
27+
$ npm run test
3028
```
3129

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

3432
```sh
35-
$ yarn tdd
33+
$ npm run tdd
3634
```
3735

3836
### Linting
@@ -43,12 +41,12 @@ Before raising a pull request, make sure there are no lint problems.
4341

4442
To check the linter, use:
4543
```sh
46-
$ yarn run check
44+
$ npm run check
4745
```
4846

4947
To fix the linter, use:
5048
```sh
51-
$ yarn fix
49+
$ npm run fix
5250
```
5351

5452
### Continuous Integration
@@ -74,7 +72,7 @@ We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api docu
7472

7573
To generate the docs, use:
7674
```sh
77-
$ yarn docs
75+
$ npm run docs
7876
```
7977

8078
The document will be available under `packages/opentelemetry-api/docs/out` path.

doc/exporter-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `MetricExporter` defines the interface that protocol-specific exporters must
4343

4444
The current `MetricExporter` interface (`0.2.0`) defines 2 methods:
4545

46-
- `export`: Exports a batch of telemetry data. In this method you’ll process and translate `ReadableMetric` Data into the data that your metric backend accepts.
46+
- `export`: Exports a batch of telemetry data. In this method you’ll process and translate `MetricRecord` Data into the data that your metric backend accepts.
4747

4848
- `shutdown`: Shuts down the exporter. This is an opportunity for exporter to do any cleanup required. `Shutdown` should be called only once for each Exporter instance. After the call to `Shutdown` subsequent calls to Export are not allowed and should return `FailedNotRetryable` error.
4949

doc/plugin-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Plugin Developer Guide
22

3-
The `NodeTracer` or `Node-SDK` is driven by a set of plugins that describe how to patch a module to generate trace spans when that module is used. We provide out-of-the-box instrumentation for many popular frameworks and libraries by using a plugin system (see [builtin plugins][builtin-plugins]), and provide a means for developers to create their own.
3+
The `NodeTracerProvider` or `Node-SDK` is driven by a set of plugins that describe how to patch a module to generate trace spans when that module is used. We provide out-of-the-box instrumentation for many popular frameworks and libraries by using a plugin system (see [builtin plugins][builtin-plugins]), and provide a means for developers to create their own.
44

55
We strongly recommended to create a dedicated package for newly added plugin, example: `@opentelemetry/plugin-xxx`.
66

examples/basic-tracer-node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ For that please make sure you have [docker](https://docs.docker.com/) installed
7373
```
7474

7575
#### Collector Exporter - Zipkin UI
76-
The [opentelemetry-collector][opentelemetry-collector-url]
76+
The [opentelemetry-collector][opentelemetry-collector-url]
7777
docker container is using [Zipkin Exporter](#zipkin).
7878
You can define more exporters without changing the instrumented code.
7979
To use default [Zipkin Exporter](#zipkin) please follow the section [Zipkin UI](#zipkin-ui) only

0 commit comments

Comments
 (0)