From fc0a5422099cdef453788a9d218218a5cf932ffe Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 10 Jul 2024 09:19:31 +0200 Subject: [PATCH 1/3] fix(otel): Do not add `otel.kind: INTERNAL` attribute Only add this if this is some other value --- .../create-next-app/tests/server-transactions.test.ts | 1 - .../nestjs/tests/span-decorator.test.ts | 2 -- .../nestjs/tests/transactions.test.ts | 4 ---- .../node-connect/tests/transactions.test.ts | 2 -- .../node-express-cjs-preload/tests/server.test.ts | 3 --- .../node-express-esm-loader/tests/server.test.ts | 3 --- .../node-express-esm-preload/tests/server.test.ts | 3 --- .../node-express/tests/transactions.test.ts | 6 ------ .../node-fastify/tests/transactions.test.ts | 4 ---- .../node-hapi/tests/transactions.test.ts | 2 -- .../node-koa/tests/transactions.test.ts | 4 ---- .../node-otel-sdk-node/tests/transactions.test.ts | 6 ------ .../suites/tracing/apollo-graphql/test.ts | 2 -- .../suites/tracing/connect/test.ts | 1 - .../suites/tracing/nestjs/test.ts | 1 - .../suites/tracing/prisma-orm/test.ts | 11 ----------- packages/node/test/integration/scope.test.ts | 1 - packages/node/test/integration/transactions.test.ts | 10 ---------- packages/opentelemetry/src/spanExporter.ts | 4 ++++ packages/opentelemetry/test/integration/scope.test.ts | 1 - .../test/integration/transactions.test.ts | 8 -------- packages/opentelemetry/test/trace.test.ts | 6 ------ .../test/server/instrumentation-otel/action.test.ts | 3 --- .../test/server/instrumentation-otel/loader.test.ts | 4 ---- 24 files changed, 4 insertions(+), 88 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts index 1d789cb4950c..56be8b65d60b 100644 --- a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts @@ -40,7 +40,6 @@ test('Sends server-side transactions to Sentry', async ({ baseURL }) => { spans: [ { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'test-span', diff --git a/dev-packages/e2e-tests/test-applications/nestjs/tests/span-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs/tests/span-decorator.test.ts index 3efdfb979d73..28c925727d89 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs/tests/span-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs/tests/span-decorator.test.ts @@ -24,7 +24,6 @@ test('Transaction includes span and correct value for decorated async function', data: { 'sentry.origin': 'manual', 'sentry.op': 'wait and return a string', - 'otel.kind': 'INTERNAL', }, description: 'wait', parent_span_id: expect.any(String), @@ -60,7 +59,6 @@ test('Transaction includes span and correct value for decorated sync function', data: { 'sentry.origin': 'manual', 'sentry.op': 'return a string', - 'otel.kind': 'INTERNAL', }, description: 'getString', parent_span_id: expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/nestjs/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs/tests/transactions.test.ts index 22cb0f8e6a8c..ae5d8b63b16d 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs/tests/transactions.test.ts @@ -54,7 +54,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'express.name': '/test-transaction', 'express.type': 'request_handler', 'http.route': '/test-transaction', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'request_handler.express', }, @@ -70,7 +69,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'test-span', @@ -84,7 +82,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'child-span', @@ -106,7 +103,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'nestjs.version': expect.any(String), 'nestjs.type': 'handler', 'nestjs.callback': 'testTransaction', - 'otel.kind': 'INTERNAL', }, description: 'testTransaction', parent_span_id: expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts index 031fa71ec581..f0da250d8be9 100644 --- a/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts @@ -53,7 +53,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { { data: { 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', }, description: 'test-span', parent_span_id: expect.any(String), @@ -71,7 +70,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'connect.type': 'request_handler', 'connect.name': '/test-transaction', - 'otel.kind': 'INTERNAL', }, op: 'request_handler.connect', description: '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts index 5b8fd26f1647..5316cc377358 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts @@ -66,7 +66,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'query', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -86,7 +85,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'expressInit', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -106,7 +104,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': '/test-transaction/:param', 'express.type': 'request_handler', 'http.route': '/test-transaction/:param', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'request_handler.express', }, diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts index 3b65819e2c29..06e2c2e09434 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts @@ -66,7 +66,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'query', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -86,7 +85,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'expressInit', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -106,7 +104,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': '/test-transaction/:param', 'express.type': 'request_handler', 'http.route': '/test-transaction/:param', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'request_handler.express', }, diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts index e7b9a3faa878..9d6b10a3dd74 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts @@ -66,7 +66,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'query', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -86,7 +85,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': 'expressInit', 'express.type': 'middleware', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', }, @@ -106,7 +104,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'express.name': '/test-transaction/:param', 'express.type': 'request_handler', 'http.route': '/test-transaction/:param', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'request_handler.express', }, diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts index 03262edcf6b5..fede408d258e 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts @@ -65,7 +65,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/', 'express.name': 'query', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'query', op: 'middleware.express', @@ -85,7 +84,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/', 'express.name': 'expressInit', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'expressInit', op: 'middleware.express', @@ -105,7 +103,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'express.name': '/test-transaction', 'express.type': 'request_handler', - 'otel.kind': 'INTERNAL', }, description: '/test-transaction', op: 'request_handler.express', @@ -146,7 +143,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/', 'express.name': 'query', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'query', op: 'middleware.express', @@ -166,7 +162,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/', 'express.name': 'expressInit', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'expressInit', op: 'middleware.express', @@ -186,7 +181,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/test-exception/:id', 'express.name': '/test-exception/:id', 'express.type': 'request_handler', - 'otel.kind': 'INTERNAL', }, description: '/test-exception/:id', op: 'request_handler.express', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts index fa0ace0e1e5d..c9cb53afb94c 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts @@ -63,7 +63,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'plugin.name': 'fastify -> sentry-fastify-error-handler', 'fastify.type': 'middleware', 'hook.name': 'onRequest', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.fastify', 'sentry.op': 'middleware.fastify', }, @@ -83,7 +82,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'plugin.name': 'fastify -> sentry-fastify-error-handler', 'fastify.type': 'request_handler', 'http.route': '/test-transaction', - 'otel.kind': 'INTERNAL', 'sentry.op': 'request_handler.fastify', 'sentry.origin': 'auto.http.otel.fastify', }, @@ -100,7 +98,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { expect(spans).toContainEqual({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'test-span', @@ -115,7 +112,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { expect(spans).toContainEqual({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'child-span', diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts index 4fd0c72ffd54..c3237de74a5a 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts @@ -63,7 +63,6 @@ test('Sends successful transaction', async ({ baseURL }) => { 'hapi.type': 'router', 'http.method': 'GET', 'http.route': '/test-success', - 'otel.kind': 'INTERNAL', 'sentry.op': 'router.hapi', 'sentry.origin': 'auto.http.otel.hapi', }, @@ -81,7 +80,6 @@ test('Sends successful transaction', async ({ baseURL }) => { // this comes from "onPreResponse" data: { 'hapi.type': 'server.ext', - 'otel.kind': 'INTERNAL', 'sentry.op': 'server.ext.hapi', 'sentry.origin': 'auto.http.otel.hapi', 'server.ext.type': 'onPreResponse', diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts index fd57b23cb8bb..4c52c932e7b4 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts @@ -53,7 +53,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { data: { 'koa.name': '', 'koa.type': 'middleware', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.koa', 'sentry.op': 'middleware.koa', }, @@ -72,7 +71,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'koa.name': '/test-transaction', 'koa.type': 'router', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.koa', 'sentry.op': 'router.koa', }, @@ -88,7 +86,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'test-span', @@ -102,7 +99,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'child-span', diff --git a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts index 39a7d27e9cb1..f7fee0559a97 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts @@ -77,7 +77,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/', 'express.name': 'query', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'query', op: 'middleware.express', @@ -97,7 +96,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/', 'express.name': 'expressInit', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'expressInit', op: 'middleware.express', @@ -117,7 +115,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'express.name': '/test-transaction', 'express.type': 'request_handler', - 'otel.kind': 'INTERNAL', }, description: '/test-transaction', op: 'request_handler.express', @@ -158,7 +155,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/', 'express.name': 'query', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'query', op: 'middleware.express', @@ -178,7 +174,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/', 'express.name': 'expressInit', 'express.type': 'middleware', - 'otel.kind': 'INTERNAL', }, description: 'expressInit', op: 'middleware.express', @@ -198,7 +193,6 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'http.route': '/test-exception/:id', 'express.name': '/test-exception/:id', 'express.type': 'request_handler', - 'otel.kind': 'INTERNAL', }, description: '/test-exception/:id', op: 'request_handler.express', diff --git a/dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts b/dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts index 593ccff485fe..5bf91f7653c1 100644 --- a/dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts @@ -9,7 +9,6 @@ describe('GraphQL/Apollo Tests', () => { data: { 'graphql.operation.type': 'query', 'graphql.source': '{hello}', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.graphql.otel.graphql', }, description: 'query', @@ -31,7 +30,6 @@ describe('GraphQL/Apollo Tests', () => { 'graphql.operation.name': 'Mutation', 'graphql.operation.type': 'mutation', 'graphql.source': 'mutation Mutation($email: String) {\n login(email: $email)\n}', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.graphql.otel.graphql', }, description: 'mutation Mutation', diff --git a/dev-packages/node-integration-tests/suites/tracing/connect/test.ts b/dev-packages/node-integration-tests/suites/tracing/connect/test.ts index e343e6edf6fd..ad49a4e4532d 100644 --- a/dev-packages/node-integration-tests/suites/tracing/connect/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/connect/test.ts @@ -15,7 +15,6 @@ describe('connect auto-instrumentation', () => { 'connect.name': '/', 'connect.type': 'request_handler', 'http.route': '/', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.http.otel.connect', 'sentry.op': 'request_handler.connect', }), diff --git a/dev-packages/node-integration-tests/suites/tracing/nestjs/test.ts b/dev-packages/node-integration-tests/suites/tracing/nestjs/test.ts index abb9cf6f0bdd..2b42f23c857a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/nestjs/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/nestjs/test.ts @@ -27,7 +27,6 @@ conditionalTest({ min: 16 })('nestjs auto instrumentation', () => { 'nestjs.callback': 'getHello', 'nestjs.controller': 'AppController', 'nestjs.type': 'request_context', - 'otel.kind': 'INTERNAL', 'sentry.op': 'http', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/prisma-orm/test.ts b/dev-packages/node-integration-tests/suites/tracing/prisma-orm/test.ts index 3c96c6d80779..dd92de5d0292 100644 --- a/dev-packages/node-integration-tests/suites/tracing/prisma-orm/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/prisma-orm/test.ts @@ -11,7 +11,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { method: 'create', model: 'User', name: 'User.create', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:client:operation', @@ -19,7 +18,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:client:serialize', @@ -27,7 +25,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:client:connect', @@ -35,7 +32,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:engine', @@ -44,7 +40,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { expect.objectContaining({ data: { 'db.type': 'postgres', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:engine:connection', @@ -55,7 +50,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { 'db.statement': expect.stringContaining( 'INSERT INTO "public"."User" ("createdAt","email","name") VALUES ($1,$2,$3) RETURNING "public"."User"."id", "public"."User"."createdAt", "public"."User"."email", "public"."User"."name" /* traceparent', ), - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', 'db.system': 'prisma', 'sentry.op': 'db', @@ -67,7 +61,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:engine:serialize', @@ -75,7 +68,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:engine:response_json_serialization', @@ -86,7 +78,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { method: 'findMany', model: 'User', name: 'User.findMany', - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:client:operation', @@ -94,7 +85,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:client:serialize', @@ -102,7 +92,6 @@ conditionalTest({ min: 16 })('Prisma ORM Tests', () => { }), expect.objectContaining({ data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'auto.db.otel.prisma', }, description: 'prisma:engine', diff --git a/packages/node/test/integration/scope.test.ts b/packages/node/test/integration/scope.test.ts index 036ab4741fa8..1a7a899ab423 100644 --- a/packages/node/test/integration/scope.test.ts +++ b/packages/node/test/integration/scope.test.ts @@ -100,7 +100,6 @@ describe('Integration | Scope', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', 'sentry.source': 'custom', 'sentry.sample_rate': 1, diff --git a/packages/node/test/integration/transactions.test.ts b/packages/node/test/integration/transactions.test.ts index e3c9203ddaf5..048496f363b4 100644 --- a/packages/node/test/integration/transactions.test.ts +++ b/packages/node/test/integration/transactions.test.ts @@ -87,7 +87,6 @@ describe('Integration | Transactions', () => { expect(transaction.contexts?.trace).toEqual({ data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -133,7 +132,6 @@ describe('Integration | Transactions', () => { expect(spans).toEqual([ { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 1', @@ -147,7 +145,6 @@ describe('Integration | Transactions', () => { }, { data: { - 'otel.kind': 'INTERNAL', 'test.inner': 'test value', 'sentry.origin': 'manual', }, @@ -241,7 +238,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -280,7 +276,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op b', 'sentry.origin': 'manual', 'sentry.source': 'custom', @@ -386,7 +381,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', 'sentry.source': 'custom', 'test.outer': 'test value', @@ -422,7 +416,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', 'sentry.source': 'custom', 'test.outer': 'test value b', @@ -495,7 +488,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -532,7 +524,6 @@ describe('Integration | Transactions', () => { expect(spans).toEqual([ { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 1', @@ -546,7 +537,6 @@ describe('Integration | Transactions', () => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 2', diff --git a/packages/opentelemetry/src/spanExporter.ts b/packages/opentelemetry/src/spanExporter.ts index 3064de5818aa..1a2cfee4c2ef 100644 --- a/packages/opentelemetry/src/spanExporter.ts +++ b/packages/opentelemetry/src/spanExporter.ts @@ -356,6 +356,10 @@ function getData(span: ReadableSpan): Record { 'otel.kind': SpanKind[span.kind], }; + if (span.kind !== SpanKind.INTERNAL) { + data['otel.kind'] = SpanKind[span.kind]; + } + if (attributes[SEMATTRS_HTTP_STATUS_CODE]) { const statusCode = attributes[SEMATTRS_HTTP_STATUS_CODE] as string; data['http.response.status_code'] = statusCode; diff --git a/packages/opentelemetry/test/integration/scope.test.ts b/packages/opentelemetry/test/integration/scope.test.ts index d4cbdfa8f411..c2e3dcc86701 100644 --- a/packages/opentelemetry/test/integration/scope.test.ts +++ b/packages/opentelemetry/test/integration/scope.test.ts @@ -107,7 +107,6 @@ describe('Integration | Scope', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', 'sentry.source': 'custom', 'sentry.sample_rate': 1, diff --git a/packages/opentelemetry/test/integration/transactions.test.ts b/packages/opentelemetry/test/integration/transactions.test.ts index 13f8c91af7b7..fe03fc8a1030 100644 --- a/packages/opentelemetry/test/integration/transactions.test.ts +++ b/packages/opentelemetry/test/integration/transactions.test.ts @@ -102,7 +102,6 @@ describe('Integration | Transactions', () => { expect(transaction.contexts?.trace).toEqual({ data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -148,7 +147,6 @@ describe('Integration | Transactions', () => { expect(spans).toEqual([ { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 1', @@ -162,7 +160,6 @@ describe('Integration | Transactions', () => { }, { data: { - 'otel.kind': 'INTERNAL', 'test.inner': 'test value', 'sentry.origin': 'manual', }, @@ -256,7 +253,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -295,7 +291,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op b', 'sentry.origin': 'manual', 'sentry.source': 'custom', @@ -376,7 +371,6 @@ describe('Integration | Transactions', () => { contexts: expect.objectContaining({ trace: { data: { - 'otel.kind': 'INTERNAL', 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.source': 'task', @@ -413,7 +407,6 @@ describe('Integration | Transactions', () => { expect(spans).toEqual([ { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 1', @@ -427,7 +420,6 @@ describe('Integration | Transactions', () => { }, { data: { - 'otel.kind': 'INTERNAL', 'sentry.origin': 'manual', }, description: 'inner span 2', diff --git a/packages/opentelemetry/test/trace.test.ts b/packages/opentelemetry/test/trace.test.ts index 6fd4ada4dc46..d3ac52327bb6 100644 --- a/packages/opentelemetry/test/trace.test.ts +++ b/packages/opentelemetry/test/trace.test.ts @@ -379,7 +379,6 @@ describe('trace', () => { 'sentry.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', }, span_id: expect.any(String), trace_id: expect.any(String), @@ -403,7 +402,6 @@ describe('trace', () => { data: { 'sentry.source': 'custom', 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, @@ -630,7 +628,6 @@ describe('trace', () => { 'sentry.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', }, span_id: expect.any(String), trace_id: expect.any(String), @@ -654,7 +651,6 @@ describe('trace', () => { data: { 'sentry.source': 'custom', 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, @@ -918,7 +914,6 @@ describe('trace', () => { 'sentry.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', }, span_id: expect.any(String), trace_id: expect.any(String), @@ -942,7 +937,6 @@ describe('trace', () => { data: { 'sentry.source': 'custom', 'sentry.origin': 'manual', - 'otel.kind': 'INTERNAL', 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, diff --git a/packages/remix/test/integration/test/server/instrumentation-otel/action.test.ts b/packages/remix/test/integration/test/server/instrumentation-otel/action.test.ts index a784cd3b8d9c..f883c4bfeee5 100644 --- a/packages/remix/test/integration/test/server/instrumentation-otel/action.test.ts +++ b/packages/remix/test/integration/test/server/instrumentation-otel/action.test.ts @@ -22,7 +22,6 @@ describe('Remix API Actions', () => { data: { 'code.function': 'action', 'sentry.op': 'action.remix', - 'otel.kind': 'INTERNAL', 'match.route.id': `routes/action-json-response${useV2 ? '.' : '/'}$id`, 'match.params.id': '123123', }, @@ -31,7 +30,6 @@ describe('Remix API Actions', () => { data: { 'code.function': 'loader', 'sentry.op': 'loader.remix', - 'otel.kind': 'INTERNAL', 'match.route.id': `routes/action-json-response${useV2 ? '.' : '/'}$id`, 'match.params.id': '123123', }, @@ -40,7 +38,6 @@ describe('Remix API Actions', () => { data: { 'code.function': 'loader', 'sentry.op': 'loader.remix', - 'otel.kind': 'INTERNAL', 'match.route.id': 'root', 'match.params.id': '123123', }, diff --git a/packages/remix/test/integration/test/server/instrumentation-otel/loader.test.ts b/packages/remix/test/integration/test/server/instrumentation-otel/loader.test.ts index 62e0bf78ac10..49b0fa7665fd 100644 --- a/packages/remix/test/integration/test/server/instrumentation-otel/loader.test.ts +++ b/packages/remix/test/integration/test/server/instrumentation-otel/loader.test.ts @@ -102,7 +102,6 @@ describe('Remix API Loaders', () => { { data: { 'code.function': 'loader', - 'otel.kind': 'INTERNAL', 'sentry.op': 'loader.remix', }, origin: 'manual', @@ -110,7 +109,6 @@ describe('Remix API Loaders', () => { { data: { 'code.function': 'loader', - 'otel.kind': 'INTERNAL', 'sentry.op': 'loader.remix', }, origin: 'manual', @@ -244,7 +242,6 @@ describe('Remix API Loaders', () => { data: { 'code.function': 'loader', 'sentry.op': 'loader.remix', - 'otel.kind': 'INTERNAL', 'match.route.id': `routes/loader-defer-response${useV2 ? '.' : '/'}$id`, }, }, @@ -252,7 +249,6 @@ describe('Remix API Loaders', () => { data: { 'code.function': 'loader', 'sentry.op': 'loader.remix', - 'otel.kind': 'INTERNAL', 'match.route.id': 'root', }, }, From d8099e1fc31f5f477c6ff951549c30298295e272 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 10 Jul 2024 10:48:28 +0200 Subject: [PATCH 2/3] fix it, oops --- packages/opentelemetry/src/spanExporter.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/opentelemetry/src/spanExporter.ts b/packages/opentelemetry/src/spanExporter.ts index 1a2cfee4c2ef..5714a3d93970 100644 --- a/packages/opentelemetry/src/spanExporter.ts +++ b/packages/opentelemetry/src/spanExporter.ts @@ -352,9 +352,7 @@ function removeSentryAttributes(data: Record): Record { const attributes = span.attributes; - const data: Record = { - 'otel.kind': SpanKind[span.kind], - }; + const data: Record = {}; if (span.kind !== SpanKind.INTERNAL) { data['otel.kind'] = SpanKind[span.kind]; From f210f0e4c7337c76b264a77ab2e1b32d5287dae2 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 10 Jul 2024 11:39:08 +0200 Subject: [PATCH 3/3] fix remaining --- .../test-applications/aws-serverless-esm/tests/basic.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts b/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts index 8e507a469235..83fab96ee117 100644 --- a/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts +++ b/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts @@ -31,7 +31,6 @@ test('AWS Serverless SDK sends events in ESM mode', async ({ request }) => { 'sentry.source': 'component', 'sentry.origin': 'auto.function.serverless', 'sentry.op': 'function.aws.lambda', - 'otel.kind': 'INTERNAL', }, op: 'function.aws.lambda', origin: 'auto.function.serverless',