Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(instr-graphql): use exported strings for attributes #2156

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://opentelemetry.io/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"graphql": "^16.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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'
);

Expand Down
Loading