Skip to content

Commit

Permalink
Merge pull request #5284 from dynatrace-oss-contrib/next-main-2024-12-16
Browse files Browse the repository at this point in the history
[SDK 2.0] merge changes from `next` to `main`
  • Loading branch information
pichlermarc authored Dec 18, 2024
2 parents 616d27a + 2610521 commit 107637e
Show file tree
Hide file tree
Showing 146 changed files with 1,793 additions and 1,321 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This action requires that any PR targeting the main branch should touch at
# This action requires that any PR targeting the main and next branch should touch at
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
# Changelog" label to disable this action.

Expand All @@ -9,6 +9,7 @@ on:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
- next
jobs:
changelog:
runs-on: ubuntu-latest
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
fail-fast: false
matrix:
node_version:
- "14"
- "16"
- "18"
- "20"
- "22"
Expand All @@ -34,10 +32,6 @@ jobs:
- run: npm install -g npm@latest
if: ${{ matrix.node_version == '20' || matrix.node_version == '22' }}

# npm@10.0.0 drops support for Node.js v14 and v16
- run: npm install -g npm@"<10.0.0"
if: ${{ matrix.node_version == '14' || matrix.node_version == '16' }}

# npm@11.0.0 drops support for Node.js v18
- run: npm install -g npm@"<11.0.0"
if: ${{ matrix.node_version == '18'}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/w3c-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '16'
node-version: 18

- name: Install and Bootstrap 🔧
run: npm ci
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se

### :boom: Breaking Change

* feat(sdk-metrics)!: bump minimum version of `@opentelemetry/api` peer dependency to 1.9.0 [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode
* chore(shim-opentracing): replace deprecated SpanAttributes [#4430](https://github.com/open-telemetry/opentelemetry-js/pull/4430) @JamieDanielson
* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson
* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc
* chore(otel-resources): replace deprecated SpanAttributes [#4428](https://github.com/open-telemetry/opentelemetry-js/pull/4428) @JamieDanielson
* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc
* feat(sdk-metrics)!: replace attributeKeys with custom processors option [#4532](https://github.com/open-telemetry/opentelemetry-js/pull/4532) @pichlermarc
* refactor(sdk-trace-base)!: replace `SpanAttributes` with `Attributes` [#5009](https://github.com/open-telemetry/opentelemetry-js/pull/5009) @david-luna
* refactor(resources)!: replace `ResourceAttributes` with `Attributes` [#5016](https://github.com/open-telemetry/opentelemetry-js/pull/5016) @david-luna
* feat(sdk-metrics)!: drop `View` and `Aggregation` in favor of `ViewOptions` and `AggregationOption` [#4931](https://github.com/open-telemetry/opentelemetry-js/pull/4931) @pichlermarc
* refactor(sdk-trace-base)!: remove `new Span` constructor in favor of `Tracer.startSpan` API [#5048](https://github.com/open-telemetry/opentelemetry-js/pull/5048) @david-luna
* refactor(sdk-trace-base)!: remove `BasicTracerProvider.addSpanProcessor` API in favor of constructor options. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna
* refactor(sdk-trace-base)!: make `resource` property private in `BasicTracerProvider` and remove `getActiveSpanProcessor` API. [#5192](https://github.com/open-telemetry/opentelemetry-js/pull/5192) @david-luna

### :rocket: (Enhancement)

### :bug: (Bug Fix)
Expand All @@ -19,6 +33,11 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se

### :house: (Internal)

* refactor(sdk-metrics): remove `Gauge` and `MetricAdvice` workaround types in favor of the upstream `@opentelemetry/api` types [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode
* chore: remove checks for unsupported node versions [#4341](https://github.com/open-telemetry/opentelemetry-js/pull/4341) @dyladan
* refactor(sdk-trace-base): remove `BasicTracerProvider._registeredSpanProcessors` private property. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna
* refactor(sdk-trace-base): rename `BasicTracerProvider.activeSpanProcessor` private property. [#5211](https://github.com/open-telemetry/opentelemetry-js/pull/5211) @david-luna

## 1.30.0

### :rocket: (Enhancement)
Expand Down Expand Up @@ -69,6 +88,8 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
* `@opentelemetry/propagator-aws-xray` is now located in [open-telemetry/opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)
* `@opentelemetry/propagator-aws-xray-lambda` is now located in [open-telemetry/opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)

* docs: [Browser] Define the supported browser runtimes [Issue #4168](https://github.com/open-telemetry/opentelemetry-js/issues/4168) PR:[#5059](https://github.com/open-telemetry/opentelemetry-js/pull/5059) @MSNev

### :house: (Internal)

* deps: set `@opentelemetry/api` dependency min version to 1.3.0 in `examples`, `experimental/packages`, `integration-tests` and `selenium-tests`
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

---

> [!WARNING]
> This is the working branch for the work in progress 2.0 SDK, see [this tracking issue](https://github.com/open-telemetry/opentelemetry-js/issues/5148) for details.
> If you are a user looking for the current released state, you are probably looking for the [1.x SDK](https://github.com/open-telemetry/opentelemetry-js/tree/v1.x) on the v1.x branch.
## About this project

This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces, metrics, and logs from applications.
Expand Down Expand Up @@ -135,8 +139,17 @@ Note that versions of Node.JS v8 prior to `v8.12.0` will NOT work, because OpenT
> Client instrumentation for the browser is **experimental** and mostly **unspecified**. If you are interested in
> helping out, get in touch with the [Client Instrumentation SIG][client-instrumentation-sig].
There is currently no list of officially supported browsers. OpenTelemetry is developed using standard web
technologies and aims to work in currently supported versions of major browsers.
Rather than define versions of specific browsers / runtimes, OpenTelemetry sets the minimum supported version based on the
underlying language features used.

The current minumum language feature support is set as [ECMAScript 2020](https://262.ecma-international.org/11.0/) that are available
in all modern browsers / runtimes.

This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2020, you will need
to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target
environments. Any support issues that arise from using a browser or runtime that does not support ES2020 will be closed as "won't fix".

This minimum support level is subject to change as the project evolves and as the underlying language features evolve.

## Package Version Compatibility

Expand Down
2 changes: 1 addition & 1 deletion examples/basic-tracer-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
7 changes: 4 additions & 3 deletions examples/esm-http-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
import http from 'http';

diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const exporter = new ConsoleSpanExporter();
const processor = new SimpleSpanProcessor(exporter);

const tracerProvider = new NodeTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'esm-http-ts-example',
}),
spanProcessors: [processor],
});
const exporter = new ConsoleSpanExporter();
const processor = new SimpleSpanProcessor(exporter);
tracerProvider.addSpanProcessor(processor);
tracerProvider.register();

registerInstrumentations({
Expand Down
2 changes: 1 addition & 1 deletion examples/esm-http-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"typescript"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"tracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.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 @@ -25,7 +25,7 @@
"tracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"web"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.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 @@ -22,7 +22,7 @@
"opentracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/otlp-exporter-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"tracing"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/backwards-compatibility/node14/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
}
}
2 changes: 1 addition & 1 deletion experimental/backwards-compatibility/node16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
}
}
2 changes: 1 addition & 1 deletion experimental/examples/opencensus-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"opencensus"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/exporter-logs-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/src/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/exporter-logs-otlp-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"prepublishOnly": "npm run compile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/src/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"build/esm/**/*.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import {
InstrumentType,
PushMetricExporter,
ResourceMetrics,
Aggregation,
AggregationSelector,
AggregationOption,
AggregationType,
} from '@opentelemetry/sdk-metrics';
import {
AggregationTemporalityPreference,
Expand Down Expand Up @@ -116,7 +117,11 @@ function chooseAggregationSelector(
if (config?.aggregationPreference) {
return config.aggregationPreference;
} else {
return (_instrumentType: any) => Aggregation.Default();
return (_instrumentType: any) => {
return {
type: AggregationType.DEFAULT,
};
};
}
}

Expand All @@ -138,7 +143,7 @@ export class OTLPMetricExporterBase
);
}

selectAggregation(instrumentType: InstrumentType): Aggregation {
selectAggregation(instrumentType: InstrumentType): AggregationOption {
return this._aggregationSelector(instrumentType);
}

Expand Down
Loading

0 comments on commit 107637e

Please sign in to comment.