From fa218c0778f13b536a5084b19f524fa7238267de Mon Sep 17 00:00:00 2001 From: David Luna Date: Fri, 26 Apr 2024 12:54:55 +0200 Subject: [PATCH 1/4] refactor(instr-graphql): use exported strings for attributes --- package-lock.json | 4 ++-- .../node/opentelemetry-instrumentation-graphql/package.json | 2 +- .../test/graphql.test.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b30e3664a6..278e0598e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37805,7 +37805,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.3.1", + "@opentelemetry/semantic-conventions": "^1.22.1", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0", @@ -46208,7 +46208,7 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/instrumentation": "^0.51.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.3.1", + "@opentelemetry/semantic-conventions": "^1.22.1", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0", diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index 1ae2a4bdf9..2965e4c9b9 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -46,7 +46,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.3.1", + "@opentelemetry/semantic-conventions": "^1.22.1", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0", diff --git a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts index 3522290110..661304a212 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts @@ -21,7 +21,7 @@ import { SimpleSpanProcessor, } from '@opentelemetry/sdk-trace-base'; import { Span, SpanStatusCode } from '@opentelemetry/api'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMATTRS_EXCEPTION_MESSAGE } from '@opentelemetry/semantic-conventions'; import * as assert from 'assert'; import type * as graphqlTypes from 'graphql'; import { GraphQLInstrumentation } from '../src'; @@ -1399,7 +1399,7 @@ describe('graphql', () => { const resolveEvent = resolveSpan.events[0]; assert.deepStrictEqual(resolveEvent.name, 'exception'); assert.deepStrictEqual( - resolveEvent.attributes?.[SemanticAttributes.EXCEPTION_MESSAGE], + resolveEvent.attributes?.[SEMATTRS_EXCEPTION_MESSAGE], 'sync resolver error from tests' ); From 00af2fbd3b5e2a9367ff5d1764f440ebcfc9e1eb Mon Sep 17 00:00:00 2001 From: David Luna Date: Mon, 13 May 2024 12:53:36 +0200 Subject: [PATCH 2/4] fix(instr-graphql): update README file --- plugins/node/opentelemetry-instrumentation-graphql/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/node/opentelemetry-instrumentation-graphql/README.md b/plugins/node/opentelemetry-instrumentation-graphql/README.md index aa8877be23..9344e8ed19 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/README.md +++ b/plugins/node/opentelemetry-instrumentation-graphql/README.md @@ -116,6 +116,10 @@ Downstream spans in the context of all resolvers will be child of the first span Can be found [here](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/graphql) +## Semantic Conventions + +This package does not currently generate any attributes from semantic conventions. + ## Useful links - For more information on OpenTelemetry, visit: From 5976678809a873685212ad2ce14c26e6d2f2c952 Mon Sep 17 00:00:00 2001 From: David Luna Date: Tue, 14 May 2024 19:47:23 +0200 Subject: [PATCH 3/4] Update plugins/node/opentelemetry-instrumentation-graphql/package.json Co-authored-by: Trent Mick --- plugins/node/opentelemetry-instrumentation-graphql/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index 2965e4c9b9..bdcb66cc6e 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -46,7 +46,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.22.1", + "@opentelemetry/semantic-conventions": "^1.22.0", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0", From cd0ebd6b869152ccd63173228062fd8472c72b6e Mon Sep 17 00:00:00 2001 From: David Luna Date: Tue, 14 May 2024 19:48:33 +0200 Subject: [PATCH 4/4] chore(instr-graphql): update package-lock.json --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f0610ae6e..d14f048c6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38148,7 +38148,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.22.1", + "@opentelemetry/semantic-conventions": "^1.22.0", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0", @@ -46952,7 +46952,7 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/instrumentation": "^0.51.0", "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/semantic-conventions": "^1.22.1", + "@opentelemetry/semantic-conventions": "^1.22.0", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "graphql": "^16.5.0",