diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index de1cf85b4d..45909586a0 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -18,6 +18,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic * [@grpc/proto-loader](#grpcproto-loader) * [@newrelic/security-agent](#newrelicsecurity-agent) * [@opentelemetry/api](#opentelemetryapi) +* [@opentelemetry/semantic-conventions](#opentelemetrysemantic-conventions) * [@tyriar/fibonacci-heap](#tyriarfibonacci-heap) * [concat-stream](#concat-stream) * [https-proxy-agent](#https-proxy-agent) @@ -764,6 +765,215 @@ This product includes source derived from [@opentelemetry/api](https://github.co ``` +### @opentelemetry/semantic-conventions + +This product includes source derived from [@opentelemetry/semantic-conventions](https://github.com/open-telemetry/opentelemetry-js) ([v1.27.0](https://github.com/open-telemetry/opentelemetry-js/tree/v1.27.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v1.27.0/LICENSE): + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. + +``` + ### @tyriar/fibonacci-heap This product includes source derived from [@tyriar/fibonacci-heap](https://github.com/gwtw/ts-fibonacci-heap) ([v2.0.9](https://github.com/gwtw/ts-fibonacci-heap/tree/v2.0.9)), distributed under the [MIT License](https://github.com/gwtw/ts-fibonacci-heap/blob/v2.0.9/LICENSE): @@ -826,7 +1036,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ### https-proxy-agent -This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.5](https://github.com/TooTallNate/proxy-agents/tree/v7.0.5)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.5/LICENSE): +This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.4](https://github.com/TooTallNate/proxy-agents/tree/v7.0.4)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.4/LICENSE): ``` (The MIT License) @@ -1229,7 +1439,7 @@ SOFTWARE. ### semver -This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.6.3](https://github.com/npm/node-semver/tree/v7.6.3)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.6.3/LICENSE): +This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.6.2](https://github.com/npm/node-semver/tree/v7.6.2)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.6.2/LICENSE): ``` The ISC License diff --git a/lib/metrics/recorders/database.js b/lib/metrics/recorders/database.js index 1fbd40c098..c53a1e73d0 100644 --- a/lib/metrics/recorders/database.js +++ b/lib/metrics/recorders/database.js @@ -61,10 +61,10 @@ function recordQueryMetrics(segment, scope, transaction) { if (this.raw) { transaction.agent.queries.add({ - segment, + segment, transaction, - type: this.type.toLowerCase(), - query: this.raw, + type: this.type.toLowerCase(), + query: this.raw, trace: this.trace }) } diff --git a/lib/otel/rules.js b/lib/otel/rules.js index 611db6423f..855435bfad 100644 --- a/lib/otel/rules.js +++ b/lib/otel/rules.js @@ -49,6 +49,7 @@ class Rule { #name #spanKinds #requiredAttributes + #type #mappings /** @@ -63,6 +64,7 @@ class Rule { } this.#name = input.name + this.#type = input.type this.#spanKinds = input.matcher.required_span_kinds?.map((v) => v.toLowerCase()) ?? [] this.#requiredAttributes = input.matcher.required_attribute_keys ?? [] this.#mappings = input.target.attribute_mappings ?? [] @@ -72,6 +74,10 @@ class Rule { return this.#name } + get type() { + return this.#type + } + get isServerRule() { return this.#spanKinds.includes(Rule.OTEL_SPAN_KIND_SERVER) } diff --git a/lib/otel/rules.json b/lib/otel/rules.json index edb176ac38..37ba9ce2a6 100644 --- a/lib/otel/rules.json +++ b/lib/otel/rules.json @@ -229,6 +229,7 @@ }, { "name": "OtelDbClientRedis1_24", + "type": "db", "matcher": { "required_span_kinds": [ "client" @@ -267,6 +268,7 @@ }, { "name": "OtelDbClient1_24", + "type": "db", "matcher": { "required_span_kinds": [ "client" @@ -302,6 +304,7 @@ }, { "name": "OtelHttpClient1_23", + "type": "external", "matcher": { "required_metric_names": [ "http.client.request.duration" @@ -338,6 +341,7 @@ }, { "name": "OtelHttpClient1_20", + "type": "external", "matcher": { "required_metric_names": [ "http.client.duration" @@ -410,6 +414,7 @@ }, { "name": "FallbackClient", + "type": "external", "matcher": { "required_metric_names": [ "rpc.client.duration", diff --git a/lib/otel/segment-synthesis.js b/lib/otel/segment-synthesis.js new file mode 100644 index 0000000000..7441c53b09 --- /dev/null +++ b/lib/otel/segment-synthesis.js @@ -0,0 +1,50 @@ +/* + * Copyright 2024 New Relic Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +'use strict' +const { RulesEngine } = require('./rules') +const defaultLogger = require('../logger').child({ component: 'segment-synthesizer' }) +const NAMES = require('../metrics/names') +const { SEMATTRS_HTTP_HOST } = require('@opentelemetry/semantic-conventions') + +class SegmentSynthesizer { + constructor(agent, { logger = defaultLogger } = {}) { + this.agent = agent + this.logger = logger + this.engine = new RulesEngine() + } + + synthesize(otelSpan) { + const rule = this.engine.test(otelSpan) + if (!rule?.type) { + this.logger.debug( + 'Cannot match a rule to span name: %s, kind %s', + otelSpan?.name, + otelSpan?.kind + ) + return + } + + if (rule?.type === 'external') { + return this.createExternalSegment(otelSpan) + } + this.logger.debug('Found type: %s, no synthesize rule currently built', rule.type) + } + + // TODO: should we move these to somewhere else and use in the places + // where external segments are created in our agent + createExternalSegment(otelSpan) { + const context = this.agent.tracer.getContext() + const host = otelSpan.attributes[SEMATTRS_HTTP_HOST] || 'Unknown' + const name = NAMES.EXTERNAL.PREFIX + host + return this.agent.tracer.createSegment({ + name, + parent: context.segment, + transaction: context.transaction + }) + } +} + +module.exports = SegmentSynthesizer diff --git a/package.json b/package.json index 8ee767c491..c279fc589f 100644 --- a/package.json +++ b/package.json @@ -198,6 +198,7 @@ "@grpc/proto-loader": "^0.7.5", "@newrelic/security-agent": "^2.0.0", "@opentelemetry/api": "^1.9.0", + "@opentelemetry/semantic-conventions": "^1.27.0", "@tyriar/fibonacci-heap": "^2.0.7", "concat-stream": "^2.0.0", "https-proxy-agent": "^7.0.1", diff --git a/test/integration/core/crypto.test.js b/test/integration/core/crypto.test.js index 4363338dc9..2642e83fda 100644 --- a/test/integration/core/crypto.test.js +++ b/test/integration/core/crypto.test.js @@ -26,7 +26,6 @@ test('pbkdf2', function (t, end) { crypto.pbkdf2('hunter2', 'saltine', 5, 32, 'sha1', function (err, key) { assert.ok(!err, 'should not error') assert.equal(key.length, 32) - debugger verifySegments({ agent, end, name: 'crypto.pbkdf2' }) }) }) diff --git a/test/integration/core/fs.test.js b/test/integration/core/fs.test.js index b7a54bae72..cdfbba7fd4 100644 --- a/test/integration/core/fs.test.js +++ b/test/integration/core/fs.test.js @@ -854,7 +854,6 @@ test('read', async function (t) { plan.equal(agent.getTransaction(), trans, 'should preserve transaction') const children = trans.trace.getChildren(trans.trace.root.id) plan.equal(children.length, 0, 'should not create any segments') - }) }) diff --git a/test/integration/core/native-promises.test.js b/test/integration/core/native-promises.test.js index 9e55608406..896b70e0de 100644 --- a/test/integration/core/native-promises.test.js +++ b/test/integration/core/native-promises.test.js @@ -223,7 +223,7 @@ test('AsyncLocalStorage based tracking', async (t) => { helper.runInTransaction(agent, function (txn) { plan.ok(txn, 'transaction should not be null') - const ctx = agent.tracer.getContext() + const ctx = agent.tracer.getContext() agent.tracer.bindFunction(function one() { return new Promise(executor).then(() => { const tx = agent.getTransaction() @@ -273,7 +273,7 @@ test('AsyncLocalStorage based tracking', async (t) => { helper.runInTransaction(agent, function (txn) { plan.ok(txn, 'transaction should not be null') - const ctx = agent.tracer.getContext() + const ctx = agent.tracer.getContext() agent.tracer.bindFunction(function one() { return new Promise(executor).then(() => { const tx = agent.getTransaction() @@ -323,7 +323,7 @@ test('AsyncLocalStorage based tracking', async (t) => { helper.runInTransaction(agent, function (txn) { plan.ok(txn, 'transaction should not be null') - const ctx = agent.tracer.getContext() + const ctx = agent.tracer.getContext() agent.tracer.bindFunction(function one() { return new Promise(executor).then(() => { const tx = agent.getTransaction() @@ -373,7 +373,7 @@ test('AsyncLocalStorage based tracking', async (t) => { helper.runInTransaction(agent, function (txn) { plan.ok(txn, 'transaction should not be null') - const ctx = agent.tracer.getContext() + const ctx = agent.tracer.getContext() agent.tracer.bindFunction(function one() { return new Promise(executor).then(() => { const tx = agent.getTransaction() diff --git a/test/integration/core/net.test.js b/test/integration/core/net.test.js index 27eb99e25e..cb64108707 100644 --- a/test/integration/core/net.test.js +++ b/test/integration/core/net.test.js @@ -143,11 +143,7 @@ test('connect', function connectTest(t, end) { ) assert.ok(timeoutSegment.timer.touched, 'timeout should started and ended') const timeoutChildren = transaction.trace.getChildren(timeoutSegment.id) - assert.equal( - timeoutChildren.length, - 1, - 'timeout should have a single callback segment' - ) + assert.equal(timeoutChildren.length, 1, 'timeout should have a single callback segment') end() } } @@ -199,7 +195,7 @@ test('createServer and connect', function createServerTest(t, end) { clientChildren = transaction.trace.getChildren(clientSegment.id) assert.equal(clientChildren.length, 1, 'clientSegment should only have one child') - const [dnsSegment ] = clientChildren + const [dnsSegment] = clientChildren if (dnsSegment) { assert.equal(dnsSegment.name, 'dns.lookup', 'dnsSegment is named properly') } else { diff --git a/test/integration/transaction/tracer.test.js b/test/integration/transaction/tracer.test.js index e9d0b9d43f..84beaddf65 100644 --- a/test/integration/transaction/tracer.test.js +++ b/test/integration/transaction/tracer.test.js @@ -333,8 +333,6 @@ test('createSegment', async function testCreateSegment(t) { }, outerCtx)() }) - - await plan.completed }) @@ -377,7 +375,6 @@ test('addSegment', async function addSegmentTest(t) { let [child] = transaction.trace.getChildren(root.id) plan.equal(child, segment) - const outside = tracer.addSegment('outside', null, root, false, check) ;[, child] = transaction.trace.getChildren(root.id) diff --git a/test/unit/lib/otel/segment-synthesizer.test.js b/test/unit/lib/otel/segment-synthesizer.test.js new file mode 100644 index 0000000000..edcf1c6eb9 --- /dev/null +++ b/test/unit/lib/otel/segment-synthesizer.test.js @@ -0,0 +1,102 @@ +/* + * Copyright 2024 New Relic Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +'use strict' +const test = require('node:test') +const assert = require('node:assert') + +const helper = require('../../../lib/agent_helper') +const { ROOT_CONTEXT, SpanKind, TraceFlags } = require('@opentelemetry/api') +const { BasicTracerProvider, Span } = require('@opentelemetry/sdk-trace-base') +const SegmentSynthesizer = require('../../../../lib/otel/segment-synthesis') +const { + SEMATTRS_DB_SYSTEM, + SEMATTRS_HTTP_HOST, + SEMATTRS_HTTP_METHOD +} = require('@opentelemetry/semantic-conventions') +const createMockLogger = require('../../mocks/logger') + +test.beforeEach((ctx) => { + const loggerMock = createMockLogger() + const agent = helper.loadMockedAgent() + const synthesizer = new SegmentSynthesizer(agent, { logger: loggerMock }) + const tracer = new BasicTracerProvider().getTracer('default') + const parentId = '5c1c63257de34c67' + ctx.nr = { + agent, + loggerMock, + parentId, + synthesizer, + tracer + } +}) + +test.afterEach((ctx) => { + helper.unloadAgent(ctx.nr.agent) +}) + +test('should create http external segment from otel http client span', (t, end) => { + const { agent, synthesizer, parentId, tracer } = t.nr + helper.runInTransaction(agent, (tx) => { + const spanContext = { + traceId: tx.trace.id, + spanId: tx.trace.root.id, + traceFlags: TraceFlags.SAMPLED + } + const span = new Span(tracer, ROOT_CONTEXT, 'test-span', spanContext, SpanKind.CLIENT, parentId) + span.setAttribute(SEMATTRS_HTTP_METHOD, 'GET') + span.setAttribute(SEMATTRS_HTTP_HOST, 'newrelic.com') + const segment = synthesizer.synthesize(span) + assert.equal(segment.name, 'External/newrelic.com') + assert.equal(segment.parentId, tx.trace.root.id) + tx.end() + end() + }) +}) + +test('should log warning if a rule does have a synthesis for the given type', (t, end) => { + const { agent, synthesizer, loggerMock, parentId, tracer } = t.nr + + helper.runInTransaction(agent, (tx) => { + const spanContext = { + traceId: tx.trace.id, + spanId: tx.trace.root.id, + traceFlags: TraceFlags.SAMPLED + } + const span = new Span(tracer, ROOT_CONTEXT, 'test-span', spanContext, SpanKind.CLIENT, parentId) + span.setAttribute(SEMATTRS_DB_SYSTEM, 'postgres') + const segment = synthesizer.synthesize(span) + assert.ok(!segment) + assert.deepEqual(loggerMock.debug.args[0], [ + 'Found type: %s, no synthesize rule currently built', + 'db' + ]) + tx.end() + end() + }) +}) + +test('should log warning span does not match a rule', (t, end) => { + const { agent, synthesizer, loggerMock, parentId, tracer } = t.nr + + helper.runInTransaction(agent, (tx) => { + const spanContext = { + traceId: tx.trace.id, + spanId: tx.trace.root.id, + traceFlags: TraceFlags.SAMPLED + } + + const span = new Span(tracer, ROOT_CONTEXT, 'test-span', spanContext, 'bogus', parentId) + const segment = synthesizer.synthesize(span) + assert.ok(!segment) + assert.deepEqual(loggerMock.debug.args[0], [ + 'Cannot match a rule to span name: %s, kind %s', + 'test-span', + 'bogus' + ]) + tx.end() + end() + }) +}) diff --git a/test/versioned/aws-sdk-v3/client-dynamodb.test.js b/test/versioned/aws-sdk-v3/client-dynamodb.test.js index cb77a92f1d..4631abae43 100644 --- a/test/versioned/aws-sdk-v3/client-dynamodb.test.js +++ b/test/versioned/aws-sdk-v3/client-dynamodb.test.js @@ -116,9 +116,9 @@ test('DynamoDB', async (t) => { } tx.end() const root = tx.trace.root - const segments = common.checkAWSAttributes({ - trace: tx.trace, - segment: root, + const segments = common.checkAWSAttributes({ + trace: tx.trace, + segment: root, pattern: common.DATASTORE_PATTERN }) diff --git a/test/versioned/koa/code-level-metrics.test.js b/test/versioned/koa/code-level-metrics.test.js index af7228c7fc..3e159bd5db 100644 --- a/test/versioned/koa/code-level-metrics.test.js +++ b/test/versioned/koa/code-level-metrics.test.js @@ -102,12 +102,12 @@ test('vanilla koa, no router', async (t) => { { segments: [ { - segment: one, + segment: one, name: 'one', filepath: 'code-level-metrics.test.js' }, { - segment: two, + segment: two, name: 'two', filepath: 'code-level-metrics.test.js' } @@ -168,17 +168,17 @@ test('using koa-router', async (t) => { { segments: [ { - segment: dispatch, + segment: dispatch, name: 'dispatch', filepath: 'koa-router/lib/router.js' }, { - segment: appLevel, + segment: appLevel, name: 'appLevelMiddleware', filepath: 'code-level-metrics.test.js' }, { - segment: secondMw, + segment: secondMw, name: 'secondMiddleware', filepath: 'code-level-metrics.test.js' } @@ -239,17 +239,17 @@ test('using @koa/router', async (t) => { { segments: [ { - segment: dispatch, + segment: dispatch, name: 'dispatch', filepath: '@koa/router/lib/router.js' }, { - segment: appLevel, + segment: appLevel, name: 'appLevelMiddleware', filepath: 'code-level-metrics.test.js' }, { - segment: secondMw, + segment: secondMw, name: 'secondMiddleware', filepath: 'code-level-metrics.test.js' } diff --git a/test/versioned/memcached/memcached.test.js b/test/versioned/memcached/memcached.test.js index 0d8ff7b6ec..9257c779b4 100644 --- a/test/versioned/memcached/memcached.test.js +++ b/test/versioned/memcached/memcached.test.js @@ -874,7 +874,11 @@ test('memcached instrumentation', { timeout: 5000 }, async function (t) { assert.ok(!err) transaction.end() checkParams(firstSegment, 'server1', '1111') - checkParams(transaction.trace.getParent(agent.tracer.getSegment().parentId), 'server2', '2222') + checkParams( + transaction.trace.getParent(agent.tracer.getSegment().parentId), + 'server2', + '2222' + ) end() }) }) diff --git a/test/versioned/nextjs/attributes.test.js b/test/versioned/nextjs/attributes.test.js index 566d97ddf3..76f27b8166 100644 --- a/test/versioned/nextjs/attributes.test.js +++ b/test/versioned/nextjs/attributes.test.js @@ -258,7 +258,8 @@ test('Next.js', async (t) => { enabled, skipFull: true }) - }) + } + ) await t.test('should not add CLM attrs to static page segment', async (t) => { agent.config.code_level_metrics = { enabled } diff --git a/test/versioned/pg/pg.common.js b/test/versioned/pg/pg.common.js index f0971081b9..a5f4c61b2f 100644 --- a/test/versioned/pg/pg.common.js +++ b/test/versioned/pg/pg.common.js @@ -309,7 +309,7 @@ module.exports = function runTests(name, clientFactory) { assert.ok(agent.getTransaction(), 'transaction should still still be visible') assert.equal(selectResults.rows[0][COL], colVal, 'Postgres client should still work') transaction.end() - verify(assert, transaction) + verify(assert, transaction) end() } catch (err) { assert.ifError(err) @@ -465,7 +465,7 @@ module.exports = function runTests(name, clientFactory) { transaction.end() pool.end() - verify(plan, transaction) + verify(plan, transaction) }) }) }) @@ -514,7 +514,7 @@ module.exports = function runTests(name, clientFactory) { } done(true) - verify(plan, transaction) + verify(plan, transaction) }) }) }) diff --git a/test/versioned/when/segments.test.js b/test/versioned/when/segments.test.js index 1b3b293491..ddad31588d 100644 --- a/test/versioned/when/segments.test.js +++ b/test/versioned/when/segments.test.js @@ -323,7 +323,13 @@ test('segments disabled', async (t) => { const children = tx.trace.getChildren(tx.trace.root.id) plan.equal(children.length, 1) - assertSegments(tx.trace, tx.trace.root, ['doSomeWork', ['someChildSegment']], {}, { assert: plan }) + assertSegments( + tx.trace, + tx.trace.root, + ['doSomeWork', ['someChildSegment']], + {}, + { assert: plan } + ) }) helper.runInTransaction(agent, function transactionWrapper(transaction) { diff --git a/third_party_manifest.json b/third_party_manifest.json index f92f255770..440887e4d3 100644 --- a/third_party_manifest.json +++ b/third_party_manifest.json @@ -92,6 +92,18 @@ "licenseTextSource": "file", "publisher": "OpenTelemetry Authors" }, + "@opentelemetry/semantic-conventions@1.27.0": { + "name": "@opentelemetry/semantic-conventions", + "version": "1.27.0", + "range": "^1.27.0", + "licenses": "Apache-2.0", + "repoUrl": "https://github.com/open-telemetry/opentelemetry-js", + "versionedRepoUrl": "https://github.com/open-telemetry/opentelemetry-js/tree/v1.27.0", + "licenseFile": "node_modules/@opentelemetry/semantic-conventions/LICENSE", + "licenseUrl": "https://github.com/open-telemetry/opentelemetry-js/blob/v1.27.0/LICENSE", + "licenseTextSource": "file", + "publisher": "OpenTelemetry Authors" + }, "@tyriar/fibonacci-heap@2.0.9": { "name": "@tyriar/fibonacci-heap", "version": "2.0.9", @@ -118,15 +130,15 @@ "publisher": "Max Ogden", "email": "max@maxogden.com" }, - "https-proxy-agent@7.0.5": { + "https-proxy-agent@7.0.4": { "name": "https-proxy-agent", - "version": "7.0.5", + "version": "7.0.4", "range": "^7.0.1", "licenses": "MIT", "repoUrl": "https://github.com/TooTallNate/proxy-agents", - "versionedRepoUrl": "https://github.com/TooTallNate/proxy-agents/tree/v7.0.5", + "versionedRepoUrl": "https://github.com/TooTallNate/proxy-agents/tree/v7.0.4", "licenseFile": "node_modules/https-proxy-agent/LICENSE", - "licenseUrl": "https://github.com/TooTallNate/proxy-agents/blob/v7.0.5/LICENSE", + "licenseUrl": "https://github.com/TooTallNate/proxy-agents/blob/v7.0.4/LICENSE", "licenseTextSource": "file", "publisher": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -211,15 +223,15 @@ "email": "w@tson.dk", "url": "https://twitter.com/wa7son" }, - "semver@7.6.3": { + "semver@7.6.2": { "name": "semver", - "version": "7.6.3", + "version": "7.6.2", "range": "^7.5.2", "licenses": "ISC", "repoUrl": "https://github.com/npm/node-semver", - "versionedRepoUrl": "https://github.com/npm/node-semver/tree/v7.6.3", + "versionedRepoUrl": "https://github.com/npm/node-semver/tree/v7.6.2", "licenseFile": "node_modules/semver/LICENSE", - "licenseUrl": "https://github.com/npm/node-semver/blob/v7.6.3/LICENSE", + "licenseUrl": "https://github.com/npm/node-semver/blob/v7.6.2/LICENSE", "licenseTextSource": "file", "publisher": "GitHub Inc." }, @@ -351,7 +363,7 @@ "licenseTextSource": "file", "publisher": "OpenTelemetry Authors" }, - "@slack/bolt@3.22.0": { + "@slack/bolt@3.19.0": { "name": "@slack/bolt", "version": "3.19.0", "range": "^3.7.0",