Skip to content

Commit

Permalink
Merge branch 'master' into add-express-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud authored Feb 8, 2020
2 parents f56b7af + 4faac48 commit 1102ca2
Show file tree
Hide file tree
Showing 234 changed files with 3,611 additions and 1,187 deletions.
50 changes: 28 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ node_test_env: &node_test_env
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_PORT: 3306
NPM_CONFIG_UNSAFE_PERM: true

postgres_service: &postgres_service
image: circleci/postgres:9.6-alpine
Expand All @@ -39,10 +40,10 @@ mysql_service: &mysql_service
MYSQL_ROOT_PASSWORD: rootpw

cache_1: &cache_1
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
paths:
- ./node_modules
- ./yarn.lock
- ./package-lock.json
- packages/opentelemetry-base/node_modules
- packages/opentelemetry-scope-base/node_modules
- packages/opentelemetry-api/node_modules
Expand All @@ -59,7 +60,7 @@ cache_1: &cache_1
- packages/opentelemetry-plugin-dns/node_modules

cache_2: &cache_2
key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-2
key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
paths:
- packages/opentelemetry-plugin-grpc/node_modules
- packages/opentelemetry-plugin-http/node_modules
Expand All @@ -77,6 +78,7 @@ cache_2: &cache_2
- packages/opentelemetry-plugin-express/node_modules

node_unit_tests: &node_unit_tests
resource_class: large
steps:
- checkout
- run:
Expand All @@ -94,28 +96,29 @@ node_unit_tests: &node_unit_tests
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
- restore_cache:
keys:
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-2
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
- run:
name: Install Dependencies
command: yarn install
name: Install Root Dependencies
command: npm install --ignore-scripts
- run:
name: Boostrap dependencies
command: npx lerna bootstrap --no-ci
- save_cache:
<<: *cache_1
- save_cache:
<<: *cache_2
- run:
name: Compile code
command: yarn compile
- run:
name: Unit tests
command: yarn test
command: npm run test
- run:
name: report coverage
command: if [ "${CIRCLE_NODE_VERSION}" = "v12" ]; then yarn codecov; fi
command: if [ "${CIRCLE_NODE_VERSION}" = "v12" ]; then npm run codecov; fi

browsers_unit_tests: &browsers_unit_tests
resource_class: large
steps:
- checkout
- run:
Expand All @@ -133,23 +136,26 @@ browsers_unit_tests: &browsers_unit_tests
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
- restore_cache:
keys:
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
- npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-FDF2088C
- run:
name: Install Root Dependencies
command: npm install --ignore-scripts
- run:
name: Install Dependencies
command: yarn install
name: Boostrap dependencies
command: npx lerna bootstrap --no-ci
- save_cache:
<<: *cache_1
- save_cache:
<<: *cache_2
- run:
name: Unit tests
command: yarn test:browser
command: npm run test:browser
- run:
name: report coverage
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then yarn codecov:browser; fi
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then npm run codecov:browser; fi

jobs:
lint_&_docs:
Expand All @@ -159,16 +165,16 @@ jobs:
- checkout
- run:
name: Install minimal doc and lint modules globally
command: yarn global add lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib
command: npm i -g tslint lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib
- run:
name: Symlink global modules into all lerna packages
command: lerna exec 'ln -s $(yarn global dir)/node_modules node_modules'
command: lerna exec 'npm link tslint lerna typedoc linkinator typescript gts tslint-consistent-codestyle tslint-microsoft-contrib'
- run:
name: Check code style and linting
command: yarn run check
command: npm run check
- run:
name: Docs tests
command: yarn docs-test
command: npm run docs-test
- persist_to_workspace:
root: packages/opentelemetry-api/docs
paths:
Expand Down
37 changes: 34 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.

## Unreleased

## 0.4.0

Released 2020-02-05

