From ef03d02a8e68953da446f9244779dce5e007f9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Thu, 3 Mar 2022 18:46:47 +0100 Subject: [PATCH 1/5] docs: simplify contrib part in readme (#2814) --- README.md | 73 +++++++++++++++++++------------------------------------ 1 file changed, 25 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index ef5a1fd417c..ea3685d0945 100644 --- a/README.md +++ b/README.md @@ -45,25 +45,25 @@ This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a ## Compatibility Matrix -| API Version | Core version | Experimental Packages | Contrib Version | -| ----------- |--------------| --------------------- |-------------------------| -| 1.0.x | 1.x | 0.26.x | 0.26.x | -| 1.0.x | 0.26.x | ----- | ------ | -| 1.0.x | 0.25.x | ----- | ------ | -| 1.0.x | 0.24.x | ----- | 0.24.x | -| 1.0.x | 0.23.x | ----- | 0.23.x | -| 1.0.x | 0.22.x | ----- | 0.22.x | -| 0.21.x | 0.21.x | ----- | 0.21.x | -| 0.20.x | 0.20.x | ----- | 0.20.x | -| v1.0.0-rc.3 | 0.19.x | ----- | 0.16.x | -| 0.18.x | 0.18.x | ----- | 0.14.x | -| | 0.17.x | ----- | ------ | -| | 0.16.x | ----- | ------ | -| | 0.15.x | ----- | 0.13.x | -| | 0.14.x | ----- | 0.12.x | -| | 0.13.x | ----- | ------ | -| | 0.12.x | ----- | 0.11.x | -| | 0.11.x | ----- | 0.10.x | +| API Version | Core version | Experimental Packages | +| ----------- |--------------| --------------------- | +| 1.0.x | 1.x | 0.26.x | +| 1.0.x | 0.26.x | ----- | +| 1.0.x | 0.25.x | ----- | +| 1.0.x | 0.24.x | ----- | +| 1.0.x | 0.23.x | ----- | +| 1.0.x | 0.22.x | ----- | +| 0.21.x | 0.21.x | ----- | +| 0.20.x | 0.20.x | ----- | +| v1.0.0-rc.3 | 0.19.x | ----- | +| 0.18.x | 0.18.x | ----- | +| | 0.17.x | ----- | +| | 0.16.x | ----- | +| | 0.15.x | ----- | +| | 0.14.x | ----- | +| | 0.13.x | ----- | +| | 0.12.x | ----- | +| | 0.11.x | ----- | ## Versioning @@ -239,7 +239,11 @@ See the [OpenTelemetry registry](https://opentelemetry.io/registry/?language=js& ### Instrumentations -OpenTelemetry can collect tracing data automatically using instrumentations. Vendors/Users can also create and use their own. Currently, OpenTelemetry supports automatic tracing for: +OpenTelemetry can collect tracing data automatically using instrumentations. + +To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, Vendor/Users can [write an instrumentation yourself](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md). + +Currently, OpenTelemetry supports automatic tracing for: #### Node Instrumentations @@ -250,17 +254,7 @@ OpenTelemetry can collect tracing data automatically using instrumentations. Ven ##### Contrib -These plugins are hosted at - -- [@opentelemetry/instrumentation-mongodb][otel-contrib-instrumentation-mongodb] -- [@opentelemetry/instrumentation-mysql][otel-contrib-instrumentation-mysql] -- [@opentelemetry/instrumentation-pg][otel-contrib-instrumentation-pg] -- [@opentelemetry/instrumentation-redis][otel-contrib-instrumentation-redis] -- [@opentelemetry/instrumentation-ioredis][otel-contrib-instrumentation-ioredis] -- [@opentelemetry/instrumentation-express][otel-contrib-instrumentation-express] -- [@opentelemetry/instrumentation-dns][otel-contrib-instrumentation-dns] -- [@opentelemetry/instrumentation-hapi][otel-contrib-instrumentation-hapi] -- [@opentelemetry/instrumentation-koa][otel-contrib-instrumentation-koa] +These instrumentations are hosted at #### Web Instrumentations @@ -273,11 +267,6 @@ These plugins are hosted at -- [@opentelemetry/instrumentation-document-load][otel-contrib-instrumentation-document-load] -- [@opentelemetry/instrumentation-user-interaction][otel-contrib-instrumentation-user-interaction] - -To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, you can [write an instrumentation yourself](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md). - ### Shims | Package | Description | @@ -553,16 +542,4 @@ Apache 2.0 - See [LICENSE][license-url] for more information. [otel-propagator-b3]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-propagator-b3 [generate-api-documentation]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md#generating-api-documentation -[otel-contrib-instrumentation-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-dns -[otel-contrib-instrumentation-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-ioredis -[otel-contrib-instrumentation-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb -[otel-contrib-instrumentation-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql -[otel-contrib-instrumentation-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg -[otel-contrib-instrumentation-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis -[otel-contrib-instrumentation-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express -[otel-contrib-instrumentation-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-user-interaction -[otel-contrib-instrumentation-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-document-load -[otel-contrib-instrumentation-hapi]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-hapi -[otel-contrib-instrumentation-koa]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-koa - [spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md From a901732acab5e7559c19b5da500cd6ede3414ff7 Mon Sep 17 00:00:00 2001 From: Will Li Date: Fri, 4 Mar 2022 23:55:23 +0800 Subject: [PATCH 2/5] feat(opentelemetry-resources): add runtime version information (#2727) --- .../src/detectors/BrowserDetector.ts | 65 +++++++++++++++++++ .../src/detectors/ProcessDetector.ts | 6 +- .../src/detectors/index.ts | 1 + .../src/platform/browser/detect-resources.ts | 33 ++++++++-- .../src/platform/node/detect-resources.ts | 5 +- .../detectors/browser/BrowserDetector.test.ts | 52 +++++++++++++++ .../detectors/node/BrowserDetector.test.ts | 30 +++++++++ .../detectors/node/ProcessDetector.test.ts | 10 ++- .../test/util/resource-assertions.ts | 25 ++++++- 9 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 packages/opentelemetry-resources/src/detectors/BrowserDetector.ts create mode 100644 packages/opentelemetry-resources/test/detectors/browser/BrowserDetector.test.ts create mode 100644 packages/opentelemetry-resources/test/detectors/node/BrowserDetector.test.ts diff --git a/packages/opentelemetry-resources/src/detectors/BrowserDetector.ts b/packages/opentelemetry-resources/src/detectors/BrowserDetector.ts new file mode 100644 index 00000000000..a3568c29584 --- /dev/null +++ b/packages/opentelemetry-resources/src/detectors/BrowserDetector.ts @@ -0,0 +1,65 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { diag } from '@opentelemetry/api'; +import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; +import { Detector, Resource, ResourceDetectionConfig } from '..'; +import { ResourceAttributes } from '../types'; + +/** + * BrowserDetector will be used to detect the resources related to browser. + */ +class BrowserDetector implements Detector { + async detect(config?: ResourceDetectionConfig): Promise { + const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; + if (!isBrowser) { + return Resource.empty(); + } + const browserResource: ResourceAttributes = { + [SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'browser', + [SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', + [SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: window.navigator.userAgent + }; + return this._getResourceAttributes(browserResource, config); + } + /** + * Validates process resource attribute map from process variables + * + * @param browserResource The un-sanitized resource attributes from process as key/value pairs. + * @param config: Config + * @returns The sanitized resource attributes. + */ + private _getResourceAttributes( + browserResource: ResourceAttributes, + _config?: ResourceDetectionConfig + ) { + if ( + browserResource[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '' + ) { + diag.debug( + 'BrowserDetector failed: Unable to find required browser resources. ' + ); + return Resource.empty(); + } else { + return new Resource({ + ...browserResource, + }); + } + } +} + + +export const browserDetector = new BrowserDetector(); diff --git a/packages/opentelemetry-resources/src/detectors/ProcessDetector.ts b/packages/opentelemetry-resources/src/detectors/ProcessDetector.ts index 12e9e296bfa..3c6e03d92c7 100644 --- a/packages/opentelemetry-resources/src/detectors/ProcessDetector.ts +++ b/packages/opentelemetry-resources/src/detectors/ProcessDetector.ts @@ -36,6 +36,9 @@ class ProcessDetector implements Detector { [SemanticResourceAttributes.PROCESS_COMMAND]: process.argv[1] || '', [SemanticResourceAttributes.PROCESS_COMMAND_LINE]: process.argv.join(' ') || '', + [SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: process.versions.node, + [SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'nodejs', + [SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', }; return this._getResourceAttributes(processResource, config); } @@ -56,7 +59,8 @@ class ProcessDetector implements Detector { processResource[SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH] === '' || processResource[SemanticResourceAttributes.PROCESS_COMMAND] === '' || - processResource[SemanticResourceAttributes.PROCESS_COMMAND_LINE] === '' + processResource[SemanticResourceAttributes.PROCESS_COMMAND_LINE] === '' || + processResource[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '' ) { diag.debug( 'ProcessDetector failed: Unable to find required process resources. ' diff --git a/packages/opentelemetry-resources/src/detectors/index.ts b/packages/opentelemetry-resources/src/detectors/index.ts index d88f7412d3c..3a69a099bcd 100644 --- a/packages/opentelemetry-resources/src/detectors/index.ts +++ b/packages/opentelemetry-resources/src/detectors/index.ts @@ -16,3 +16,4 @@ export * from './EnvDetector'; export * from './ProcessDetector'; +export * from './BrowserDetector'; diff --git a/packages/opentelemetry-resources/src/platform/browser/detect-resources.ts b/packages/opentelemetry-resources/src/platform/browser/detect-resources.ts index 3a815e8825b..457965fadfa 100644 --- a/packages/opentelemetry-resources/src/platform/browser/detect-resources.ts +++ b/packages/opentelemetry-resources/src/platform/browser/detect-resources.ts @@ -15,12 +15,35 @@ */ import { Resource } from '../../Resource'; +import { ResourceDetectionConfig } from '../../config'; +import { diag } from '@opentelemetry/api'; /** - * Detects resources for the browser platform, which is currently only the - * telemetry SDK resource. More could be added in the future. This method - * is async to match the signature of corresponding method for node. + * Runs all resource detectors and returns the results merged into a single + * Resource. + * + * @param config Configuration for resource detection */ -export const detectResources = async (): Promise => { - return Resource.empty(); +export const detectResources = async ( + config: ResourceDetectionConfig = {} +): Promise => { + const internalConfig: ResourceDetectionConfig = Object.assign(config); + + const resources: Resource[] = await Promise.all( + (internalConfig.detectors || []).map(async d => { + try { + const resource = await d.detect(internalConfig); + diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + diag.debug(`${d.constructor.name} failed: ${e.message}`); + return Resource.empty(); + } + }) + ); + + return resources.reduce( + (acc, resource) => acc.merge(resource), + Resource.empty() + ); }; diff --git a/packages/opentelemetry-resources/src/platform/node/detect-resources.ts b/packages/opentelemetry-resources/src/platform/node/detect-resources.ts index 74a4d337b2e..35bf32b4cdd 100644 --- a/packages/opentelemetry-resources/src/platform/node/detect-resources.ts +++ b/packages/opentelemetry-resources/src/platform/node/detect-resources.ts @@ -30,7 +30,7 @@ export const detectResources = async ( ): Promise => { const internalConfig: ResourceDetectionConfig = Object.assign(config); - const resources: Array = await Promise.all( + const resources: Resource[] = await Promise.all( (internalConfig.detectors || []).map(async d => { try { const resource = await d.detect(internalConfig); @@ -52,10 +52,11 @@ export const detectResources = async ( ); }; + /** * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. * - * @param resources The array of {@link Resource} that should be logged. Empty entried will be ignored. + * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. */ const logResources = (resources: Array) => { resources.forEach(resource => { diff --git a/packages/opentelemetry-resources/test/detectors/browser/BrowserDetector.test.ts b/packages/opentelemetry-resources/test/detectors/browser/BrowserDetector.test.ts new file mode 100644 index 00000000000..7543d294386 --- /dev/null +++ b/packages/opentelemetry-resources/test/detectors/browser/BrowserDetector.test.ts @@ -0,0 +1,52 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as sinon from 'sinon'; +import { Resource } from '../../../src'; +import { browserDetector } from '../../../src/detectors/BrowserDetector'; +import { describeBrowser } from '../../util'; +import { + assertResource, + assertEmptyResource, +} from '../../util/resource-assertions'; + + +describeBrowser('browserDetector()', () => { + + afterEach(() => { + sinon.restore(); + }); + + it('should return browser information', async () => { + sinon.stub(window, 'navigator').value({ + userAgent: 'dddd', + }); + + const resource: Resource = await browserDetector.detect(); + assertResource(resource, { + version: 'dddd', + runtimeDescription: 'Web Browser', + runtimeName: 'browser', + }); + }); + it('should return empty resources if version is missing', async () => { + sinon.stub(window, 'navigator').value({ + userAgent: '', + }); + const resource: Resource = await browserDetector.detect(); + assertEmptyResource(resource); + }); +}); + diff --git a/packages/opentelemetry-resources/test/detectors/node/BrowserDetector.test.ts b/packages/opentelemetry-resources/test/detectors/node/BrowserDetector.test.ts new file mode 100644 index 00000000000..27d7bdfeffb --- /dev/null +++ b/packages/opentelemetry-resources/test/detectors/node/BrowserDetector.test.ts @@ -0,0 +1,30 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Resource } from '../../../src'; +import { browserDetector } from '../../../src/detectors/BrowserDetector'; +import { describeNode } from '../../util'; +import { + assertEmptyResource, +} from '../../util/resource-assertions'; + + +describeNode('browserDetector()', () => { + it('should return empty resources if window.document is missing', async () => { + const resource: Resource = await browserDetector.detect(); + assertEmptyResource(resource); + }); +}); + diff --git a/packages/opentelemetry-resources/test/detectors/node/ProcessDetector.test.ts b/packages/opentelemetry-resources/test/detectors/node/ProcessDetector.test.ts index a76c728c299..2357c13479f 100644 --- a/packages/opentelemetry-resources/test/detectors/node/ProcessDetector.test.ts +++ b/packages/opentelemetry-resources/test/detectors/node/ProcessDetector.test.ts @@ -16,7 +16,7 @@ import * as sinon from 'sinon'; import { processDetector, Resource } from '../../../src'; import { - assertProcessResource, + assertResource, assertEmptyResource, } from '../../util/resource-assertions'; import { describeNode } from '../../util'; @@ -32,13 +32,19 @@ describeNode('processDetector() on Node.js', () => { sinon .stub(process, 'argv') .value(['/tmp/node', '/home/ot/test.js', 'arg1', 'arg2']); + sinon + .stub(process, 'versions') + .value({'node': '1.4.1'}); const resource: Resource = await processDetector.detect(); - assertProcessResource(resource, { + assertResource(resource, { pid: 1234, name: 'otProcess', command: '/home/ot/test.js', commandLine: '/tmp/node /home/ot/test.js arg1 arg2', + version: '1.4.1', + runtimeDescription: 'Node.js', + runtimeName: 'nodejs', }); }); it('should return empty resources if title, command and commondLine is missing', async () => { diff --git a/packages/opentelemetry-resources/test/util/resource-assertions.ts b/packages/opentelemetry-resources/test/util/resource-assertions.ts index 37fd429d478..32f37e4486c 100644 --- a/packages/opentelemetry-resources/test/util/resource-assertions.ts +++ b/packages/opentelemetry-resources/test/util/resource-assertions.ts @@ -258,18 +258,21 @@ export const assertServiceResource = ( }; /** - * Test utility method to validate a process resources + * Test utility method to validate a process / browser resources * * @param resource the Resource to validate * @param validations validations for the resource attributes */ -export const assertProcessResource = ( +export const assertResource = ( resource: Resource, validations: { pid?: number; name?: string; command?: string; commandLine?: string; + version?: string; + runtimeName?: string; + runtimeDescription?: string; } ) => { assert.strictEqual( @@ -294,6 +297,24 @@ export const assertProcessResource = ( validations.commandLine ); } + if (validations.version) { + assert.strictEqual( + resource.attributes[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION], + validations.version + ); + } + if (validations.runtimeName) { + assert.strictEqual( + resource.attributes[SemanticResourceAttributes.PROCESS_RUNTIME_NAME], + validations.runtimeName + ); + } + if (validations.runtimeDescription) { + assert.strictEqual( + resource.attributes[SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION], + validations.runtimeDescription + ); + } }; export const assertWebEngineResource = (resource: Resource, validations: { From 5b83c1828d57b4120eb95dc8c4790fdca9a33610 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Fri, 4 Mar 2022 17:06:31 +0100 Subject: [PATCH 3/5] feat(views): handle view conflicts. (#2734) --- .../src/InstrumentDescriptor.ts | 9 +- .../src/Meter.ts | 26 +- .../src/state/AsyncMetricStorage.ts | 10 +- .../src/state/MetricStorage.ts | 23 +- .../src/state/MetricStorageRegistry.ts | 91 +++++++ .../src/state/SyncMetricStorage.ts | 10 +- .../src/view/RegistrationConflicts.ts | 91 +++++++ .../test/state/MetricStorageRegistry.test.ts | 256 ++++++++++++++++++ 8 files changed, 493 insertions(+), 23 deletions(-) create mode 100644 experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorageRegistry.ts create mode 100644 experimental/packages/opentelemetry-sdk-metrics-base/src/view/RegistrationConflicts.ts create mode 100644 experimental/packages/opentelemetry-sdk-metrics-base/test/state/MetricStorageRegistry.test.ts diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts index 92ba0f70174..8b4347e3e40 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/InstrumentDescriptor.ts @@ -20,7 +20,7 @@ import { View } from './view/View'; /** * Supported types of metric instruments. */ - export enum InstrumentType { +export enum InstrumentType { COUNTER = 'COUNTER', HISTOGRAM = 'HISTOGRAM', UP_DOWN_COUNTER = 'UP_DOWN_COUNTER', @@ -56,3 +56,10 @@ export function createInstrumentDescriptorWithView(view: View, instrument: Instr valueType: instrument.valueType, }; } + +export function isDescriptorCompatibleWith(descriptor: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor) { + return descriptor.name === otherDescriptor.name + && descriptor.unit === otherDescriptor.unit + && descriptor.type === otherDescriptor.type + && descriptor.valueType === otherDescriptor.valueType; +} diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/Meter.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/Meter.ts index cc4c54545c3..310ead8fff5 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/Meter.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/Meter.ts @@ -21,18 +21,19 @@ import { Counter, Histogram, UpDownCounter } from './Instruments'; import { MeterProviderSharedState } from './state/MeterProviderSharedState'; import { MultiMetricStorage } from './state/MultiWritableMetricStorage'; import { SyncMetricStorage } from './state/SyncMetricStorage'; -import { MetricStorage } from './state/MetricStorage'; import { MetricData } from './export/MetricData'; import { isNotNullish } from './utils'; import { MetricCollectorHandle } from './state/MetricCollector'; import { HrTime } from '@opentelemetry/api'; import { AsyncMetricStorage } from './state/AsyncMetricStorage'; +import { WritableMetricStorage } from './state/WritableMetricStorage'; +import { MetricStorageRegistry } from './state/MetricStorageRegistry'; /** * This class implements the {@link metrics.Meter} interface. */ export class Meter implements metrics.Meter { - private _metricStorageRegistry = new Map(); + private _metricStorageRegistry = new MetricStorageRegistry(); constructor(private _meterProviderSharedState: MeterProviderSharedState, private _instrumentationLibrary: InstrumentationLibrary) { this._meterProviderSharedState.meters.push(this); @@ -101,26 +102,23 @@ export class Meter implements metrics.Meter { this._registerAsyncMetricStorage(descriptor, callback); } - private _registerMetricStorage(descriptor: InstrumentDescriptor) { + private _registerMetricStorage(descriptor: InstrumentDescriptor): WritableMetricStorage { const views = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationLibrary); - const storages = views.map(view => { - const storage = SyncMetricStorage.create(view, descriptor); - // TODO: handle conflicts - this._metricStorageRegistry.set(descriptor.name, storage); - return storage; - }); - if (storages.length === 1) { + const storages = views.map(view => this._metricStorageRegistry.register(SyncMetricStorage.create(view, descriptor))) + .filter(isNotNullish); + + if (storages.length === 1) { return storages[0]; } + + // This will be a no-op WritableMetricStorage when length is null. return new MultiMetricStorage(storages); } private _registerAsyncMetricStorage(descriptor: InstrumentDescriptor, callback: metrics.ObservableCallback) { const views = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationLibrary); views.forEach(view => { - const storage = AsyncMetricStorage.create(view, descriptor, callback); - // TODO: handle conflicts - this._metricStorageRegistry.set(descriptor.name, storage); + this._metricStorageRegistry.register(AsyncMetricStorage.create(view, descriptor, callback)); }); } @@ -131,7 +129,7 @@ export class Meter implements metrics.Meter { * @returns the list of {@link MetricData} collected. */ async collect(collector: MetricCollectorHandle, collectionTime: HrTime): Promise { - const result = await Promise.all(Array.from(this._metricStorageRegistry.values()).map(metricStorage => { + const result = await Promise.all(this._metricStorageRegistry.getStorages().map(metricStorage => { return metricStorage.collect( collector, this._meterProviderSharedState.metricCollectors, diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/AsyncMetricStorage.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/AsyncMetricStorage.ts index d98ececf7fd..a620d75f6d5 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/AsyncMetricStorage.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/AsyncMetricStorage.ts @@ -18,7 +18,10 @@ import { HrTime } from '@opentelemetry/api'; import { ObservableCallback } from '@opentelemetry/api-metrics-wip'; import { Accumulation, Aggregator } from '../aggregator/types'; import { View } from '../view/View'; -import { createInstrumentDescriptorWithView, InstrumentDescriptor } from '../InstrumentDescriptor'; +import { + createInstrumentDescriptorWithView, + InstrumentDescriptor +} from '../InstrumentDescriptor'; import { AttributesProcessor } from '../view/AttributesProcessor'; import { MetricStorage } from './MetricStorage'; import { InstrumentationLibrary } from '@opentelemetry/core'; @@ -36,16 +39,17 @@ import { AttributeHashMap } from './HashMap'; * * Stores and aggregates {@link MetricData} for asynchronous instruments. */ -export class AsyncMetricStorage> implements MetricStorage { +export class AsyncMetricStorage> extends MetricStorage { private _deltaMetricStorage: DeltaMetricProcessor; private _temporalMetricStorage: TemporalMetricProcessor; constructor( - private _instrumentDescriptor: InstrumentDescriptor, + _instrumentDescriptor: InstrumentDescriptor, aggregator: Aggregator, private _attributesProcessor: AttributesProcessor, private _callback: ObservableCallback ) { + super(_instrumentDescriptor); this._deltaMetricStorage = new DeltaMetricProcessor(aggregator); this._temporalMetricStorage = new TemporalMetricProcessor(aggregator); } diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorage.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorage.ts index 7369800bd04..4623ffab079 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorage.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorage.ts @@ -20,20 +20,24 @@ import { Resource } from '@opentelemetry/resources'; import { MetricData } from '../export/MetricData'; import { Maybe } from '../utils'; import { MetricCollectorHandle } from './MetricCollector'; +import { createInstrumentDescriptor, InstrumentDescriptor } from '../InstrumentDescriptor'; /** * Internal interface. * * Represents a storage from which we can collect metrics. */ -export interface MetricStorage { +export abstract class MetricStorage { + constructor(protected _instrumentDescriptor: InstrumentDescriptor) { + } + /** * Collects the metrics from this storage. * * Note: This is a stateful operation and may reset any interval-related * state for the MetricCollector. */ - collect( + abstract collect( collector: MetricCollectorHandle, collectors: MetricCollectorHandle[], resource: Resource, @@ -41,4 +45,19 @@ export interface MetricStorage { sdkStartTime: HrTime, collectionTime: HrTime, ): Promise>; + + getInstrumentDescriptor(): InstrumentDescriptor{ + return this._instrumentDescriptor; + } + + updateDescription(description: string): void{ + this._instrumentDescriptor = createInstrumentDescriptor( + this._instrumentDescriptor.name, + this._instrumentDescriptor.type, + { + description: description, + valueType: this._instrumentDescriptor.valueType, + unit: this._instrumentDescriptor.unit + }); + } } diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorageRegistry.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorageRegistry.ts new file mode 100644 index 00000000000..48171e8efd7 --- /dev/null +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/MetricStorageRegistry.ts @@ -0,0 +1,91 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MetricStorage } from './MetricStorage'; +import { isDescriptorCompatibleWith } from '../InstrumentDescriptor'; +import * as api from '@opentelemetry/api'; +import { Maybe } from '../utils'; +import { getConflictResolutionRecipe, getIncompatibilityDetails } from '../view/RegistrationConflicts'; + +/** + * Internal class for storing {@link MetricStorage} + */ +export class MetricStorageRegistry { + private readonly _metricStorageRegistry = new Map(); + + getStorages(): MetricStorage[] { + let storages: MetricStorage[] = []; + for (const metricStorages of this._metricStorageRegistry.values()) { + storages = storages.concat(metricStorages); + } + + return storages; + } + + register(storage: T): Maybe { + const expectedDescriptor = storage.getInstrumentDescriptor(); + const existingStorages = this._metricStorageRegistry.get(expectedDescriptor.name); + + // Add storage if it does not exist. + if (existingStorages === undefined) { + this._metricStorageRegistry.set(expectedDescriptor.name, [storage]); + return storage; + } + + let compatibleStorage = null; + + for (const existingStorage of existingStorages) { + const existingDescriptor = existingStorage.getInstrumentDescriptor(); + + if (isDescriptorCompatibleWith(existingDescriptor, expectedDescriptor)) { + // Use the longer description if it does not match. + if (existingDescriptor.description !== expectedDescriptor.description) { + if (expectedDescriptor.description.length > existingDescriptor.description.length) { + existingStorage.updateDescription(expectedDescriptor.description); + } + + api.diag.warn('A view or instrument with the name ', + expectedDescriptor.name, + ' has already been registered, but has a different description and is incompatible with another registered view.\n', + 'Details:\n', + getIncompatibilityDetails(existingDescriptor, expectedDescriptor), + 'The longer description will be used.\nTo resolve the conflict:', + getConflictResolutionRecipe(existingDescriptor, expectedDescriptor)); + } + // Storage is fully compatible. There will never be more than one pre-existing fully compatible storage. + compatibleStorage = existingStorage as T; + } else { + // The implementation SHOULD warn about duplicate instrument registration + // conflicts after applying View configuration. + api.diag.warn('A view or instrument with the name ', + expectedDescriptor.name, + ' has already been registered and is incompatible with another registered view.\n', + 'Details:\n', + getIncompatibilityDetails(existingDescriptor, expectedDescriptor), + 'To resolve the conflict:\n', + getConflictResolutionRecipe(existingDescriptor, expectedDescriptor)); + } + } + + if (compatibleStorage != null) { + return compatibleStorage; + } + + // None of the storages were compatible, add the current one to the list. + existingStorages.push(storage); + return storage; + } +} diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/SyncMetricStorage.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/SyncMetricStorage.ts index 609f0fc5858..986448b53ba 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/src/state/SyncMetricStorage.ts +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/state/SyncMetricStorage.ts @@ -19,7 +19,10 @@ import { Attributes } from '@opentelemetry/api-metrics-wip'; import { WritableMetricStorage } from './WritableMetricStorage'; import { Accumulation, Aggregator } from '../aggregator/types'; import { View } from '../view/View'; -import { createInstrumentDescriptorWithView, InstrumentDescriptor } from '../InstrumentDescriptor'; +import { + createInstrumentDescriptorWithView, + InstrumentDescriptor +} from '../InstrumentDescriptor'; import { AttributesProcessor } from '../view/AttributesProcessor'; import { MetricStorage } from './MetricStorage'; import { InstrumentationLibrary } from '@opentelemetry/core'; @@ -35,15 +38,16 @@ import { MetricCollectorHandle } from './MetricCollector'; * * Stores and aggregates {@link MetricData} for synchronous instruments. */ -export class SyncMetricStorage> implements WritableMetricStorage, MetricStorage { +export class SyncMetricStorage> extends MetricStorage implements WritableMetricStorage { private _deltaMetricStorage: DeltaMetricProcessor; private _temporalMetricStorage: TemporalMetricProcessor; constructor( - private _instrumentDescriptor: InstrumentDescriptor, + instrumentDescriptor: InstrumentDescriptor, aggregator: Aggregator, private _attributesProcessor: AttributesProcessor ) { + super(instrumentDescriptor); this._deltaMetricStorage = new DeltaMetricProcessor(aggregator); this._temporalMetricStorage = new TemporalMetricProcessor(aggregator); } diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/src/view/RegistrationConflicts.ts b/experimental/packages/opentelemetry-sdk-metrics-base/src/view/RegistrationConflicts.ts new file mode 100644 index 00000000000..bc0063fe21a --- /dev/null +++ b/experimental/packages/opentelemetry-sdk-metrics-base/src/view/RegistrationConflicts.ts @@ -0,0 +1,91 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { InstrumentSelectorCriteria } from './InstrumentSelector'; +import { InstrumentDescriptor } from '../InstrumentDescriptor'; + +export function getIncompatibilityDetails(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor) { + let incompatibility = ''; + if (existing.unit !== otherDescriptor.unit) { + incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; + } + if (existing.type !== otherDescriptor.type) { + incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; + } + if (existing.valueType !== otherDescriptor.valueType) { + incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; + } + if (existing.description !== otherDescriptor.description) { + incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; + } + + return incompatibility; +} + +export function getValueTypeConflictResolutionRecipe(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor) { + return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; +} + +export function getUnitConflictResolutionRecipe(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor) { + return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; +} + +export function getTypeConflictResolutionRecipe(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor) { + const selector: InstrumentSelectorCriteria = { + name: otherDescriptor.name, + type: otherDescriptor.type + }; + + const selectorString = JSON.stringify(selector); + + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; +} + +export function getDescriptionResolutionRecipe(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor): string { + const selector: InstrumentSelectorCriteria = { + name: otherDescriptor.name, + type: otherDescriptor.type + }; + + const selectorString = JSON.stringify(selector); + + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' + \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} + \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; +} + +export function getConflictResolutionRecipe(existing: InstrumentDescriptor, otherDescriptor: InstrumentDescriptor): string { + // Conflicts that cannot be solved via views. + if (existing.valueType !== otherDescriptor.valueType) { + return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); + } + + if (existing.unit !== otherDescriptor.unit) { + return getUnitConflictResolutionRecipe(existing, otherDescriptor); + } + + // Conflicts that can be solved via views. + if (existing.type !== otherDescriptor.type) { + // this will automatically solve possible description conflicts. + return getTypeConflictResolutionRecipe(existing, otherDescriptor); + } + + if (existing.description !== otherDescriptor.description) { + return getDescriptionResolutionRecipe(existing, otherDescriptor); + } + + return ''; +} diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/test/state/MetricStorageRegistry.test.ts b/experimental/packages/opentelemetry-sdk-metrics-base/test/state/MetricStorageRegistry.test.ts new file mode 100644 index 00000000000..f0ca6e67194 --- /dev/null +++ b/experimental/packages/opentelemetry-sdk-metrics-base/test/state/MetricStorageRegistry.test.ts @@ -0,0 +1,256 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MetricStorageRegistry } from '../../src/state/MetricStorageRegistry'; +import { ValueType } from '@opentelemetry/api-metrics-wip'; +import { MetricStorage } from '../../src/state/MetricStorage'; +import { HrTime } from '@opentelemetry/api'; +import { InstrumentationLibrary } from '@opentelemetry/core'; +import { Resource } from '@opentelemetry/resources'; +import { MetricCollectorHandle } from '../../src/state/MetricCollector'; +import { MetricData, InstrumentDescriptor, InstrumentType } from '../../src'; +import { Maybe } from '../../src/utils'; +import * as api from '@opentelemetry/api'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { + getDescriptionResolutionRecipe, + getTypeConflictResolutionRecipe, getUnitConflictResolutionRecipe, + getValueTypeConflictResolutionRecipe +} from '../../src/view/RegistrationConflicts'; + +class TestMetricStorage extends MetricStorage { + collect(collector: MetricCollectorHandle, + collectors: MetricCollectorHandle[], + resource: Resource, + instrumentationLibrary: InstrumentationLibrary, + sdkStartTime: HrTime, + collectionTime: HrTime, + ): Promise> { + return Promise.resolve(undefined); + } +} + +describe('MetricStorageRegistry', () => { + let spyLoggerWarn: sinon.SinonStub<[message: string, ...args: unknown[]], void>; + + beforeEach(() => { + spyLoggerWarn = sinon.stub(api.diag, 'warn'); + }); + + afterEach(() => { + sinon.restore(); + }); + + describe('register', () => { + it('should register MetricStorage if it does not exist', () => { + const registry = new MetricStorageRegistry(); + const storage = new TestMetricStorage({ + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }); + + const registeredStorage = registry.register(storage); + const registeredStorages = registry.getStorages(); + + // returned the same storage + assert.strictEqual(registeredStorage, storage); + // registered the actual storage + assert.deepStrictEqual([storage], registeredStorages); + // no warning logs written + assert.strictEqual(spyLoggerWarn.args.length, 0); + }); + + function testConflictingRegistration(existingDescriptor: InstrumentDescriptor, + otherDescriptor: InstrumentDescriptor, + expectedLog: string) { + const registry = new MetricStorageRegistry(); + + const storage = new TestMetricStorage(existingDescriptor); + const otherStorage = new TestMetricStorage(otherDescriptor); + + assert.strictEqual(registry.register(storage), storage); + assert.strictEqual(registry.register(otherStorage), otherStorage); + const registeredStorages = registry.getStorages(); + + // registered both storages + assert.deepStrictEqual([storage, otherStorage], registeredStorages); + // warned + assertLogCalledOnce(); + assertFirstLogContains(expectedLog); + } + + it('warn when instrument with same name and different type is already registered', () => { + const existingDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const otherDescriptor = { + name: 'instrument', + type: InstrumentType.UP_DOWN_COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + testConflictingRegistration(existingDescriptor, + otherDescriptor, + getTypeConflictResolutionRecipe(existingDescriptor, otherDescriptor)); + }); + + it('warn when instrument with same name and different value type is already registered', () => { + const existingDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const otherDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.INT + }; + + testConflictingRegistration(existingDescriptor, + otherDescriptor, + getValueTypeConflictResolutionRecipe(existingDescriptor, otherDescriptor)); + }); + + it('warn when instrument with same name and different unit is already registered', () => { + const existingDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const otherDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: 'ms', + valueType: ValueType.DOUBLE + }; + + testConflictingRegistration(existingDescriptor, + otherDescriptor, + getUnitConflictResolutionRecipe(existingDescriptor, otherDescriptor)); + }); + + it('warn when instrument with same name and different description is already registered', () => { + const existingDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const otherDescriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'longer description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const registry = new MetricStorageRegistry(); + + const storage = new TestMetricStorage(existingDescriptor); + const otherStorage = new TestMetricStorage(otherDescriptor); + + // returns the first registered storage. + assert.strictEqual(registry.register(storage), storage); + // returns the original storage + assert.strictEqual(registry.register(otherStorage), storage); + // original storage now has the updated (longer) description. + assert.strictEqual(otherStorage.getInstrumentDescriptor().description, otherDescriptor.description); + + const registeredStorages = registry.getStorages(); + + // only the original storage has been added + assert.deepStrictEqual([storage], registeredStorages); + // log called exactly once + assertLogCalledOnce(); + // added resolution recipe to the log + assertFirstLogContains(getDescriptionResolutionRecipe(existingDescriptor, otherDescriptor)); + }); + + it('should return the existing instrument if a compatible async instrument is already registered', () => { + const registry = new MetricStorageRegistry(); + const descriptor = { + name: 'instrument', + type: InstrumentType.OBSERVABLE_COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const storage = new TestMetricStorage(descriptor); + const otherStorage = new TestMetricStorage(descriptor); + + assert.strictEqual(registry.register(storage), storage); + assert.strictEqual(registry.register(otherStorage), storage); + const registeredStorages = registry.getStorages(); + + // registered the actual storage, but not more than that. + assert.deepStrictEqual([storage], registeredStorages); + }); + + it('should return the existing instrument if a compatible sync instrument is already registered', () => { + const registry = new MetricStorageRegistry(); + const descriptor = { + name: 'instrument', + type: InstrumentType.COUNTER, + description: 'description', + unit: '1', + valueType: ValueType.DOUBLE + }; + + const storage = new TestMetricStorage(descriptor); + const otherStorage = new TestMetricStorage(descriptor); + + registry.register(storage); + const previouslyRegisteredStorage = registry.register(otherStorage); + const registeredStorages = registry.getStorages(); + + // returned undefined + assert.strictEqual(previouslyRegisteredStorage, storage); + // registered the actual storage, but not more than that. + assert.deepStrictEqual([storage], registeredStorages); + }); + + function assertLogCalledOnce() { + assert.strictEqual(spyLoggerWarn.args.length, 1); + } + + function assertFirstLogContains(expectedString: string) { + assert.ok(spyLoggerWarn.args[0].includes(expectedString), 'Logs did not include: ' + expectedString); + } + }); +}); From 13a0e7e46ac1ee5756b86bd4a910525561de6feb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Mar 2022 09:55:49 +0100 Subject: [PATCH 4/5] chore(deps): update dependency karma to v6.3.16 [security] (#2811) Co-authored-by: Valentin Marchaud --- experimental/packages/opentelemetry-api-metrics/package.json | 2 +- .../opentelemetry-exporter-metrics-otlp-http/package.json | 2 +- .../packages/opentelemetry-instrumentation-fetch/package.json | 2 +- .../opentelemetry-instrumentation-xml-http-request/package.json | 2 +- .../packages/opentelemetry-instrumentation/package.json | 2 +- .../packages/opentelemetry-sdk-metrics-base/package.json | 2 +- packages/exporter-trace-otlp-http/package.json | 2 +- packages/opentelemetry-context-zone-peer-dep/package.json | 2 +- packages/opentelemetry-context-zone/package.json | 2 +- packages/opentelemetry-core/package.json | 2 +- packages/opentelemetry-exporter-zipkin/package.json | 2 +- packages/opentelemetry-propagator-jaeger/package.json | 2 +- packages/opentelemetry-resources/package.json | 2 +- packages/opentelemetry-sdk-trace-base/package.json | 2 +- packages/opentelemetry-sdk-trace-web/package.json | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/experimental/packages/opentelemetry-api-metrics/package.json b/experimental/packages/opentelemetry-api-metrics/package.json index eae1a83de51..0f83155dff0 100644 --- a/experimental/packages/opentelemetry-api-metrics/package.json +++ b/experimental/packages/opentelemetry-api-metrics/package.json @@ -69,7 +69,7 @@ "@types/webpack-env": "1.16.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index 495d21ae1a8..d7fcb2fa6c2 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -70,7 +70,7 @@ "codecov": "3.8.3", "cpx": "1.5.0", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index ed3abadff82..715e8cae53a 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -64,7 +64,7 @@ "babel-loader": "8.2.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 8e7c32d1d4c..434171f6426 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -64,7 +64,7 @@ "babel-loader": "8.2.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index ca1b1d39f23..f70dc719da2 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -84,7 +84,7 @@ "codecov": "3.8.3", "cpx": "1.5.0", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/package.json b/experimental/packages/opentelemetry-sdk-metrics-base/package.json index 4d25223b17b..35f62cfb155 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/package.json +++ b/experimental/packages/opentelemetry-sdk-metrics-base/package.json @@ -59,7 +59,7 @@ "@types/node": "14.17.33", "@types/sinon": "10.0.6", "codecov": "3.8.3", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/exporter-trace-otlp-http/package.json b/packages/exporter-trace-otlp-http/package.json index 166db5a4710..173e9af07ab 100644 --- a/packages/exporter-trace-otlp-http/package.json +++ b/packages/exporter-trace-otlp-http/package.json @@ -70,7 +70,7 @@ "codecov": "3.8.3", "cpx": "1.5.0", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index 7f108baa38e..b238d5b783a 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -61,7 +61,7 @@ "babel-loader": "8.2.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-context-zone/package.json b/packages/opentelemetry-context-zone/package.json index 3425a2ba922..571a51d6399 100644 --- a/packages/opentelemetry-context-zone/package.json +++ b/packages/opentelemetry-context-zone/package.json @@ -55,7 +55,7 @@ "@types/webpack-env": "1.16.3", "babel-loader": "8.2.3", "codecov": "3.8.3", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-mocha": "2.0.1", "karma-spec-reporter": "0.0.32", diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 303f4adaaad..ad044537a3b 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -69,7 +69,7 @@ "@types/webpack-env": "1.16.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 0ee6a22fd9b..1198072fcf0 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -67,7 +67,7 @@ "babel-loader": "8.2.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index fcac77437a9..a3f7d16ad69 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -56,7 +56,7 @@ "@types/webpack-env": "1.16.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index 7c7d3c48084..9e74e2f3fb5 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -63,7 +63,7 @@ "@types/sinon": "10.0.6", "@types/webpack-env": "1.16.3", "codecov": "3.8.3", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index c5e3ca7ed20..5c05f00c8ea 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -67,7 +67,7 @@ "@types/webpack-env": "1.16.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index aac861079ed..27f7c58bbe0 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -66,7 +66,7 @@ "babel-loader": "8.2.3", "codecov": "3.8.3", "istanbul-instrumenter-loader": "3.0.1", - "karma": "6.3.14", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jquery": "0.2.4", From a0c1236df421e11a20a93f1ae32ed685acdeedaa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Mar 2022 10:16:05 +0100 Subject: [PATCH 5/5] chore(deps): update dependency nightwatch to v2 (#2795) --- selenium-tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selenium-tests/package.json b/selenium-tests/package.json index 6a0bc718c61..dc406792dda 100644 --- a/selenium-tests/package.json +++ b/selenium-tests/package.json @@ -44,7 +44,7 @@ "dotenv": "16.0.0", "fast-safe-stringify": "2.1.1", "geckodriver": "2.0.4", - "nightwatch": "1.7.12", + "nightwatch": "2.0.10", "selenium-server": "3.141.59", "terser-webpack-plugin": "4.2.3", "webpack": "4.46.0",