Skip to content

Commit

Permalink
Merge branch 'main' into test-old-api
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored Oct 14, 2022
2 parents 76edd6c + efb0275 commit 23afb84
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 43 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
run: npm run codecov
if: ${{ matrix.node_version == '14' }}
node-windows-tests:
strategy:
fail-fast: false
runs-on: windows-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
Expand Down Expand Up @@ -96,16 +94,16 @@ jobs:
run: npm run test
browser-tests:
runs-on: ubuntu-latest
container:
image: circleci/node:16-browsers
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Permission Setup
run: sudo chmod -R 777 /github /__w
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16

- name: restore lerna
id: cache
uses: actions/cache@v3
Expand All @@ -126,8 +124,6 @@ jobs:
- name: Build 🔧
run: |
npm run compile
# run additional compilation variants
npx lerna run compile
- name: Unit tests
Expand All @@ -136,15 +132,14 @@ jobs:
run: npm run codecov:browser
webworker-tests:
runs-on: ubuntu-latest
container:
image: circleci/node:16-browsers
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Permission Setup
run: sudo chmod -R 777 /github /__w
- name: Checkout
uses: actions/checkout@v3
uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: 16

- name: restore lerna
id: cache
Expand All @@ -166,8 +161,6 @@ jobs:
- name: Build 🔧
run: |
npm run compile
# run additional compilation variants
npx lerna run compile
- name: Unit tests
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ All notable changes to this project will be documented in this file.

### :rocket: (Enhancement)

* feat(sdk-trace): re-export sdk-trace-base in sdk-trace-node and web [#3319](https://github.com/open-telemetry/opentelemetry-js/pull/3319) @legendecas

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)

* ci: run browser tests without circle [#3328](https://github.com/open-telemetry/opentelemetry-js/pull/3328) @dyladan

## 1.7.0

### :bug: (Bug Fix)
Expand Down
6 changes: 4 additions & 2 deletions experimental/packages/exporter-trace-otlp-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ To see documentation and sample code for the metric exporter, see the [exporter-
The OTLPTraceExporter in Web expects the endpoint to end in `/v1/traces`.

```js
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
BatchSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';

const collectorOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ npm install --save @opentelemetry/instrumentation-fetch
## Usage

```js
'use strict';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ To load a specific instrumentation (HTTP in this case), specify it in the Node T

```js
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
const { ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const {
ConsoleSpanExporter,
NodeTracerProvider,
SimpleSpanProcessor,
} = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const provider = new NodeTracerProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ npm install --save @opentelemetry/instrumentation-xml-http-request
## Usage

```js
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
Expand Down
7 changes: 5 additions & 2 deletions packages/opentelemetry-context-zone-peer-dep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ npm install --save @opentelemetry/context-zone-peer-dep

```js
import { context, trace } from '@opentelemetry/api';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { ZoneContextManager } from '@opentelemetry/context-zone-peer-dep';

const providerWithZone = new WebTracerProvider();
Expand Down
7 changes: 5 additions & 2 deletions packages/opentelemetry-context-zone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ npm install --save @opentelemetry/context-zone

```js
import { context, trace } from '@opentelemetry/api';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { ZoneContextManager } from '@opentelemetry/context-zone';

const providerWithZone = new WebTracerProvider();
Expand Down
36 changes: 23 additions & 13 deletions packages/opentelemetry-sdk-trace-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ Samples every trace regardless of upstream sampling decisions.
> This is used as a default Sampler
```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOnSampler } = require("@opentelemetry/core");
const {
AlwaysOnSampler,
BasicTracerProvider,
} = require("@opentelemetry/sdk-trace-base");

const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
sampler: new AlwaysOnSampler()
});
```
Expand All @@ -70,10 +72,12 @@ const tracerProvider = new NodeTracerProvider({
Doesn't sample any trace, regardless of upstream sampling decisions.

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOffSampler } = require("@opentelemetry/core");
const {
AlwaysOffSampler,
BasicTracerProvider,
} = require("@opentelemetry/sdk-trace-base");

const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
sampler: new AlwaysOffSampler()
});
```
Expand All @@ -86,10 +90,12 @@ Any trace that would be sampled at a given percentage will also be sampled at an
The `TraceIDRatioSampler` may be used with the `ParentBasedSampler` to respect the sampled flag of an incoming trace.

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { TraceIdRatioBasedSampler } = require("@opentelemetry/core");
const {
BasicTracerProvider,
TraceIdRatioBasedSampler,
} = require("@opentelemetry/sdk-trace-base");

const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
// See details of ParentBasedSampler below
sampler: new ParentBasedSampler({
// Trace ID Ratio Sampler accepts a positional argument
Expand Down Expand Up @@ -130,10 +136,14 @@ Optional parameters:
|present|false|false|`localParentNotSampled()`|

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { ParentBasedSampler, AlwaysOffSampler, TraceIdRatioBasedSampler } = require("@opentelemetry/core");

const tracerProvider = new NodeTracerProvider({
const {
AlwaysOffSampler,
BasicTracerProvider,
ParentBasedSampler,
TraceIdRatioBasedSampler,
} = require("@opentelemetry/sdk-trace-base");

const tracerProvider = new BasicTracerProvider({
sampler: new ParentBasedSampler({
// By default, the ParentBasedSampler will respect the parent span's sampling
// decision. This is configurable by providing a different sampler to use
Expand Down
1 change: 1 addition & 0 deletions packages/opentelemetry-sdk-trace-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

export { NodeTracerConfig } from './config';
export * from './NodeTracerProvider';
export * from '@opentelemetry/sdk-trace-base';
7 changes: 5 additions & 2 deletions packages/opentelemetry-sdk-trace-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ npm install --save @opentelemetry/sdk-trace-web
## Usage

```js
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { DocumentLoad } from '@opentelemetry/plugin-document-load';
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
Expand Down
1 change: 1 addition & 0 deletions packages/opentelemetry-sdk-trace-web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export * from './StackContextManager';
export * from './enums/PerformanceTimingNames';
export * from './types';
export * from './utils';
export * from '@opentelemetry/sdk-trace-base';

0 comments on commit 23afb84

Please sign in to comment.