Skip to content
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
3 changes: 2 additions & 1 deletion .oxlintrc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@
"**/integrations/tracing/tedious/vendored/**/*.ts",
"**/integrations/tracing/hapi/vendored/**/*.ts",
"**/integrations/tracing/mongoose/vendored/**/*.ts",
"**/integrations/tracing/amqplib/vendored/**/*.ts"
"**/integrations/tracing/amqplib/vendored/**/*.ts",
"**/integrations/tracing/graphql/vendored/**/*.ts"
],
"rules": {
"typescript/no-explicit-any": "off"
Expand Down
1 change: 0 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/core": "^2.6.1",
"@opentelemetry/instrumentation": "^0.214.0",
"@opentelemetry/instrumentation-graphql": "0.62.0",
"@opentelemetry/instrumentation-http": "0.214.0",
"@opentelemetry/sql-common": "^0.41.2",
"@opentelemetry/instrumentation-pg": "0.66.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Simplified types inlined from dataloader.
*/

declare class DataLoader<K, V, C = K> {
declare class DataLoader<K, V, _C = K> {
Copy link
Copy Markdown
Member Author

@nicohrubec nicohrubec May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just fixing an unrelated lint warning

constructor(batchLoadFn: DataLoader.BatchLoadFn<K, V>, options?: any);
load(key: K): Promise<V>;
loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AttributeValue } from '@opentelemetry/api';
import { SpanStatusCode } from '@opentelemetry/api';
import { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';
import { GraphQLInstrumentation } from './vendored/instrumentation';
import type { IntegrationFn } from '@sentry/core';
import { defineIntegration, getRootSpan, spanToJSON } from '@sentry/core';
import { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';
Expand Down
60 changes: 60 additions & 0 deletions packages/node/src/integrations/tracing/graphql/vendored/enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.
*
* NOTICE from the Sentry authors:
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-graphql
* - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0
*/
/* eslint-disable */

export enum AllowedOperationTypes {
QUERY = 'query',
MUTATION = 'mutation',
SUBSCRIPTION = 'subscription',
}

export enum TokenKind {
SOF = '<SOF>',
EOF = '<EOF>',
BANG = '!',
DOLLAR = '$',
AMP = '&',
PAREN_L = '(',
PAREN_R = ')',
SPREAD = '...',
COLON = ':',
EQUALS = '=',
AT = '@',
BRACKET_L = '[',
BRACKET_R = ']',
BRACE_L = '{',
PIPE = '|',
BRACE_R = '}',
NAME = 'Name',
INT = 'Int',
FLOAT = 'Float',
STRING = 'String',
BLOCK_STRING = 'BlockString',
COMMENT = 'Comment',
}

export enum SpanNames {
EXECUTE = 'graphql.execute',
PARSE = 'graphql.parse',
RESOLVE = 'graphql.resolve',
VALIDATE = 'graphql.validate',
SCHEMA_VALIDATE = 'graphql.validateSchema',
SCHEMA_PARSE = 'graphql.parseSchema',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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.
*
* NOTICE from the Sentry authors:
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-graphql
* - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0
*/
/* eslint-disable */

export enum AttributeNames {
SOURCE = 'graphql.source',
FIELD_NAME = 'graphql.field.name',
FIELD_PATH = 'graphql.field.path',
FIELD_TYPE = 'graphql.field.type',
PARENT_NAME = 'graphql.parent.name',
OPERATION_TYPE = 'graphql.operation.type',
OPERATION_NAME = 'graphql.operation.name',
VARIABLES = 'graphql.variables.',
ERROR_VALIDATION_NAME = 'graphql.validation.error',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/*
* Simplified types inlined from the `graphql` package.
* Only includes members accessed by this instrumentation.
*/

export type PromiseOrValue<T> = T | Promise<T>;

export type Maybe<T> = null | undefined | T;

export interface Location {
start: number;
end: number;
startToken: Token;
source: Source;
[key: string]: any;
}

export interface Token {
kind: string;
start: number;
end: number;
line: number;
column: number;
value: string;
prev: Token | null;
next: Token | null;
[key: string]: any;
}

export interface Source {
body: string;
name: string;
locationOffset: Location;
[key: string]: any;
}

export interface DocumentNode {
kind: string;
definitions: ReadonlyArray<DefinitionNode>;
loc?: Location;
[key: string]: any;
}

export interface DefinitionNode {
kind: string;
loc?: Location;
[key: string]: any;
}

export interface OperationDefinitionNode extends DefinitionNode {
operation: string;
name?: { kind: string; value: string; loc?: Location };
[key: string]: any;
}

export interface ParseOptions {
noLocation?: boolean;
[key: string]: any;
}

export interface ExecutionArgs {
schema: GraphQLSchema;
document: DocumentNode;
rootValue?: any;
contextValue?: any;
variableValues?: Maybe<{ [key: string]: any }>;
operationName?: Maybe<string>;
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
[key: string]: any;
}

export interface ExecutionResult {
errors?: ReadonlyArray<GraphQLError>;
data?: Record<string, any> | null;
[key: string]: any;
}

export interface GraphQLError {
message: string;
locations?: ReadonlyArray<{ line: number; column: number }>;
path?: ReadonlyArray<string | number>;
[key: string]: any;
}

export interface GraphQLSchema {
getQueryType(): GraphQLObjectType | undefined | null;
getMutationType(): GraphQLObjectType | undefined | null;
[key: string]: any;
}

export interface GraphQLObjectType {
name: string;
getFields(): { [key: string]: GraphQLField };
[key: string]: any;
}

export interface GraphQLField {
name: string;
type: GraphQLOutputType;
resolve?: GraphQLFieldResolver<any, any>;
[key: string]: any;
}

export type GraphQLOutputType = GraphQLNamedOutputType | GraphQLWrappingType;

interface GraphQLNamedOutputType {
name: string;
[key: string]: any;
}

interface GraphQLWrappingType {
ofType: GraphQLOutputType;
[key: string]: any;
}

export interface GraphQLUnionType {
name: string;
getTypes(): ReadonlyArray<GraphQLObjectType>;
[key: string]: any;
}

export type GraphQLType = GraphQLOutputType | GraphQLUnionType;

export type GraphQLFieldResolver<TSource, TContext, TArgs = any> = (
source: TSource,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo,
) => any;

export type GraphQLTypeResolver<TSource, TContext> = (
value: TSource,
context: TContext,
info: GraphQLResolveInfo,
abstractType: any,
) => any;

export interface GraphQLResolveInfo {
fieldName: string;
fieldNodes: ReadonlyArray<{ kind: string; loc?: Location; [key: string]: any }>;
returnType: { toString(): string; [key: string]: any };
parentType: { name: string; [key: string]: any };
path: any;
[key: string]: any;
}

export type ValidationRule = any;

export interface TypeInfo {
[key: string]: any;
}
Loading
Loading