diff --git a/CHANGELOG.md b/CHANGELOG.md index 65903a9f2d..d6a363a9e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,19 +7,31 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ## Unreleased -* feat: collect host id for non-cloud environments [#3575](https://github.com/open-telemetry/opentelemetry-js/pull/3575) @mwear - ### :boom: Breaking Change ### :rocket: (Enhancement) * feat(sdk-metrics): add exponential histogram accumulation / aggregator [#3505](https://github.com/open-telemetry/opentelemetry-js/pull/3505) @mwear + +### :bug: (Bug Fix) + +### :books: (Refine Doc) + +### :house: (Internal) + +## 1.10.0 + +### :rocket: (Enhancement) + * feat(resource): create sync resource with some attributes that resolve asynchronously [#3460](https://github.com/open-telemetry/opentelemetry-js/pull/3460) @samimusallam +* feat: collect host id for non-cloud environments [#3575](https://github.com/open-telemetry/opentelemetry-js/pull/3575) @mwear * feat (api-logs): separate Events API into its own package [3550](https://github.com/open-telemetry/opentelemetry-js/pull/3550) @martinkuba * feat(sdk-metrics): apply binary search in histogram recording [#3539](https://github.com/open-telemetry/opentelemetry-js/pull/3539) @legendecas * perf(propagator-jaeger): improve deserializeSpanContext performance [#3541](https://github.com/open-telemetry/opentelemetry-js/pull/3541) @doochik * feat: support TraceState in SamplingResult [#3530](https://github.com/open-telemetry/opentelemetry-js/pull/3530) @raphael-theriault-swi * feat(sdk-trace-base): add diagnostic logging when spans are dropped [#3610](https://github.com/open-telemetry/opentelemetry-js/pull/3610) @neoeinstein +* feat: add unit to view instrument selection criteria [#3647](https://github.com/open-telemetry/opentelemetry-js/pull/3647) @jlabatut +* feat(tracing): expose dropped counts for attributes, events and links on span [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05 ### :bug: (Bug Fix) @@ -32,6 +44,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :house: (Internal) +* chore(exporter-jaeger): deprecate jaeger exporter [#3585](https://github.com/open-telemetry/opentelemetry-js/pull/3585) @pichlermarc * fix(sdk-metrics): fix flaky LastValueAggregator test by using fake timer [#3587](https://github.com/open-telemetry/opentelemetry-js/pull/3587) @pichlermarc * fix(test): fix failing tests by preventing source-map generation [#3642](https://github.com/open-telemetry/opentelemetry-js/pull/3642) @pichlermarc diff --git a/api/CHANGELOG.md b/api/CHANGELOG.md index 31697a308c..5b52050074 100644 --- a/api/CHANGELOG.md +++ b/api/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## Unreleased +## 1.4.1 + ### :bug: (Bug Fix) * fix(metrics): export `MetricsAPI` type [#3535](https://github.com/open-telemetry/opentelemetry-js/pull/3535) @@ -15,6 +17,7 @@ All notable changes to this project will be documented in this file. ### :rocket: (Enhancement) * feat(api): add `getActiveBaggage` API [#3385](https://github.com/open-telemetry/opentelemetry-js/pull/3385) +* feat(api): add optional `droppedAttributesCount` property in the `Link` interface [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05 ### :bug: (Bug Fix) diff --git a/api/package.json b/api/package.json index 6aa2a0a9c7..a82fd886b8 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/api", - "version": "1.4.0", + "version": "1.4.1", "description": "Public API for OpenTelemetry", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/api/src/trace/link.ts b/api/src/trace/link.ts index 1d81d38d69..2b7ed19dd7 100644 --- a/api/src/trace/link.ts +++ b/api/src/trace/link.ts @@ -37,4 +37,6 @@ export interface Link { context: SpanContext; /** A set of {@link SpanAttributes} on the link. */ attributes?: SpanAttributes; + /** Count of attributes of the link that were dropped due to collection limits */ + droppedAttributesCount?: number; } diff --git a/examples/https/package.json b/examples/https/package.json index 1c5b2c3179..0e7991cd86 100644 --- a/examples/https/package.json +++ b/examples/https/package.json @@ -1,7 +1,7 @@ { "name": "https-example", "private": true, - "version": "0.35.1", + "version": "0.36.0", "description": "Example of HTTPs integration with OpenTelemetry", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -33,14 +33,14 @@ }, "dependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/exporter-jaeger": "1.9.1", - "@opentelemetry/exporter-zipkin": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/instrumentation-http": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-node": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/exporter-jaeger": "1.10.0", + "@opentelemetry/exporter-zipkin": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/instrumentation-http": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-node": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/https", "devDependencies": { diff --git a/examples/opentelemetry-web/package.json b/examples/opentelemetry-web/package.json index 4967b0eeff..02e10c607f 100644 --- a/examples/opentelemetry-web/package.json +++ b/examples/opentelemetry-web/package.json @@ -1,7 +1,7 @@ { "name": "web-opentelemetry-example", "private": true, - "version": "0.35.1", + "version": "0.36.0", "description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics in browser", "main": "index.js", "scripts": { @@ -43,20 +43,20 @@ }, "dependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-zone": "1.9.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-metrics-otlp-http": "0.35.1", - "@opentelemetry/exporter-trace-otlp-http": "0.35.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.35.1", - "@opentelemetry/exporter-zipkin": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/instrumentation-fetch": "0.35.1", - "@opentelemetry/instrumentation-xml-http-request": "0.35.1", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-web": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/context-zone": "1.10.0", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.36.0", + "@opentelemetry/exporter-trace-otlp-http": "0.36.0", + "@opentelemetry/exporter-trace-otlp-proto": "0.36.0", + "@opentelemetry/exporter-zipkin": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/instrumentation-fetch": "0.36.0", + "@opentelemetry/instrumentation-xml-http-request": "0.36.0", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-web": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web" } diff --git a/examples/otlp-exporter-node/package.json b/examples/otlp-exporter-node/package.json index 67425a5379..d60567735a 100644 --- a/examples/otlp-exporter-node/package.json +++ b/examples/otlp-exporter-node/package.json @@ -1,7 +1,7 @@ { "name": "example-otlp-exporter-node", "private": true, - "version": "0.35.1", + "version": "0.36.0", "description": "Example of using @opentelemetry/collector-exporter in Node.js", "main": "index.js", "scripts": { @@ -29,17 +29,17 @@ }, "dependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-metrics-otlp-grpc": "0.35.1", - "@opentelemetry/exporter-metrics-otlp-http": "0.35.1", - "@opentelemetry/exporter-metrics-otlp-proto": "0.35.1", - "@opentelemetry/exporter-trace-otlp-grpc": "0.35.1", - "@opentelemetry/exporter-trace-otlp-http": "0.35.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-metrics-otlp-grpc": "0.36.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.36.0", + "@opentelemetry/exporter-metrics-otlp-proto": "0.36.0", + "@opentelemetry/exporter-trace-otlp-grpc": "0.36.0", + "@opentelemetry/exporter-trace-otlp-http": "0.36.0", + "@opentelemetry/exporter-trace-otlp-proto": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/otlp-exporter-node" } diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 7d5a24082a..ddf59a324b 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -6,6 +6,18 @@ All notable changes to experimental packages in this project will be documented ### :boom: Breaking Change +### :rocket: (Enhancement) + +### :bug: (Bug Fix) + +### :books: (Refine Doc) + +### :house: (Internal) + +## 0.36.0 + +### :boom: Breaking Change + * feat: remove HTTP/HTTPS prefix from span name [#3603](https://github.com/open-telemetry/opentelemetry-js/pull/3603) @Flarna ### :rocket: (Enhancement) @@ -16,15 +28,12 @@ All notable changes to experimental packages in this project will be documented * feat(sdk-node): install diag logger with OTEL_LOG_LEVEL [#3627](https://github.com/open-telemetry/opentelemetry-js/pull/3627) @legendecas * feat(otlp-exporter-base): add retries [#3207](https://github.com/open-telemetry/opentelemetry-js/pull/3207) @svetlanabrennan * feat(sdk-node): override IdGenerator when using NodeSDK [#3645](https://github.com/open-telemetry/opentelemetry-js/pull/3645) @haddasbronfman +* feat(otlp-transformer): expose dropped attributes, events and links counts on the transformed otlp span [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05 ### :bug: (Bug Fix) * fix(prometheus-exporter): add possibility to respond to errors returned by `server.listen()` [#3552](https://github.com/open-telemetry/opentelemetry-js/pull/3402) @pichlermarc - fix(sdk-node): update instrumentations once MeterProvider is initialized [#3624](https://github.com/open-telemetry/opentelemetry-js/pull/3624) @pichlermarc - -### :books: (Refine Doc) - -### :house: (Internal) +* fix(sdk-node): update instrumentations once MeterProvider is initialized [#3624](https://github.com/open-telemetry/opentelemetry-js/pull/3624) @pichlermarc ## 0.35.1 diff --git a/experimental/backwards-compatability/node14/package.json b/experimental/backwards-compatability/node14/package.json index 1d40058ead..b363980d02 100644 --- a/experimental/backwards-compatability/node14/package.json +++ b/experimental/backwards-compatability/node14/package.json @@ -1,6 +1,6 @@ { "name": "backcompat-node14", - "version": "0.35.1", + "version": "0.36.0", "private": true, "description": "Backwards compatability app for node 14 types and the OpenTelemetry Node.js SDK", "main": "index.js", @@ -9,8 +9,8 @@ "peer-api-check": "node ../../../scripts/peer-api-check.js" }, "dependencies": { - "@opentelemetry/sdk-node": "0.35.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/sdk-node": "0.36.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "devDependencies": { "@types/node": "14.18.25", diff --git a/experimental/backwards-compatability/node16/package.json b/experimental/backwards-compatability/node16/package.json index 25e8e60913..61bad89de6 100644 --- a/experimental/backwards-compatability/node16/package.json +++ b/experimental/backwards-compatability/node16/package.json @@ -1,6 +1,6 @@ { "name": "backcompat-node16", - "version": "0.35.1", + "version": "0.36.0", "private": true, "description": "Backwards compatability app for node 16 types and the OpenTelemetry Node.js SDK", "main": "index.js", @@ -9,8 +9,8 @@ "peer-api-check": "node ../../../scripts/peer-api-check.js" }, "dependencies": { - "@opentelemetry/sdk-node": "0.35.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/sdk-node": "0.36.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "devDependencies": { "@types/node": "16.11.52", diff --git a/experimental/examples/prometheus/package.json b/experimental/examples/prometheus/package.json index a649056fa3..dffaae7c61 100644 --- a/experimental/examples/prometheus/package.json +++ b/experimental/examples/prometheus/package.json @@ -1,6 +1,6 @@ { "name": "prometheus-example", - "version": "0.35.1", + "version": "0.36.0", "private": true, "description": "Example of using @opentelemetry/sdk-metrics and @opentelemetry/exporter-prometheus", "main": "index.js", @@ -11,7 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/exporter-prometheus": "0.35.1", - "@opentelemetry/sdk-metrics": "1.9.1" + "@opentelemetry/exporter-prometheus": "0.36.0", + "@opentelemetry/sdk-metrics": "1.10.0" } } diff --git a/experimental/packages/api-events/package.json b/experimental/packages/api-events/package.json index da3732de78..8faa9b9315 100644 --- a/experimental/packages/api-events/package.json +++ b/experimental/packages/api-events/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/api-events", - "version": "0.35.1", + "version": "0.36.0", "description": "Public events API for OpenTelemetry", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/experimental/packages/api-logs/package.json b/experimental/packages/api-logs/package.json index d4f54600c3..a279d1c870 100644 --- a/experimental/packages/api-logs/package.json +++ b/experimental/packages/api-logs/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/api-logs", - "version": "0.35.1", + "version": "0.36.0", "description": "Public logs API for OpenTelemetry", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/experimental/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json index 4600780b4a..25facebfce 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-grpc", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,8 +49,8 @@ "devDependencies": { "@babel/core": "7.16.0", "@grpc/proto-loader": "^0.7.3", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/otlp-exporter-base": "0.35.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/otlp-exporter-base": "0.36.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -69,11 +69,11 @@ }, "dependencies": { "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-grpc-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-grpc", "sideEffects": false diff --git a/experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts index e95868f305..6ce80bf2c2 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts +++ b/experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts @@ -61,22 +61,34 @@ export const mockedReadableSpan: ReadableSpan = { }, ], events: [ - { name: 'fetchStart', time: [1574120165, 429803070] }, + { + name: 'fetchStart', + time: [1574120165, 429803070], + }, { name: 'domainLookupStart', time: [1574120165, 429803070], }, - { name: 'domainLookupEnd', time: [1574120165, 429803070] }, + { + name: 'domainLookupEnd', + time: [1574120165, 429803070], + }, { name: 'connectStart', time: [1574120165, 429803070], }, - { name: 'connectEnd', time: [1574120165, 429803070] }, + { + name: 'connectEnd', + time: [1574120165, 429803070], + }, { name: 'requestStart', time: [1574120165, 435513070], }, - { name: 'responseStart', time: [1574120165, 436923070] }, + { + name: 'responseStart', + time: [1574120165, 436923070], + }, { name: 'responseEnd', time: [1574120165, 438688070], @@ -91,6 +103,9 @@ export const mockedReadableSpan: ReadableSpan = { }) ), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; export function ensureExportedEventsAreCorrect(events: IEvent[]) { diff --git a/experimental/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json index 90ac43cab7..660e929ef5 100644 --- a/experimental/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-http", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Trace Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -64,7 +64,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -94,11 +94,11 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-http", "sideEffects": false diff --git a/experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts index feab35b55e..06e256d253 100644 --- a/experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts +++ b/experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts @@ -72,22 +72,34 @@ export const mockedReadableSpan: ReadableSpan = { }, ], events: [ - { name: 'fetchStart', time: [1574120165, 429803070] }, + { + name: 'fetchStart', + time: [1574120165, 429803070], + }, { name: 'domainLookupStart', time: [1574120165, 429803070], }, - { name: 'domainLookupEnd', time: [1574120165, 429803070] }, + { + name: 'domainLookupEnd', + time: [1574120165, 429803070], + }, { name: 'connectStart', time: [1574120165, 429803070], }, - { name: 'connectEnd', time: [1574120165, 429803070] }, + { + name: 'connectEnd', + time: [1574120165, 429803070], + }, { name: 'requestStart', time: [1574120165, 435513070], }, - { name: 'responseStart', time: [1574120165, 436923070] }, + { + name: 'responseStart', + time: [1574120165, 436923070], + }, { name: 'responseEnd', time: [1574120165, 438688070], @@ -102,6 +114,9 @@ export const mockedReadableSpan: ReadableSpan = { }) ), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; export const mockedResources: Resource[] = [ @@ -142,6 +157,9 @@ export const basicTrace: ReadableSpan[] = [ duration: [0, 8885000], resource: mockedResources[0], instrumentationLibrary: mockedInstrumentationLibraries[0], + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }, { name: 'span2', @@ -164,6 +182,9 @@ export const basicTrace: ReadableSpan[] = [ duration: [0, 8775000], resource: mockedResources[0], instrumentationLibrary: mockedInstrumentationLibraries[0], + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }, { name: 'span3', @@ -186,6 +207,9 @@ export const basicTrace: ReadableSpan[] = [ duration: [0, 8775000], resource: mockedResources[0], instrumentationLibrary: mockedInstrumentationLibraries[0], + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }, ]; diff --git a/experimental/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json index 920f533084..651efbf868 100644 --- a/experimental/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-proto", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector using protobuf over HTTP", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -63,7 +63,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -81,12 +81,12 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-exporter-base": "0.35.1", - "@opentelemetry/otlp-proto-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-exporter-base": "0.36.0", + "@opentelemetry/otlp-proto-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-proto", "sideEffects": false diff --git a/experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts index 67ea6593bc..5e2b71c573 100644 --- a/experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts +++ b/experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts @@ -59,22 +59,34 @@ export const mockedReadableSpan: ReadableSpan = { }, ], events: [ - { name: 'fetchStart', time: [1574120165, 429803070] }, + { + name: 'fetchStart', + time: [1574120165, 429803070], + }, { name: 'domainLookupStart', time: [1574120165, 429803070], }, - { name: 'domainLookupEnd', time: [1574120165, 429803070] }, + { + name: 'domainLookupEnd', + time: [1574120165, 429803070], + }, { name: 'connectStart', time: [1574120165, 429803070], }, - { name: 'connectEnd', time: [1574120165, 429803070] }, + { + name: 'connectEnd', + time: [1574120165, 429803070], + }, { name: 'requestStart', time: [1574120165, 435513070], }, - { name: 'responseStart', time: [1574120165, 436923070] }, + { + name: 'responseStart', + time: [1574120165, 436923070], + }, { name: 'responseEnd', time: [1574120165, 438688070], @@ -87,6 +99,9 @@ export const mockedReadableSpan: ReadableSpan = { cost: 112.12, }), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; export function ensureProtoEventsAreCorrect(events: IEvent[]) { diff --git a/experimental/packages/opentelemetry-browser-detector/package.json b/experimental/packages/opentelemetry-browser-detector/package.json index a1b604d274..f09c2db88f 100644 --- a/experimental/packages/opentelemetry-browser-detector/package.json +++ b/experimental/packages/opentelemetry-browser-detector/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/opentelemetry-browser-detector", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Resource Detector for Browser", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -54,7 +54,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "9.1.1", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -70,8 +70,8 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/browser-detector" } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json index ddefef4862..546576055f 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-grpc", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@babel/core": "7.16.0", "@grpc/proto-loader": "^0.7.3", - "@opentelemetry/api": "^1.3.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -68,12 +68,12 @@ }, "dependencies": { "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-metrics-otlp-http": "0.35.1", - "@opentelemetry/otlp-grpc-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.36.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc", "sideEffects": false diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index 01c9e5f742..136de8f952 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-http", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -64,7 +64,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.3.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -94,11 +94,11 @@ "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http", "sideEffects": false diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json index df98d761fa..f2befe0f5b 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-metrics-otlp-proto", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector using protobuf over HTTP", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,7 +48,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.3.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -66,13 +66,13 @@ "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-metrics-otlp-http": "0.35.1", - "@opentelemetry/otlp-exporter-base": "0.35.1", - "@opentelemetry/otlp-proto-exporter-base": "0.35.1", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.36.0", + "@opentelemetry/otlp-exporter-base": "0.36.0", + "@opentelemetry/otlp-proto-exporter-base": "0.36.0", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-proto", "sideEffects": false diff --git a/experimental/packages/opentelemetry-exporter-prometheus/package.json b/experimental/packages/opentelemetry-exporter-prometheus/package.json index 685ea68a1e..3207302717 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/package.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-prometheus", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry Exporter Prometheus provides a metrics endpoint for Prometheus", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -43,8 +43,8 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/semantic-conventions": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/semantic-conventions": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -60,9 +60,9 @@ "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-prometheus", "sideEffects": false diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index 7e3a2719a8..f50a49f93a 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-fetch", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry fetch automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -55,10 +55,10 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-zone": "1.9.1", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/context-zone": "1.10.0", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -87,10 +87,10 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/sdk-trace-web": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/sdk-trace-web": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-fetch", "sideEffects": false diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts b/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts index 75aa38c921..d02269c440 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts +++ b/experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts @@ -301,7 +301,7 @@ export class FetchInstrumentation extends InstrumentationBase< ): Promise { const self = this; const url = web.parseUrl( - args[0] instanceof Request ? args[0].url : args[0] + args[0] instanceof Request ? args[0].url : String(args[0]) ).href; const options = args[0] instanceof Request ? args[0] : args[1] || {}; diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 5bc49bcc37..a94eeb44cb 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-grpc", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry grpc automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -47,11 +47,11 @@ "devDependencies": { "@grpc/grpc-js": "^1.7.1", "@grpc/proto-loader": "^0.7.3", - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-async-hooks": "1.9.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-node": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/context-async-hooks": "1.10.0", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-node": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/semver": "7.3.9", @@ -71,8 +71,8 @@ "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc", "sideEffects": false diff --git a/experimental/packages/opentelemetry-instrumentation-http/package.json b/experimental/packages/opentelemetry-instrumentation-http/package.json index 7cae297fe3..edca601263 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/package.json +++ b/experimental/packages/opentelemetry-instrumentation-http/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-http", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry http/https automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -45,11 +45,11 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-async-hooks": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-node": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/context-async-hooks": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-node": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/request-promise-native": "1.0.18", @@ -73,9 +73,9 @@ "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/semantic-conventions": "1.9.1", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/semantic-conventions": "1.10.0", "semver": "^7.3.5" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http", diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 99813efd39..1b6d89eda3 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-xml-http-request", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry XMLHttpRequest automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -55,10 +55,10 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-zone": "1.9.1", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/context-zone": "1.10.0", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -87,10 +87,10 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/sdk-trace-web": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/sdk-trace-web": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-xml-http-request", "sideEffects": false diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index ca15993c47..34038617bf 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation", - "version": "0.35.1", + "version": "0.36.0", "description": "Base class for node which OpenTelemetry instrumentation modules extend", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation", @@ -77,8 +77,8 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.3.0", - "@opentelemetry/sdk-metrics": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/sdk-metrics": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/semver": "7.3.9", diff --git a/experimental/packages/opentelemetry-sdk-node/package.json b/experimental/packages/opentelemetry-sdk-node/package.json index bb629ad0b5..4fa7129941 100644 --- a/experimental/packages/opentelemetry-sdk-node/package.json +++ b/experimental/packages/opentelemetry-sdk-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-node", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry SDK for Node.js", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -44,25 +44,25 @@ "access": "public" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-jaeger": "1.9.1", - "@opentelemetry/exporter-trace-otlp-grpc": "0.35.1", - "@opentelemetry/exporter-trace-otlp-http": "0.35.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.35.1", - "@opentelemetry/exporter-zipkin": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-node": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-jaeger": "1.10.0", + "@opentelemetry/exporter-trace-otlp-grpc": "0.36.0", + "@opentelemetry/exporter-trace-otlp-http": "0.36.0", + "@opentelemetry/exporter-trace-otlp-proto": "0.36.0", + "@opentelemetry/exporter-zipkin": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-node": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.5.0" }, "devDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0", - "@opentelemetry/context-async-hooks": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/context-async-hooks": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/semver": "7.3.9", diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index 22c390b1bb..c90c957957 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-exporter-base", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry OTLP Exporter base (for internal use only)", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -61,10 +61,10 @@ "access": "public" }, "dependencies": { - "@opentelemetry/core": "1.9.1" + "@opentelemetry/core": "1.10.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", diff --git a/experimental/packages/otlp-grpc-exporter-base/package.json b/experimental/packages/otlp-grpc-exporter-base/package.json index c64506e064..8f8130abd7 100644 --- a/experimental/packages/otlp-grpc-exporter-base/package.json +++ b/experimental/packages/otlp-grpc-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-grpc-exporter-base", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry OTLP-gRPC Exporter base (for internal use only)", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -50,10 +50,10 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/otlp-transformer": "0.35.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/api": "1.4.1", + "@opentelemetry/otlp-transformer": "0.36.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -73,8 +73,8 @@ "dependencies": { "@grpc/grpc-js": "^1.7.1", "@grpc/proto-loader": "^0.7.3", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-exporter-base": "0.35.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-exporter-base": "0.36.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-grpc-exporter-base", "sideEffects": false diff --git a/experimental/packages/otlp-grpc-exporter-base/test/traceHelper.ts b/experimental/packages/otlp-grpc-exporter-base/test/traceHelper.ts index 8aef302d05..13103b405b 100644 --- a/experimental/packages/otlp-grpc-exporter-base/test/traceHelper.ts +++ b/experimental/packages/otlp-grpc-exporter-base/test/traceHelper.ts @@ -61,22 +61,34 @@ export const mockedReadableSpan: ReadableSpan = { }, ], events: [ - { name: 'fetchStart', time: [1574120165, 429803070] }, + { + name: 'fetchStart', + time: [1574120165, 429803070], + }, { name: 'domainLookupStart', time: [1574120165, 429803070], }, - { name: 'domainLookupEnd', time: [1574120165, 429803070] }, + { + name: 'domainLookupEnd', + time: [1574120165, 429803070], + }, { name: 'connectStart', time: [1574120165, 429803070], }, - { name: 'connectEnd', time: [1574120165, 429803070] }, + { + name: 'connectEnd', + time: [1574120165, 429803070], + }, { name: 'requestStart', time: [1574120165, 435513070], }, - { name: 'responseStart', time: [1574120165, 436923070] }, + { + name: 'responseStart', + time: [1574120165, 436923070], + }, { name: 'responseEnd', time: [1574120165, 438688070], @@ -91,6 +103,9 @@ export const mockedReadableSpan: ReadableSpan = { }) ), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; export function ensureExportedEventsAreCorrect(events: IEvent[]) { diff --git a/experimental/packages/otlp-proto-exporter-base/package.json b/experimental/packages/otlp-proto-exporter-base/package.json index a3ae550587..1c1c7d3c97 100644 --- a/experimental/packages/otlp-proto-exporter-base/package.json +++ b/experimental/packages/otlp-proto-exporter-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/otlp-proto-exporter-base", - "version": "0.35.1", + "version": "0.36.0", "description": "OpenTelemetry OTLP-HTTP-protobuf Exporter base (for internal use only)", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -59,7 +59,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -77,8 +77,8 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/otlp-exporter-base": "0.35.1", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/otlp-exporter-base": "0.36.0", "protobufjs": "^7.1.2" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-proto-exporter-base", diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index d4596fddba..b19b0bc839 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "0.35.1", + "version": "0.36.0", "description": "Transform OpenTelemetry SDK data into OTLP", "module": "build/esm/index.js", "esnext": "build/esnext/index.js", @@ -55,7 +55,7 @@ "@opentelemetry/api": ">=1.3.0 <1.5.0" }, "devDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0", + "@opentelemetry/api": "1.4.1", "@types/mocha": "10.0.0", "@types/webpack-env": "1.16.3", "codecov": "3.8.3", @@ -76,10 +76,10 @@ "webpack": "4.46.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-transformer", "sideEffects": false diff --git a/experimental/packages/otlp-transformer/src/trace/internal.ts b/experimental/packages/otlp-transformer/src/trace/internal.ts index e4d787349e..6811a8182f 100644 --- a/experimental/packages/otlp-transformer/src/trace/internal.ts +++ b/experimental/packages/otlp-transformer/src/trace/internal.ts @@ -39,16 +39,16 @@ export function sdkSpanToOtlpSpan(span: ReadableSpan, useHex?: boolean): ISpan { startTimeUnixNano: hrTimeToNanoseconds(span.startTime), endTimeUnixNano: hrTimeToNanoseconds(span.endTime), attributes: toAttributes(span.attributes), - droppedAttributesCount: 0, + droppedAttributesCount: span.droppedAttributesCount, events: span.events.map(toOtlpSpanEvent), - droppedEventsCount: 0, + droppedEventsCount: span.droppedEventsCount, status: { // API and proto enums share the same values code: status.code as unknown as EStatusCode, message: status.message, }, links: span.links.map(link => toOtlpLink(link, useHex)), - droppedLinksCount: 0, + droppedLinksCount: span.droppedLinksCount, }; } @@ -62,7 +62,7 @@ export function toOtlpLink(link: Link, useHex?: boolean): ILink { ? link.context.traceId : core.hexToBase64(link.context.traceId), traceState: link.context.traceState?.serialize(), - droppedAttributesCount: 0, + droppedAttributesCount: link.droppedAttributesCount || 0, }; } @@ -73,6 +73,6 @@ export function toOtlpSpanEvent(timedEvent: TimedEvent): IEvent { : [], name: timedEvent.name, timeUnixNano: hrTimeToNanoseconds(timedEvent.time), - droppedAttributesCount: 0, + droppedAttributesCount: timedEvent.droppedAttributesCount || 0, }; } diff --git a/experimental/packages/otlp-transformer/test/trace.test.ts b/experimental/packages/otlp-transformer/test/trace.test.ts index 7308139004..da3e1d0c7d 100644 --- a/experimental/packages/otlp-transformer/test/trace.test.ts +++ b/experimental/packages/otlp-transformer/test/trace.test.ts @@ -178,6 +178,9 @@ describe('Trace', () => { status: { code: SpanStatusCode.OK, }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; }); diff --git a/integration-tests/propagation-validation-server/package.json b/integration-tests/propagation-validation-server/package.json index e49ef1ac83..beb4b61caa 100644 --- a/integration-tests/propagation-validation-server/package.json +++ b/integration-tests/propagation-validation-server/package.json @@ -1,6 +1,6 @@ { "name": "propagation-validation-server", - "version": "1.9.1", + "version": "1.10.0", "description": "server for w3c tests", "main": "validation_server.js", "private": true, @@ -12,9 +12,9 @@ }, "dependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "1.9.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/context-async-hooks": "1.10.0", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "axios": "0.24.0", "body-parser": "1.19.0", "express": "4.17.3" diff --git a/packages/opentelemetry-context-async-hooks/package.json b/packages/opentelemetry-context-async-hooks/package.json index c44f6ea93c..ea957ddd99 100644 --- a/packages/opentelemetry-context-async-hooks/package.json +++ b/packages/opentelemetry-context-async-hooks/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-async-hooks", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry AsyncHooks-based Context Manager", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index ff1f4aa78f..f773e4c0d5 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-zone-peer-dep", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Context Zone with peer dependency for zone.js", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/packages/opentelemetry-context-zone-peer-dep/src/util.ts b/packages/opentelemetry-context-zone-peer-dep/src/util.ts index 2d5e87996f..7c4ac5f68d 100644 --- a/packages/opentelemetry-context-zone-peer-dep/src/util.ts +++ b/packages/opentelemetry-context-zone-peer-dep/src/util.ts @@ -14,13 +14,12 @@ * limitations under the License. */ -import { TargetWithEvents } from './types'; - /** - * check if an object has addEventListener and removeEventListener functions then it will return true - * @param obj + * check if an object has addEventListener and removeEventListener functions then it will return true. + * Generally only called with a `TargetWithEvents` but may be called with an unknown / any. + * @param obj - The object to check. */ -export function isListenerObject(obj: TargetWithEvents = {}): boolean { +export function isListenerObject(obj: any = {}): boolean { return ( typeof obj.addEventListener === 'function' && typeof obj.removeEventListener === 'function' diff --git a/packages/opentelemetry-context-zone/package.json b/packages/opentelemetry-context-zone/package.json index b31be1757c..40448baf4f 100644 --- a/packages/opentelemetry-context-zone/package.json +++ b/packages/opentelemetry-context-zone/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/context-zone", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Context Zone", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -74,7 +74,7 @@ "webpack-merge": "5.8.0" }, "dependencies": { - "@opentelemetry/context-zone-peer-dep": "1.9.1", + "@opentelemetry/context-zone-peer-dep": "1.10.0", "zone.js": "^0.11.0" }, "sideEffects": true, diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index f9cd044ce6..4ca680a641 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/core", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -91,7 +91,7 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core", "sideEffects": false diff --git a/packages/opentelemetry-core/src/utils/environment.ts b/packages/opentelemetry-core/src/utils/environment.ts index 5d529d08a9..57983cdeef 100644 --- a/packages/opentelemetry-core/src/utils/environment.ts +++ b/packages/opentelemetry-core/src/utils/environment.ts @@ -47,6 +47,8 @@ const ENVIRONMENT_NUMBERS_KEYS = [ 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', 'OTEL_SPAN_EVENT_COUNT_LIMIT', 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', 'OTEL_EXPORTER_OTLP_TIMEOUT', 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', @@ -131,6 +133,9 @@ export const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; export const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +export const DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +export const DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; + /** * Default environment variables */ @@ -172,6 +177,10 @@ export const DEFAULT_ENVIRONMENT: Required = { OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT: 128, OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: + DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: + DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_TRACES_EXPORTER: '', OTEL_TRACES_SAMPLER: TracesSamplerValues.ParentBasedAlwaysOn, OTEL_TRACES_SAMPLER_ARG: '', diff --git a/packages/opentelemetry-exporter-jaeger/README.md b/packages/opentelemetry-exporter-jaeger/README.md index 802debb99d..4adceb9b74 100644 --- a/packages/opentelemetry-exporter-jaeger/README.md +++ b/packages/opentelemetry-exporter-jaeger/README.md @@ -1,8 +1,14 @@ -# OpenTelemetry Jaeger Trace Exporter for Node.js +# (Deprecated) OpenTelemetry Jaeger Trace Exporter for Node.js [![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image] +**NOTE: Support for `@opentelemetry/exporter-jaeger` will end March 2024, please use any of the following packages instead:** + +- `@opentelemetry/exporter-trace-otlp-proto` +- `@opentelemetry/exporter-trace-otlp-grpc` +- `@opentelemetry/exporter-trace-otlp-http` + OpenTelemetry Jaeger Trace Exporter allows the user to send collected traces to Jaeger. [Jaeger](https://jaeger.readthedocs.io/en/latest/), inspired by [Dapper](https://research.google.com/pubs/pub36356.html) and [OpenZipkin](http://zipkin.io/), is a distributed tracing system released as open source by [Uber Technologies](http://uber.github.io/). It is used for monitoring and troubleshooting microservices-based distributed systems, including: diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index fbfbf01170..27170b73b3 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-jaeger", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Exporter Jaeger allows user to send collected traces to Jaeger", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -45,7 +45,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/resources": "1.9.1", + "@opentelemetry/resources": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/sinon": "10.0.13", @@ -62,9 +62,9 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0", "jaeger-client": "^3.15.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-jaeger", diff --git a/packages/opentelemetry-exporter-jaeger/src/jaeger.ts b/packages/opentelemetry-exporter-jaeger/src/jaeger.ts index 2f7acabe76..28d3ccb337 100644 --- a/packages/opentelemetry-exporter-jaeger/src/jaeger.ts +++ b/packages/opentelemetry-exporter-jaeger/src/jaeger.ts @@ -29,6 +29,16 @@ import * as jaegerTypes from './types'; /** * Format and sends span information to Jaeger Exporter. + * + * @deprecated Jaeger supports the OpenTelemetry protocol natively + * (see https://www.jaegertracing.io/docs/1.41/apis/#opentelemetry-protocol-stable). + * This exporter will not be required by the OpenTelemetry specification starting July 2023, and + * will not receive any security fixes past March 2024. + * + * Please migrate to any of the following packages: + * - `@opentelemetry/exporter-trace-otlp-proto` + * - `@opentelemetry/exporter-trace-otlp-grpc` + * - `@opentelemetry/exporter-trace-otlp-http` */ export class JaegerExporter implements SpanExporter { private readonly _onShutdownFlushTimeout: number; diff --git a/packages/opentelemetry-exporter-jaeger/src/transform.ts b/packages/opentelemetry-exporter-jaeger/src/transform.ts index 61321e78aa..b91e0c2929 100644 --- a/packages/opentelemetry-exporter-jaeger/src/transform.ts +++ b/packages/opentelemetry-exporter-jaeger/src/transform.ts @@ -86,6 +86,30 @@ export function spanToThrift(span: ReadableSpan): ThriftSpan { }); } + /* Add droppedAttributesCount as a tag */ + if (span.droppedAttributesCount) { + tags.push({ + key: 'otel.dropped_attributes_count', + value: toTagValue(span.droppedAttributesCount), + }); + } + + /* Add droppedEventsCount as a tag */ + if (span.droppedEventsCount) { + tags.push({ + key: 'otel.dropped_events_count', + value: toTagValue(span.droppedEventsCount), + }); + } + + /* Add droppedLinksCount as a tag */ + if (span.droppedLinksCount) { + tags.push({ + key: 'otel.dropped_links_count', + value: toTagValue(span.droppedLinksCount), + }); + } + const spanTags: ThriftTag[] = ThriftUtils.getThriftTags(tags); const logs = span.events.map((event): Log => { @@ -96,6 +120,12 @@ export function spanToThrift(span: ReadableSpan): ThriftSpan { fields.push({ key: attr, value: toTagValue(attrs[attr]) }) ); } + if (event.droppedAttributesCount) { + fields.push({ + key: 'otel.event.dropped_attributes_count', + value: event.droppedAttributesCount, + }); + } return { timestamp: hrTimeToMilliseconds(event.time), fields }; }); const spanLogs: ThriftLog[] = ThriftUtils.getThriftLogs(logs); diff --git a/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts b/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts index 7a6130322b..bcfdbf051f 100644 --- a/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts +++ b/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts @@ -53,6 +53,9 @@ describe('JaegerExporter', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; describe('constructor', () => { afterEach(() => { diff --git a/packages/opentelemetry-exporter-jaeger/test/transform.test.ts b/packages/opentelemetry-exporter-jaeger/test/transform.test.ts index 5b9de96aa5..35a11c7ffd 100644 --- a/packages/opentelemetry-exporter-jaeger/test/transform.test.ts +++ b/packages/opentelemetry-exporter-jaeger/test/transform.test.ts @@ -82,6 +82,9 @@ describe('transform', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const thriftSpan = spanToThrift(readableSpan); @@ -179,6 +182,9 @@ describe('transform', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const thriftSpan = spanToThrift(readableSpan); @@ -246,6 +252,9 @@ describe('transform', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const thriftSpan = spanToThrift(readableSpan); @@ -291,6 +300,9 @@ describe('transform', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const thriftSpan = spanToThrift(readableSpan); @@ -353,6 +365,9 @@ describe('transform', () => { name: 'default', version: '0.0.1', }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; let thriftSpan = spanToThrift(readableSpan); assert.strictEqual( diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 76a0bbc4d7..985740542c 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/exporter-zipkin", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Zipkin Exporter allows the user to send collected traces to Zipkin.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -91,10 +91,10 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-zipkin", "sideEffects": false diff --git a/packages/opentelemetry-exporter-zipkin/src/transform.ts b/packages/opentelemetry-exporter-zipkin/src/transform.ts index c3c1887616..94983057f6 100644 --- a/packages/opentelemetry-exporter-zipkin/src/transform.ts +++ b/packages/opentelemetry-exporter-zipkin/src/transform.ts @@ -18,7 +18,6 @@ import * as api from '@opentelemetry/api'; import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base'; import { hrTimeToMicroseconds } from '@opentelemetry/core'; import * as zipkinTypes from './types'; -import { IResource } from '@opentelemetry/resources'; const ZIPKIN_SPAN_KIND_MAPPING = { [api.SpanKind.CLIENT]: zipkinTypes.SpanKind.CLIENT, @@ -51,13 +50,7 @@ export function toZipkinSpan( timestamp: hrTimeToMicroseconds(span.startTime), duration: hrTimeToMicroseconds(span.duration), localEndpoint: { serviceName }, - tags: _toZipkinTags( - span.attributes, - span.status, - statusCodeTagName, - statusErrorTagName, - span.resource - ), + tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName), annotations: span.events.length ? _toZipkinAnnotations(span.events) : undefined, @@ -66,13 +59,18 @@ export function toZipkinSpan( return zipkinSpan; } -/** Converts OpenTelemetry SpanAttributes and SpanStatus to Zipkin Tags format. */ +/** Converts OpenTelemetry Span properties to Zipkin Tags format. */ export function _toZipkinTags( - attributes: api.SpanAttributes, - status: api.SpanStatus, + { + attributes, + resource, + status, + droppedAttributesCount, + droppedEventsCount, + droppedLinksCount, + }: ReadableSpan, statusCodeTagName: string, - statusErrorTagName: string, - resource: IResource + statusErrorTagName: string ): zipkinTypes.Tags { const tags: { [key: string]: string } = {}; for (const key of Object.keys(attributes)) { @@ -84,6 +82,20 @@ export function _toZipkinTags( if (status.code === api.SpanStatusCode.ERROR && status.message) { tags[statusErrorTagName] = status.message; } + /* Add droppedAttributesCount as a tag */ + if (droppedAttributesCount) { + tags['otel.dropped_attributes_count'] = String(droppedAttributesCount); + } + + /* Add droppedEventsCount as a tag */ + if (droppedEventsCount) { + tags['otel.dropped_events_count'] = String(droppedEventsCount); + } + + /* Add droppedLinksCount as a tag */ + if (droppedLinksCount) { + tags['otel.dropped_links_count'] = String(droppedLinksCount); + } Object.keys(resource.attributes).forEach( name => (tags[name] = String(resource.attributes[name])) diff --git a/packages/opentelemetry-exporter-zipkin/test/common/transform.test.ts b/packages/opentelemetry-exporter-zipkin/test/common/transform.test.ts index 3c7b5a5ddb..65a06922af 100644 --- a/packages/opentelemetry-exporter-zipkin/test/common/transform.test.ts +++ b/packages/opentelemetry-exporter-zipkin/test/common/transform.test.ts @@ -36,6 +36,9 @@ const tracer = new BasicTracerProvider({ resource: Resource.default().merge( new Resource({ [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + cost: '112.12', + service: 'ui', + version: '1', }) ), }).getTracer('default'); @@ -50,13 +53,6 @@ const spanContext: api.SpanContext = { traceFlags: api.TraceFlags.SAMPLED, }; -const DUMMY_RESOURCE = new Resource({ - service: 'ui', - version: 1, - cost: 112.12, - [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', -}); - describe('transform', () => { describe('toZipkinSpan', () => { it('should convert an OpenTelemetry span to a Zipkin span', () => { @@ -102,6 +98,9 @@ describe('transform', () => { key1: 'value1', key2: 'value2', [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + cost: '112.12', + service: 'ui', + version: '1', 'telemetry.sdk.language': language, 'telemetry.sdk.name': 'opentelemetry', 'telemetry.sdk.version': VERSION, @@ -140,6 +139,9 @@ describe('transform', () => { parentId: undefined, tags: { [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + cost: '112.12', + service: 'ui', + version: '1', 'telemetry.sdk.language': language, 'telemetry.sdk.name': 'opentelemetry', 'telemetry.sdk.version': VERSION, @@ -188,6 +190,9 @@ describe('transform', () => { parentId: undefined, tags: { [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + cost: '112.12', + service: 'ui', + version: '1', 'telemetry.sdk.language': language, 'telemetry.sdk.name': 'opentelemetry', 'telemetry.sdk.version': VERSION, @@ -214,20 +219,21 @@ describe('transform', () => { key2: 'value2', }); const tags: zipkinTypes.Tags = _toZipkinTags( - span.attributes, - span.status, + span, defaultStatusCodeTagName, - defaultStatusErrorTagName, - DUMMY_RESOURCE + defaultStatusErrorTagName ); assert.deepStrictEqual(tags, { key1: 'value1', key2: 'value2', + [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + 'telemetry.sdk.language': language, + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': VERSION, cost: '112.12', service: 'ui', version: '1', - [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', }); }); it('should map OpenTelemetry SpanStatus.code to a Zipkin tag', () => { @@ -248,15 +254,9 @@ describe('transform', () => { key2: 'value2', }); const tags: zipkinTypes.Tags = _toZipkinTags( - span.attributes, - span.status, + span, defaultStatusCodeTagName, - defaultStatusErrorTagName, - Resource.empty().merge( - new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', - }) - ) + defaultStatusErrorTagName ); assert.deepStrictEqual(tags, { @@ -264,6 +264,12 @@ describe('transform', () => { key2: 'value2', [defaultStatusCodeTagName]: 'ERROR', [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + 'telemetry.sdk.language': language, + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': VERSION, + cost: '112.12', + service: 'ui', + version: '1', }); }); it('should map OpenTelemetry SpanStatus.message to a Zipkin tag', () => { @@ -285,15 +291,9 @@ describe('transform', () => { key2: 'value2', }); const tags: zipkinTypes.Tags = _toZipkinTags( - span.attributes, - span.status, + span, defaultStatusCodeTagName, - defaultStatusErrorTagName, - Resource.empty().merge( - new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', - }) - ) + defaultStatusErrorTagName ); assert.deepStrictEqual(tags, { @@ -302,6 +302,12 @@ describe('transform', () => { [defaultStatusCodeTagName]: 'ERROR', [defaultStatusErrorTagName]: status.message, [SemanticResourceAttributes.SERVICE_NAME]: 'zipkin-test', + 'telemetry.sdk.language': language, + 'telemetry.sdk.name': 'opentelemetry', + 'telemetry.sdk.version': VERSION, + cost: '112.12', + service: 'ui', + version: '1', }); }); }); diff --git a/packages/opentelemetry-exporter-zipkin/test/helper.ts b/packages/opentelemetry-exporter-zipkin/test/helper.ts index 3cfd694e2b..bd4d300a1e 100644 --- a/packages/opentelemetry-exporter-zipkin/test/helper.ts +++ b/packages/opentelemetry-exporter-zipkin/test/helper.ts @@ -45,6 +45,9 @@ export const mockedReadableSpan: ReadableSpan = { cost: 112.12, }), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; export function ensureHeadersContain( diff --git a/packages/opentelemetry-exporter-zipkin/test/node/zipkin.test.ts b/packages/opentelemetry-exporter-zipkin/test/node/zipkin.test.ts index d1aa4e8888..eeab75348e 100644 --- a/packages/opentelemetry-exporter-zipkin/test/node/zipkin.test.ts +++ b/packages/opentelemetry-exporter-zipkin/test/node/zipkin.test.ts @@ -56,6 +56,9 @@ function getReadableSpan() { events: [], resource: Resource.empty(), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; return readableSpan; } @@ -164,6 +167,9 @@ describe('Zipkin Exporter - node', () => { ], resource: Resource.empty(), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const span2: ReadableSpan = { name: 'my-span', @@ -187,6 +193,9 @@ describe('Zipkin Exporter - node', () => { events: [], resource: Resource.empty(), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const exporter = new ZipkinExporter({ @@ -379,6 +388,9 @@ describe('Zipkin Exporter - node', () => { [SemanticResourceAttributes.SERVICE_NAME]: resource_service_name, }), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const span2: ReadableSpan = { name: 'my-span', @@ -402,6 +414,9 @@ describe('Zipkin Exporter - node', () => { [SemanticResourceAttributes.SERVICE_NAME]: resource_service_name_prime, }), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const exporter = new ZipkinExporter({}); @@ -467,6 +482,9 @@ describe('Zipkin Exporter - node', () => { ], resource: Resource.empty(), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const span2: ReadableSpan = { name: 'my-span', @@ -490,6 +508,9 @@ describe('Zipkin Exporter - node', () => { events: [], resource: Resource.empty(), instrumentationLibrary: { name: 'default', version: '0.0.1' }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, }; const exporter = new ZipkinExporter({}); diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index f9d3cad28d..20ab69f853 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-b3", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry B3 propagator provides context propagation for systems that are using the B3 header format", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -51,7 +51,7 @@ "access": "public" }, "dependencies": { - "@opentelemetry/core": "1.9.1" + "@opentelemetry/core": "1.10.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.5.0" diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index 32bc7760cf..f7cf51fa79 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagator-jaeger", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Jaeger propagator provides HTTP header propagation for systems that are using Jaeger HTTP header format.", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -80,7 +80,7 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1" + "@opentelemetry/core": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-propagator-jaeger", "sideEffects": false diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index 35dca15ecd..d23d8420e0 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resources", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry SDK resources", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -90,8 +90,8 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources", "sideEffects": false diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index a76944c137..966f44a5f0 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-base", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Tracing", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -92,9 +92,9 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base", "sideEffects": false diff --git a/packages/opentelemetry-sdk-trace-base/src/Span.ts b/packages/opentelemetry-sdk-trace-base/src/Span.ts index fb2b717d48..0f742855d1 100644 --- a/packages/opentelemetry-sdk-trace-base/src/Span.ts +++ b/packages/opentelemetry-sdk-trace-base/src/Span.ts @@ -66,6 +66,11 @@ export class Span implements APISpan, ReadableSpan { readonly startTime: HrTime; readonly resource: IResource; readonly instrumentationLibrary: InstrumentationLibrary; + + private _droppedAttributesCount = 0; + private _droppedEventsCount: number = 0; + private _droppedLinksCount: number = 0; + name: string; status: SpanStatus = { code: SpanStatusCode.UNSET, @@ -141,6 +146,7 @@ export class Span implements APISpan, ReadableSpan { this._spanLimits.attributeCountLimit! && !Object.prototype.hasOwnProperty.call(this.attributes, key) ) { + this._droppedAttributesCount++; return this; } this.attributes[key] = this._truncateToSize(value); @@ -169,11 +175,13 @@ export class Span implements APISpan, ReadableSpan { if (this._isSpanEnded()) return this; if (this._spanLimits.eventCountLimit === 0) { diag.warn('No events allowed.'); + this._droppedEventsCount++; return this; } if (this.events.length >= this._spanLimits.eventCountLimit!) { diag.warn('Dropping extra events.'); this.events.shift(); + this._droppedEventsCount++; } if (isTimeInput(attributesOrStartTime)) { @@ -184,10 +192,12 @@ export class Span implements APISpan, ReadableSpan { } const attributes = sanitizeAttributes(attributesOrStartTime); + this.events.push({ name, attributes, time: this._getTime(timeStamp), + droppedAttributesCount: 0, }); return this; } @@ -298,6 +308,18 @@ export class Span implements APISpan, ReadableSpan { return this._ended; } + get droppedAttributesCount(): number { + return this._droppedAttributesCount; + } + + get droppedEventsCount(): number { + return this._droppedEventsCount; + } + + get droppedLinksCount(): number { + return this._droppedLinksCount; + } + private _isSpanEnded(): boolean { if (this._ended) { diag.warn( diff --git a/packages/opentelemetry-sdk-trace-base/src/TimedEvent.ts b/packages/opentelemetry-sdk-trace-base/src/TimedEvent.ts index 93cb9b47f3..1f835ba710 100644 --- a/packages/opentelemetry-sdk-trace-base/src/TimedEvent.ts +++ b/packages/opentelemetry-sdk-trace-base/src/TimedEvent.ts @@ -26,4 +26,6 @@ export interface TimedEvent { name: string; /** The attributes of the event. */ attributes?: SpanAttributes; + /** Count of attributes of the event that were dropped due to collection limits */ + droppedAttributesCount?: number; } diff --git a/packages/opentelemetry-sdk-trace-base/src/config.ts b/packages/opentelemetry-sdk-trace-base/src/config.ts index 18753ea70e..3448b793da 100644 --- a/packages/opentelemetry-sdk-trace-base/src/config.ts +++ b/packages/opentelemetry-sdk-trace-base/src/config.ts @@ -49,6 +49,10 @@ export function loadDefaultConfig() { attributeCountLimit: getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, linkCountLimit: getEnv().OTEL_SPAN_LINK_COUNT_LIMIT, eventCountLimit: getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT, + attributePerEventCountLimit: + getEnv().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + attributePerLinkCountLimit: + getEnv().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, }, }; } diff --git a/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts b/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts index aa19891099..20ffea4c56 100644 --- a/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts +++ b/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts @@ -41,4 +41,7 @@ export interface ReadableSpan { readonly ended: boolean; readonly resource: IResource; readonly instrumentationLibrary: InstrumentationLibrary; + readonly droppedAttributesCount: number; + readonly droppedEventsCount: number; + readonly droppedLinksCount: number; } diff --git a/packages/opentelemetry-sdk-trace-base/src/types.ts b/packages/opentelemetry-sdk-trace-base/src/types.ts index 6854f0315a..99eeedbe81 100644 --- a/packages/opentelemetry-sdk-trace-base/src/types.ts +++ b/packages/opentelemetry-sdk-trace-base/src/types.ts @@ -81,6 +81,10 @@ export interface SpanLimits { linkCountLimit?: number; /** eventCountLimit is number of message events per span */ eventCountLimit?: number; + /** attributePerEventCountLimit is the maximum number of attributes allowed per span event */ + attributePerEventCountLimit?: number; + /** attributePerLinkCountLimit is the maximum number of attributes allowed per span link */ + attributePerLinkCountLimit?: number; } /** Interface configuration for a buffer. */ diff --git a/packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts b/packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts index d7a900cf9f..7a0483ffa9 100644 --- a/packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts +++ b/packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts @@ -179,6 +179,8 @@ describe('BasicTracerProvider', () => { attributeCountLimit: 128, eventCountLimit: 128, linkCountLimit: 128, + attributePerEventCountLimit: 128, + attributePerLinkCountLimit: 128, }); }); }); diff --git a/packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts b/packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts index dac8728138..11a94ffc7c 100644 --- a/packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts +++ b/packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts @@ -312,6 +312,10 @@ describe('Span', () => { assert.strictEqual(span.attributes['foo99'], 'bar99'); assert.strictEqual(span.attributes['foo149'], undefined); }); + + it('should store the count of dropped attributes in droppedAttributesCount', () => { + assert.strictEqual(span.droppedAttributesCount, 50); + }); }); describe('when "attributeValueLengthLimit" option defined', () => { @@ -791,6 +795,22 @@ describe('Span', () => { assert.strictEqual(span.events[span.events.length - 1].name, 'sent149'); }); + it('should store the count of dropped events in droppedEventsCount', () => { + const span = new Span( + tracer, + ROOT_CONTEXT, + name, + spanContext, + SpanKind.CLIENT + ); + for (let i = 0; i < 150; i++) { + span.addEvent('sent' + i); + } + span.end(); + + assert.strictEqual(span.droppedEventsCount, 50); + }); + it('should add no event', () => { const tracer = new BasicTracerProvider({ spanLimits: { diff --git a/packages/opentelemetry-sdk-trace-node/package.json b/packages/opentelemetry-sdk-trace-node/package.json index 53a01967b3..3e38d76916 100644 --- a/packages/opentelemetry-sdk-trace-node/package.json +++ b/packages/opentelemetry-sdk-trace-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-node", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Node SDK provides automatic telemetry (tracing, metrics, etc) for Node.js applications", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -46,8 +46,8 @@ }, "devDependencies": { "@opentelemetry/api": ">=1.0.0 <1.5.0", - "@opentelemetry/resources": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1", + "@opentelemetry/resources": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "@types/semver": "7.3.9", @@ -64,11 +64,11 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/context-async-hooks": "1.9.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/propagator-jaeger": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/context-async-hooks": "1.10.0", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/propagator-jaeger": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "semver": "^7.3.5" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node", diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index 285ac03779..5513dce644 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-trace-web", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry Web Tracer", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -57,9 +57,9 @@ "devDependencies": { "@babel/core": "7.16.0", "@opentelemetry/api": ">=1.0.0 <1.5.0", - "@opentelemetry/context-zone": "1.9.1", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/resources": "1.9.1", + "@opentelemetry/context-zone": "1.10.0", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/resources": "1.10.0", "@types/jquery": "3.5.8", "@types/mocha": "10.0.0", "@types/node": "18.6.5", @@ -91,9 +91,9 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1" + "@opentelemetry/core": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web", "sideEffects": false diff --git a/packages/opentelemetry-sdk-trace-web/src/utils.ts b/packages/opentelemetry-sdk-trace-web/src/utils.ts index 30031e0623..e8abd29274 100644 --- a/packages/opentelemetry-sdk-trace-web/src/utils.ts +++ b/packages/opentelemetry-sdk-trace-web/src/utils.ts @@ -44,7 +44,10 @@ function getUrlNormalizingAnchor(): HTMLAnchorElement { * @param key */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -export function hasKey(obj: O, key: keyof any): key is keyof O { +export function hasKey( + obj: O, + key: keyof any +): key is keyof O { return key in obj; } diff --git a/packages/opentelemetry-semantic-conventions/package.json b/packages/opentelemetry-semantic-conventions/package.json index 7887147efc..68659c34be 100644 --- a/packages/opentelemetry-semantic-conventions/package.json +++ b/packages/opentelemetry-semantic-conventions/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/semantic-conventions", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry semantic conventions", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/packages/opentelemetry-shim-opentracing/package.json b/packages/opentelemetry-shim-opentracing/package.json index 1262559717..4a4c62d21a 100644 --- a/packages/opentelemetry-shim-opentracing/package.json +++ b/packages/opentelemetry-shim-opentracing/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/shim-opentracing", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTracing to OpenTelemetry shim", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -43,9 +43,9 @@ }, "devDependencies": { "@opentelemetry/api": ">=1.0.0 <1.5.0", - "@opentelemetry/propagator-b3": "1.9.1", - "@opentelemetry/propagator-jaeger": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", + "@opentelemetry/propagator-b3": "1.10.0", + "@opentelemetry/propagator-jaeger": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", "@types/mocha": "10.0.0", "@types/node": "18.6.5", "codecov": "3.8.3", @@ -59,8 +59,8 @@ "@opentelemetry/api": ">=1.0.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/semantic-conventions": "1.9.1", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/semantic-conventions": "1.10.0", "opentracing": "^0.14.4" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-shim-opentracing", diff --git a/packages/sdk-metrics/package.json b/packages/sdk-metrics/package.json index bcd67dfb2a..d22d39ee7b 100644 --- a/packages/sdk-metrics/package.json +++ b/packages/sdk-metrics/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/sdk-metrics", - "version": "1.9.1", + "version": "1.10.0", "description": "OpenTelemetry metrics SDK", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -77,8 +77,8 @@ "@opentelemetry/api": ">=1.3.0 <1.5.0" }, "dependencies": { - "@opentelemetry/core": "1.9.1", - "@opentelemetry/resources": "1.9.1", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/resources": "1.10.0", "lodash.merge": "4.6.2" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics", diff --git a/packages/sdk-metrics/src/view/InstrumentSelector.ts b/packages/sdk-metrics/src/view/InstrumentSelector.ts index e7bec3a44a..9b8006267f 100644 --- a/packages/sdk-metrics/src/view/InstrumentSelector.ts +++ b/packages/sdk-metrics/src/view/InstrumentSelector.ts @@ -15,20 +15,23 @@ */ import { InstrumentType } from '../InstrumentDescriptor'; -import { PatternPredicate, Predicate } from './Predicate'; +import { ExactPredicate, PatternPredicate, Predicate } from './Predicate'; export interface InstrumentSelectorCriteria { name?: string; type?: InstrumentType; + unit?: string; } export class InstrumentSelector { private _nameFilter: Predicate; private _type?: InstrumentType; + private _unitFilter: Predicate; constructor(criteria?: InstrumentSelectorCriteria) { this._nameFilter = new PatternPredicate(criteria?.name ?? '*'); this._type = criteria?.type; + this._unitFilter = new ExactPredicate(criteria?.unit); } getType() { @@ -38,4 +41,8 @@ export class InstrumentSelector { getNameFilter() { return this._nameFilter; } + + getUnitFilter() { + return this._unitFilter; + } } diff --git a/packages/sdk-metrics/src/view/RegistrationConflicts.ts b/packages/sdk-metrics/src/view/RegistrationConflicts.ts index e74add7334..dbb8073c8b 100644 --- a/packages/sdk-metrics/src/view/RegistrationConflicts.ts +++ b/packages/sdk-metrics/src/view/RegistrationConflicts.ts @@ -59,6 +59,7 @@ export function getTypeConflictResolutionRecipe( const selector: InstrumentSelectorCriteria = { name: otherDescriptor.name, type: otherDescriptor.type, + unit: otherDescriptor.unit, }; const selectorString = JSON.stringify(selector); @@ -73,6 +74,7 @@ export function getDescriptionResolutionRecipe( const selector: InstrumentSelectorCriteria = { name: otherDescriptor.name, type: otherDescriptor.type, + unit: otherDescriptor.unit, }; const selectorString = JSON.stringify(selector); diff --git a/packages/sdk-metrics/src/view/View.ts b/packages/sdk-metrics/src/view/View.ts index 398f936536..1e8d4fb0e0 100644 --- a/packages/sdk-metrics/src/view/View.ts +++ b/packages/sdk-metrics/src/view/View.ts @@ -83,6 +83,14 @@ export type ViewOptions = { * instrumentName: 'my.instruments.requests' */ instrumentName?: string; + /** + * Instrument selection criteria: + * The unit of the Instrument(s). + * + * @example select all instruments with unit 'ms' + * instrumentUnit: 'ms' + */ + instrumentUnit?: string; /** * Instrument selection criteria: * The name of the Meter. No wildcard support, name must match the meter exactly. @@ -113,6 +121,7 @@ function isSelectorNotProvided(options: ViewOptions): boolean { return ( options.instrumentName == null && options.instrumentType == null && + options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null @@ -161,6 +170,9 @@ export class View { * @param viewOptions.instrumentType * Instrument selection criteria: * The original type of the Instrument(s). + * @param viewOptions.instrumentUnit + * Instrument selection criteria: + * The unit of the Instrument(s). * @param viewOptions.meterName * Instrument selection criteria: * The name of the Meter. No wildcard support, name must match the meter exactly. @@ -213,6 +225,7 @@ export class View { this.instrumentSelector = new InstrumentSelector({ name: viewOptions.instrumentName, type: viewOptions.instrumentType, + unit: viewOptions.instrumentUnit, }); this.meterSelector = new MeterSelector({ name: viewOptions.meterName, diff --git a/packages/sdk-metrics/src/view/ViewRegistry.ts b/packages/sdk-metrics/src/view/ViewRegistry.ts index 265f699bf9..5f4f367e92 100644 --- a/packages/sdk-metrics/src/view/ViewRegistry.ts +++ b/packages/sdk-metrics/src/view/ViewRegistry.ts @@ -48,7 +48,8 @@ export class ViewRegistry { return ( (selector.getType() === undefined || instrument.type === selector.getType()) && - selector.getNameFilter().match(instrument.name) + selector.getNameFilter().match(instrument.name) && + selector.getUnitFilter().match(instrument.unit) ); } diff --git a/packages/sdk-metrics/test/MeterProvider.test.ts b/packages/sdk-metrics/test/MeterProvider.test.ts index 48055695ed..a9f8361b81 100644 --- a/packages/sdk-metrics/test/MeterProvider.test.ts +++ b/packages/sdk-metrics/test/MeterProvider.test.ts @@ -15,7 +15,13 @@ */ import * as assert from 'assert'; -import { MeterProvider, InstrumentType, DataPointType } from '../src'; +import { + MeterProvider, + InstrumentType, + DataPointType, + ExplicitBucketHistogramAggregation, + HistogramMetricData, +} from '../src'; import { assertScopeMetrics, assertMetricData, @@ -463,6 +469,70 @@ describe('MeterProvider', () => { } ); }); + + it('with instrument unit should apply view to only the selected instrument unit', async () => { + // Add views with different boundaries for each unit. + const msBoundaries = [0, 1, 2, 3, 4, 5]; + const sBoundaries = [10, 50, 250, 1000]; + + const meterProvider = new MeterProvider({ + resource: defaultResource, + views: [ + new View({ + instrumentUnit: 'ms', + aggregation: new ExplicitBucketHistogramAggregation(msBoundaries), + }), + new View({ + instrumentUnit: 's', + aggregation: new ExplicitBucketHistogramAggregation(sBoundaries), + }), + ], + }); + + const reader = new TestMetricReader(); + meterProvider.addMetricReader(reader); + + // Create meter and histograms, with different units. + const meter = meterProvider.getMeter('meter1', 'v1.0.0'); + const histogram1 = meter.createHistogram('test-histogram-ms', { + unit: 'ms', + }); + const histogram2 = meter.createHistogram('test-histogram-s', { + unit: 's', + }); + + // Record values for both. + histogram1.record(1); + histogram2.record(1); + + // Perform collection. + const { resourceMetrics, errors } = await reader.collect(); + + assert.strictEqual(errors.length, 0); + // Results came only from one Meter + assert.strictEqual(resourceMetrics.scopeMetrics.length, 1); + + // InstrumentationScope matches the only created Meter. + assertScopeMetrics(resourceMetrics.scopeMetrics[0], { + name: 'meter1', + version: 'v1.0.0', + }); + + // Two metrics are collected ('test-histogram-ms' and 'test-histogram-s') + assert.strictEqual(resourceMetrics.scopeMetrics[0].metrics.length, 2); + + // Check if the boundaries are applied to the correct instrument. + assert.deepStrictEqual( + (resourceMetrics.scopeMetrics[0].metrics[0] as HistogramMetricData) + .dataPoints[0].value.buckets.boundaries, + msBoundaries + ); + assert.deepStrictEqual( + (resourceMetrics.scopeMetrics[0].metrics[1] as HistogramMetricData) + .dataPoints[0].value.buckets.boundaries, + sBoundaries + ); + }); }); describe('shutdown', () => { diff --git a/packages/sdk-metrics/test/view/ViewRegistry.test.ts b/packages/sdk-metrics/test/view/ViewRegistry.test.ts index aea2ebe3cf..b766c0fda5 100644 --- a/packages/sdk-metrics/test/view/ViewRegistry.test.ts +++ b/packages/sdk-metrics/test/view/ViewRegistry.test.ts @@ -101,6 +101,50 @@ describe('ViewRegistry', () => { assert.strictEqual(views[0].name, 'histogram'); } }); + + it('should match view with instrument unit', () => { + const registry = new ViewRegistry(); + registry.addView( + new View({ + name: 'ms_view', + instrumentName: 'default_metric', + instrumentUnit: 'ms', + }) + ); + registry.addView( + new View({ + name: 's_view', + instrumentName: 'default_metric', + instrumentUnit: 's', + }) + ); + + { + const views = registry.findViews( + { + ...defaultInstrumentDescriptor, + unit: 'ms', + }, + defaultInstrumentationScope + ); + + assert.strictEqual(views.length, 1); + assert.strictEqual(views[0].name, 'ms_view'); + } + + { + const views = registry.findViews( + { + ...defaultInstrumentDescriptor, + unit: 's', + }, + defaultInstrumentationScope + ); + + assert.strictEqual(views.length, 1); + assert.strictEqual(views[0].name, 's_view'); + } + }); }); describe('MeterSelector', () => { diff --git a/packages/template/package.json b/packages/template/package.json index ff6de03cfb..b9a7a0729d 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/template", - "version": "1.9.1", + "version": "1.10.0", "private": true, "publishConfig": { "access": "restricted" diff --git a/scripts/update-ts-configs.js b/scripts/update-ts-configs.js index 0242a54668..283811997b 100644 --- a/scripts/update-ts-configs.js +++ b/scripts/update-ts-configs.js @@ -50,6 +50,7 @@ const ignoredLernaProjects = [ 'selenium-tests', 'examples/otlp-exporter-node', 'examples/opentelemetry-web', + 'examples/http', 'examples/https', ]; diff --git a/selenium-tests/package.json b/selenium-tests/package.json index f18c070564..93dd972e64 100644 --- a/selenium-tests/package.json +++ b/selenium-tests/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/selenium-tests", - "version": "1.9.1", + "version": "1.10.0", "private": true, "description": "OpenTelemetry Selenium Tests", "main": "index.js", @@ -56,16 +56,16 @@ "@opentelemetry/api": "^1.0.0" }, "dependencies": { - "@opentelemetry/context-zone-peer-dep": "1.9.1", - "@opentelemetry/core": "1.9.1", - "@opentelemetry/exporter-trace-otlp-http": "0.35.1", - "@opentelemetry/exporter-zipkin": "1.9.1", - "@opentelemetry/instrumentation": "0.35.1", - "@opentelemetry/instrumentation-fetch": "0.35.1", - "@opentelemetry/instrumentation-xml-http-request": "0.35.1", - "@opentelemetry/sdk-metrics": "1.9.1", - "@opentelemetry/sdk-trace-base": "1.9.1", - "@opentelemetry/sdk-trace-web": "1.9.1", + "@opentelemetry/context-zone-peer-dep": "1.10.0", + "@opentelemetry/core": "1.10.0", + "@opentelemetry/exporter-trace-otlp-http": "0.36.0", + "@opentelemetry/exporter-zipkin": "1.10.0", + "@opentelemetry/instrumentation": "0.36.0", + "@opentelemetry/instrumentation-fetch": "0.36.0", + "@opentelemetry/instrumentation-xml-http-request": "0.36.0", + "@opentelemetry/sdk-metrics": "1.10.0", + "@opentelemetry/sdk-trace-base": "1.10.0", + "@opentelemetry/sdk-trace-web": "1.10.0", "zone.js": "0.11.4" } }