#### :rocket: (Enhancement)
* `opentelemetry-api`
* [#727](https://github.com/open-telemetry/opentelemetry-js/pull/727) Api separation (deprecate `opentelemetry-types`)
* [#749](https://github.com/open-telemetry/opentelemetry-js/pull/749) chore: rename registry to provider


#### :sparkles: (Feature)
* `opentelemetry-plugin-http`
* [#719](https://github.com/open-telemetry/opentelemetry-js/pull/719) feat(plugin-http): sync. specs for statuscode
* `opentelemetry-exporter-jaeger`
* [#735](https://github.com/open-telemetry/opentelemetry-js/pull/735) feat: decode jaeger header
* `opentelemetry-plugin-user-interaction`
* [#658](https://github.com/open-telemetry/opentelemetry-js/pull/658) feat: plugin user interaction for web

#### :books: (Refine Doc)
* [#689](https://github.com/open-telemetry/opentelemetry-js/pull/689) Add benchmark README and latest numbers
* [#733](https://github.com/open-telemetry/opentelemetry-js/pull/733) chore: add instruction for pg-pool plugin
* [#665](https://github.com/open-telemetry/opentelemetry-js/pull/665) docs: add ioredis example
* [#731](https://github.com/open-telemetry/opentelemetry-js/pull/731) Update Stackdriver exporter example

#### :bug: (Bug Fix)
* `opentelemetry-exporter-jaeger`
* [#715](https://github.com/open-telemetry/opentelemetry-js/pull/715) fix: unref jaeger socket to prevent process running indefinitely
* `opentelemetry-plugin-ioredis`
* [#671](https://github.com/open-telemetry/opentelemetry-js/pull/671) [ioredis plugin] fix: change supportedVersions to >1 <5


## 0.3.3

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

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

Expand All @@ -28,7 +59,7 @@ Released 2020-01-22

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

## 0.3.2

Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ Please also see [GitHub workflow](https://github.com/open-telemetry/community/bl

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

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


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

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

### Benchmarks
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.

- `yarn bench` or `npm run bench` to run your benchmark.
- `npm run bench` to run your benchmark.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telem

| Package | Description |
| ----------------------- | -----------------|
| [@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. |
| [@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. |
| [@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. |

### Implementation / SDKs
Expand Down Expand Up @@ -142,6 +142,7 @@ OpenTelemetry can collect tracing data automatically using plugins. Vendors/User
#### Web Plugins
- [@opentelemetry/plugin-document-load][otel-plugin-document-load]
- [@opentelemetry/plugin-xml-http-request][otel-plugin-xml-http-request]
- [@opentelemetry/plugin-user-interaction][otel-plugin-user-interaction]

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).

Expand Down Expand Up @@ -192,6 +193,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool
[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg
[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-redis
[otel-plugin-user-interaction]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-user-interaction
[otel-plugin-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-xml-http-request
[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-express
[otel-shim-opentracing]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-shim-opentracing
Expand Down
8 changes: 4 additions & 4 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The minimum sample size is set to 10 to perform statistical analysis on benchmar
### `v0.3.3` release

```
Beginning NoopTracerRegistry Benchmark...
Beginning NoopTracerProvider Benchmark...
5 tests completed.
#startSpan x 731,516,636 ops/sec ±2.57% (20 runs sampled)
Expand All @@ -25,7 +25,7 @@ Beginning NoopTracerRegistry Benchmark...
#startSpan with 30 attributes x 1,658,688 ops/sec ±1.23% (20 runs sampled)
#startSpan with 100 attributes x 535,082 ops/sec ±1.55% (20 runs sampled)
Beginning BasicTracerRegistry Benchmark...
Beginning BasicTracerProvider Benchmark...
5 tests completed.
#startSpan x 80,633 ops/sec ±3.57% (20 runs sampled)
Expand All @@ -34,7 +34,7 @@ Beginning BasicTracerRegistry Benchmark...
#startSpan with 30 attributes x 36,331 ops/sec ±1.29% (20 runs sampled)
#startSpan with 100 attributes x 3,549 ops/sec ±3.59% (20 runs sampled)
Beginning BasicTracerRegistry with SimpleSpanProcessor Benchmark...
Beginning BasicTracerProvider with SimpleSpanProcessor Benchmark...
5 tests completed.
#startSpan x 74,539 ops/sec ±4.49% (20 runs sampled)
Expand All @@ -43,7 +43,7 @@ Beginning BasicTracerRegistry with SimpleSpanProcessor Benchmark...
#startSpan with 30 attributes x 26,491 ops/sec ±13.68% (20 runs sampled)
#startSpan with 100 attributes x 2,464 ops/sec ±19.64% (20 runs sampled)
Beginning BasicTracerRegistry with BatchSpanProcessor Benchmark...
Beginning BasicTracerProvider with BatchSpanProcessor Benchmark...
5 tests completed.
#startSpan x 74,974 ops/sec ±3.57% (20 runs sampled)
Expand Down
33 changes: 17 additions & 16 deletions benchmark/tracer.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
'use strict';

const benchmark = require('./benchmark');
const opentelemetry = require('../packages/opentelemetry-core');
const { BasicTracerRegistry, BatchSpanProcessor, InMemorySpanExporter, SimpleSpanProcessor } = require('../packages/opentelemetry-tracing');
const opentelemetry = require('../packages/opentelemetry-api');
const { NoopLogger } = require('../packages/opentelemetry-core');
const { BasicTracerProvider, BatchSpanProcessor, InMemorySpanExporter, SimpleSpanProcessor } = require('../packages/opentelemetry-tracing');

const logger = new opentelemetry.NoopLogger();
const logger = new NoopLogger();

const setups = [
{
name: 'NoopTracerRegistry',
registry: opentelemetry.getTracerRegistry()
name: 'NoopTracerProvider',
provider: new opentelemetry.NoopTracerProvider()
},
{
name: 'BasicTracerRegistry',
registry: new BasicTracerRegistry({ logger })
name: 'BasicTracerProvider',
provider: new BasicTracerProvider({ logger })
},
{
name: 'BasicTracerRegistry with SimpleSpanProcessor',
registry: getRegistry(new SimpleSpanProcessor(new InMemorySpanExporter()))
name: 'BasicTracerProvider with SimpleSpanProcessor',
provider: getProvider(new SimpleSpanProcessor(new InMemorySpanExporter()))
},
{
name: 'BasicTracerRegistry with BatchSpanProcessor',
registry: getRegistry(new BatchSpanProcessor(new InMemorySpanExporter()))
name: 'BasicTracerProvider with BatchSpanProcessor',
provider: getProvider(new BatchSpanProcessor(new InMemorySpanExporter()))
}
];

for (const setup of setups) {
console.log(`Beginning ${setup.name} Benchmark...`);
const tracer = setup.registry.getTracer("benchmark");
const tracer = setup.provider.getTracer("benchmark");
const suite = benchmark(20)
.add('#startSpan', function () {
const span = tracer.startSpan('op');
Expand Down Expand Up @@ -62,9 +63,9 @@ for (const setup of setups) {
// run async
suite.run({ async: false });
}
function getRegistry(processor) {
const registry = new BasicTracerRegistry({ logger });
registry.addSpanProcessor(processor);
return registry;
function getProvider(processor) {
const provider = new BasicTracerProvider({ logger });
provider.addSpanProcessor(processor);
return provider;
}

Loading

0 comments on commit 1102ca2

Please sign in to comment.