@sentry/node 10.64.0 → 10.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/integrations/http.js +4 -7
- package/build/cjs/integrations/http.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/index.js +3 -2
- package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js +1 -4
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/index.js +3 -2
- package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +1 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/index.js +3 -8
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +8 -6
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
- package/build/esm/integrations/http.js +5 -8
- package/build/esm/integrations/http.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/index.js +4 -3
- package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/utils.js +1 -4
- package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/vendored/utils.js +2 -2
- package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/index.js +4 -3
- package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +1 -1
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/index.js +5 -10
- package/build/esm/integrations/tracing/redis/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +9 -7
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
- package/build/types/integrations/http.d.ts +2 -2
- package/build/types/integrations/http.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +1 -135
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
- package/build/types-ts3.8/integrations/http.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +1 -135
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"sourcesContent":["import { MySQL2Instrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2' as const;\n\nexport const instrumentMysql2 = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQL2Instrumentation());\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"sourcesContent":["import { MySQL2Instrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { mysql2Integration as mysql2ChannelIntegration } from '@sentry/server-utils';\n\nconst INTEGRATION_NAME = 'Mysql2' as const;\n\nexport const instrumentMysql2 = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQL2Instrumentation());\n\nconst _mysql2Integration = (() => {\n // The diagnostics_channel subscription (mysql2 >= 3.20.0) lives in server-utils so it is shared\n // across server runtimes; we extend it here to also run the vendored OTel patcher for mysql2 < 3.20.0.\n return extendIntegration(mysql2ChannelIntegration(), {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":["mysql2ChannelIntegration"],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,QAAA;AAElB,MAAM,mBAAmB,sBAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAI,uBAAuB;AAE1G,MAAM,sBAAsB,MAAM;AAGhC,EAAA,OAAO,iBAAA,CAAkBA,qBAAyB,EAAG;AAAA,IACnD,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,gBAAA,EAAiB;AAAA,IACnB;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAgBO,MAAM,iBAAA,GAAoB,kBAAkB,kBAAkB;;;;"}
|
|
@@ -7,7 +7,7 @@ import { getConnectionPrototypeToInstrument, getQueryText, getConnectionAttribut
|
|
|
7
7
|
|
|
8
8
|
const PACKAGE_NAME = "@sentry/instrumentation-mysql2";
|
|
9
9
|
const ORIGIN = "auto.db.otel.mysql2";
|
|
10
|
-
const supportedVersions = [">=1.4.2 <
|
|
10
|
+
const supportedVersions = [">=1.4.2 <3.20.0"];
|
|
11
11
|
class MySQL2Instrumentation extends InstrumentationBase {
|
|
12
12
|
constructor(config = {}) {
|
|
13
13
|
super(PACKAGE_NAME, SDK_VERSION, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n * - Types from 'mysql2' inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport { DB_STATEMENT, DB_SYSTEM } from '@sentry/conventions/attributes';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n} from '@sentry/core';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport type { Connection, FormatFunction, Query, QueryError, QueryOptions } from './mysql2-types';\nimport { DB_SYSTEM_VALUE_MYSQL } from './semconv';\nimport { getConnectionAttributes, getConnectionPrototypeToInstrument, getQueryText, getSpanName, once } from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql2';\nconst ORIGIN = 'auto.db.otel.mysql2';\n\nconst supportedVersions = ['>=1.4.2 <4'];\n\n// The raw imported `mysql2` module exposes the `format` helper used to render\n// parameterized queries. Typed shallowly since it is only read internally.\ntype MySQL2Module = { format?: FormatFunction; [key: string]: unknown };\n\nexport class MySQL2Instrumentation extends InstrumentationBase<InstrumentationConfig> {\n public constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition[] {\n let format: FormatFunction | undefined;\n function setFormatFunction(moduleExports: MySQL2Module): void {\n if (!format && moduleExports.format) {\n format = moduleExports.format;\n }\n }\n const patch = (ConnectionPrototype: Connection): void => {\n if (isWrapped(ConnectionPrototype.query)) {\n this._unwrap(ConnectionPrototype, 'query');\n }\n this._wrap(ConnectionPrototype, 'query', this._patchQuery(format) as any);\n if (isWrapped(ConnectionPrototype.execute)) {\n this._unwrap(ConnectionPrototype, 'execute');\n }\n this._wrap(ConnectionPrototype, 'execute', this._patchQuery(format) as any);\n };\n const unpatch = (ConnectionPrototype: Connection): void => {\n this._unwrap(ConnectionPrototype, 'query');\n this._unwrap(ConnectionPrototype, 'execute');\n };\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql2',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n [\n new InstrumentationNodeModuleFile(\n 'mysql2/promise.js',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n ),\n new InstrumentationNodeModuleFile(\n 'mysql2/lib/connection.js',\n supportedVersions,\n (moduleExports: any) => {\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n patch(ConnectionPrototype);\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n unpatch(ConnectionPrototype);\n },\n ),\n ],\n ),\n ];\n }\n\n private _patchQuery(format: FormatFunction | undefined) {\n const thisPlugin = this;\n return (originalQuery: Function): Function => {\n return function query(\n this: Connection,\n query: string | Query | QueryOptions,\n _valuesOrCallback?: unknown[] | Function,\n _callback?: Function,\n ) {\n let values;\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n\n const attributes: SpanAttributes = {\n ...getConnectionAttributes(this.config),\n // oxlint-disable-next-line typescript/no-deprecated\n [DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL,\n // oxlint-disable-next-line typescript/no-deprecated\n [DB_STATEMENT]: getQueryText(query, format, values),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n\n const span = startInactiveSpan({\n name: getSpanName(query),\n kind: SPAN_KIND.CLIENT,\n attributes,\n });\n\n const endSpan = once((err?: QueryError | null) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n });\n\n if (arguments.length === 1) {\n if (typeof (query as any).onResult === 'function') {\n thisPlugin._wrap(query as any, 'onResult', thisPlugin._patchCallbackQuery(endSpan));\n }\n\n const streamableQuery: Query = originalQuery.apply(this, arguments);\n\n streamableQuery\n .once('error', (err: any) => {\n endSpan(err);\n })\n .once('result', () => {\n endSpan();\n });\n\n return streamableQuery;\n }\n\n if (typeof arguments[1] === 'function') {\n thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan));\n } else if (typeof arguments[2] === 'function') {\n thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan));\n }\n\n return originalQuery.apply(this, arguments);\n };\n };\n }\n\n private _patchCallbackQuery(endSpan: (err?: QueryError | null) => void) {\n return (originalCallback: Function) => {\n return function (...args: [err: QueryError | null, ...rest: unknown[]]) {\n endSpan(args[0]);\n return originalCallback(...args);\n };\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,YAAA,GAAe,gCAAA;AACrB,MAAM,MAAA,GAAS,qBAAA;AAEf,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAMhC,MAAM,8BAA8B,mBAAA,CAA2C;AAAA,EAC7E,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAA8C;AACtD,IAAA,IAAI,MAAA;AACJ,IAAA,SAAS,kBAAkB,aAAA,EAAmC;AAC5D,MAAA,IAAI,CAAC,MAAA,IAAU,aAAA,CAAc,MAAA,EAAQ;AACnC,QAAA,MAAA,GAAS,aAAA,CAAc,MAAA;AAAA,MACzB;AAAA,IACF;AACA,IAAA,MAAM,KAAA,GAAQ,CAAC,mBAAA,KAA0C;AACvD,MAAA,IAAI,SAAA,CAAU,mBAAA,CAAoB,KAAK,CAAA,EAAG;AACxC,QAAA,IAAA,CAAK,OAAA,CAAQ,qBAAqB,OAAO,CAAA;AAAA,MAC3C;AACA,MAAA,IAAA,CAAK,MAAM,mBAAA,EAAqB,OAAA,EAAS,IAAA,CAAK,WAAA,CAAY,MAAM,CAAQ,CAAA;AACxE,MAAA,IAAI,SAAA,CAAU,mBAAA,CAAoB,OAAO,CAAA,EAAG;AAC1C,QA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A,EAAY,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,UACpF;AAEA,UAAA,MAAM,eAAA,GAAyB,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAElE,UAAA,eAAA,CACG,IAAA,CAAK,OAAA,EAAS,CAAC,GAAA,KAAa;AAC3B,YAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,UACb,CAAC,CAAA,CACA,IAAA,CAAK,QAAA,EAAU,MAAM;AACpB,YAAA,OAAA,EAAQ;AAAA,UACV,CAAC,CAAA;AAEH,UAAA,OAAO,eAAA;AAAA,QACT;AAEA,QAAA,IAAI,OAAO,SAAA,CAAU,CAAC,CAAA,KAAM,UAAA,EAAY;AACtC,UAAA,UAAA,CAAW,MAAM,SAAA,EAAW,CAAA,EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE,CAAA,MAAA,IAAW,OAAO,SAAA,CAAU,CAAC,MAAM,UAAA,EAAY;AAC7C,UAAA,UAAA,CAAW,MAAM,SAAA,EAAW,CAAA,EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE;AAEA,QAAA,OAAO,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC5C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AAAA,EAEQ,oBAAoB,OAAA,EAA4C;AACtE,IAAA,OAAO,CAAC,gBAAA,KAA+B;AACrC,MAAA,OAAO,YAAa,IAAA,EAAoD;AACtE,QAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAC,CAAA;AACf,QAAA,OAAO,gBAAA,CAAiB,GAAG,IAAI,CAAA;AAAA,MACjC,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n * - Types from 'mysql2' inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport { DB_STATEMENT, DB_SYSTEM } from '@sentry/conventions/attributes';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n} from '@sentry/core';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport type { Connection, FormatFunction, Query, QueryError, QueryOptions } from './mysql2-types';\nimport { DB_SYSTEM_VALUE_MYSQL } from './semconv';\nimport { getConnectionAttributes, getConnectionPrototypeToInstrument, getQueryText, getSpanName, once } from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql2';\nconst ORIGIN = 'auto.db.otel.mysql2';\n\n// mysql2 >= 3.20.0 publishes via diagnostics_channel and is instrumented by\n// `subscribeMysql2DiagnosticChannels` instead, so this IITM patcher must not\n// overlap it — otherwise every query would emit two mysql2 spans.\nconst supportedVersions = ['>=1.4.2 <3.20.0'];\n\n// The raw imported `mysql2` module exposes the `format` helper used to render\n// parameterized queries. Typed shallowly since it is only read internally.\ntype MySQL2Module = { format?: FormatFunction; [key: string]: unknown };\n\nexport class MySQL2Instrumentation extends InstrumentationBase<InstrumentationConfig> {\n public constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition[] {\n let format: FormatFunction | undefined;\n function setFormatFunction(moduleExports: MySQL2Module): void {\n if (!format && moduleExports.format) {\n format = moduleExports.format;\n }\n }\n const patch = (ConnectionPrototype: Connection): void => {\n if (isWrapped(ConnectionPrototype.query)) {\n this._unwrap(ConnectionPrototype, 'query');\n }\n this._wrap(ConnectionPrototype, 'query', this._patchQuery(format) as any);\n if (isWrapped(ConnectionPrototype.execute)) {\n this._unwrap(ConnectionPrototype, 'execute');\n }\n this._wrap(ConnectionPrototype, 'execute', this._patchQuery(format) as any);\n };\n const unpatch = (ConnectionPrototype: Connection): void => {\n this._unwrap(ConnectionPrototype, 'query');\n this._unwrap(ConnectionPrototype, 'execute');\n };\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql2',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n [\n new InstrumentationNodeModuleFile(\n 'mysql2/promise.js',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n ),\n new InstrumentationNodeModuleFile(\n 'mysql2/lib/connection.js',\n supportedVersions,\n (moduleExports: any) => {\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n patch(ConnectionPrototype);\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n unpatch(ConnectionPrototype);\n },\n ),\n ],\n ),\n ];\n }\n\n private _patchQuery(format: FormatFunction | undefined) {\n const thisPlugin = this;\n return (originalQuery: Function): Function => {\n return function query(\n this: Connection,\n query: string | Query | QueryOptions,\n _valuesOrCallback?: unknown[] | Function,\n _callback?: Function,\n ) {\n let values;\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n\n const attributes: SpanAttributes = {\n ...getConnectionAttributes(this.config),\n // oxlint-disable-next-line typescript/no-deprecated\n [DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL,\n // oxlint-disable-next-line typescript/no-deprecated\n [DB_STATEMENT]: getQueryText(query, format, values),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n\n const span = startInactiveSpan({\n name: getSpanName(query),\n kind: SPAN_KIND.CLIENT,\n attributes,\n });\n\n const endSpan = once((err?: QueryError | null) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n });\n\n if (arguments.length === 1) {\n if (typeof (query as any).onResult === 'function') {\n thisPlugin._wrap(query as any, 'onResult', thisPlugin._patchCallbackQuery(endSpan));\n }\n\n const streamableQuery: Query = originalQuery.apply(this, arguments);\n\n streamableQuery\n .once('error', (err: any) => {\n endSpan(err);\n })\n .once('result', () => {\n endSpan();\n });\n\n return streamableQuery;\n }\n\n if (typeof arguments[1] === 'function') {\n thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan));\n } else if (typeof arguments[2] === 'function') {\n thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan));\n }\n\n return originalQuery.apply(this, arguments);\n };\n };\n }\n\n private _patchCallbackQuery(endSpan: (err?: QueryError | null) => void) {\n return (originalCallback: Function) => {\n return function (...args: [err: QueryError | null, ...rest: unknown[]]) {\n endSpan(args[0]);\n return originalCallback(...args);\n };\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,YAAA,GAAe,gCAAA;AACrB,MAAM,MAAA,GAAS,qBAAA;AAKf,MAAM,iBAAA,GAAoB,CAAC,iBAAiB,CAAA;AAMrC,MAAM,8BAA8B,mBAAA,CAA2C;AAAA,EAC7E,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IA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EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE;AAEA,QAAA,OAAO,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC5C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AAAA,EAEQ,oBAAoB,OAAA,EAA4C;AACtE,IAAA,OAAO,CAAC,gBAAA,KAA+B;AACrC,MAAA,OAAO,YAAa,IAAA,EAAoD;AACtE,QAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAC,CAAA;AACf,QAAA,OAAO,gBAAA,CAAiB,GAAG,IAAI,CAAA;AAAA,MACjC,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineIntegration, extendIntegration } from '@sentry/core';
|
|
2
2
|
import * as dc from 'node:diagnostics_channel';
|
|
3
|
-
import {
|
|
3
|
+
import { redisIntegration as redisIntegration$1 } from '@sentry/server-utils';
|
|
4
4
|
import { generateInstrumentOnce } from '@sentry/node-core';
|
|
5
5
|
import { isDiagnosticsChannelInjectionEnabled } from '../../../sdk/diagnosticsChannelInjection.js';
|
|
6
6
|
import { cacheResponseHook, setRedisOptions } from './cache.js';
|
|
@@ -23,24 +23,19 @@ const instrumentRedis = Object.assign(
|
|
|
23
23
|
() => {
|
|
24
24
|
if (!isDiagnosticsChannelInjectionEnabled() || !dc.tracingChannel) {
|
|
25
25
|
instrumentIORedis();
|
|
26
|
-
|
|
27
|
-
instrumentRedisModule();
|
|
28
|
-
if (dc.tracingChannel) {
|
|
29
|
-
waitForTracingChannelBinding(() => {
|
|
30
|
-
subscribeRedisDiagnosticChannels(dc.tracingChannel, cacheResponseHook);
|
|
31
|
-
});
|
|
26
|
+
instrumentRedisModule();
|
|
32
27
|
}
|
|
33
28
|
},
|
|
34
29
|
{ id: INTEGRATION_NAME }
|
|
35
30
|
);
|
|
36
31
|
const _redisIntegration = ((options = {}) => {
|
|
37
|
-
return {
|
|
32
|
+
return extendIntegration(redisIntegration$1({ responseHook: cacheResponseHook }), {
|
|
38
33
|
name: INTEGRATION_NAME,
|
|
39
34
|
setupOnce() {
|
|
40
35
|
setRedisOptions(options);
|
|
41
36
|
instrumentRedis();
|
|
42
37
|
}
|
|
43
|
-
};
|
|
38
|
+
});
|
|
44
39
|
});
|
|
45
40
|
const redisIntegration = defineIntegration(_redisIntegration);
|
|
46
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport * as dc from 'node:diagnostics_channel';\nimport { redisIntegration as redisChannelIntegration } from '@sentry/server-utils';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { isDiagnosticsChannelInjectionEnabled } from '../../../sdk/diagnosticsChannelInjection';\nimport { cacheResponseHook, type RedisOptions, setRedisOptions } from './cache';\nimport { IORedisInstrumentation } from './vendored/ioredis-instrumentation';\nimport { RedisInstrumentation } from './vendored/redis-instrumentation';\n\n// `cacheResponseHook`/`_redisOptions` live in `./cache` (which has no OTel\n// instrumentation imports) so the orchestrion opt-in can pull the hook without\n// dragging the OTel redis instrumentation in. Re-exported here for tests.\nexport { _redisOptions, cacheResponseHook } from './cache';\n\nconst INTEGRATION_NAME = 'Redis' as const;\n\nconst instrumentIORedis = generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/**\n * To be able to preload all Redis OTel instrumentations with just one ID\n * (\"Redis\"), all the instrumentations are generated in this one function\n */\nexport const instrumentRedis = Object.assign(\n (): void => {\n // When diagnostics-channel injection is opted in, orchestrion fully owns the older\n // ioredis (`<5.11.0`) and redis/node-redis (`<5.12.0`) ranges — commands, connect, and\n // batches — so skip both OTel monkey-patches to avoid double instrumentation. On Node\n // without `tracingChannel` (<18.19) orchestrion can't run, so keep the OTel patches there.\n if (!isDiagnosticsChannelInjectionEnabled() || !dc.tracingChannel) {\n instrumentIORedis();\n instrumentRedisModule();\n }\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n // The diagnostics_channel subscription (node-redis >= 5.12.0, ioredis >= 5.11.0) lives in\n // server-utils so it is shared across server runtimes; we extend it here to also run the vendored\n // OTel patchers for older client versions. `cacheResponseHook` reads options set in the extension's\n // `setupOnce` below, but it only runs at command time, by which point those options are set.\n return extendIntegration(redisChannelIntegration({ responseHook: cacheResponseHook }), {\n name: INTEGRATION_NAME,\n setupOnce() {\n setRedisOptions(options);\n instrumentRedis();\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["redisChannelIntegration"],"mappings":";;;;;;;;;;AAeA,MAAM,gBAAA,GAAmB,OAAA;AAEzB,MAAM,iBAAA,GAAoB,sBAAA,CAAuB,CAAA,EAAG,gBAAgB,YAAY,MAAM;AACpF,EAAA,OAAO,IAAI,sBAAA,CAAuB;AAAA,IAChC,YAAA,EAAc;AAAA,GACf,CAAA;AACH,CAAC,CAAA;AAED,MAAM,qBAAA,GAAwB,sBAAA,CAAuB,CAAA,EAAG,gBAAgB,UAAU,MAAM;AACtF,EAAA,OAAO,IAAI,oBAAA,CAAqB;AAAA,IAC9B,YAAA,EAAc;AAAA,GACf,CAAA;AACH,CAAC,CAAA;AAMM,MAAM,kBAAkB,MAAA,CAAO,MAAA;AAAA,EACpC,MAAY;AAKV,IAAA,IAAI,CAAC,oCAAA,EAAqC,IAAK,CAAC,GAAG,cAAA,EAAgB;AACjE,MAAA,iBAAA,EAAkB;AAClB,MAAA,qBAAA,EAAsB;AAAA,IACxB;AAAA,EAIF,CAAA;AAAA,EACA,EAAE,IAAI,gBAAA;AACR;AAEA,MAAM,iBAAA,IAAqB,CAAC,OAAA,GAAwB,EAAC,KAAM;AAKzD,EAAA,OAAO,kBAAkBA,kBAAA,CAAwB,EAAE,YAAA,EAAc,iBAAA,EAAmB,CAAA,EAAG;AAAA,IACrF,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,eAAA,CAAgB,OAAO,CAAA;AACvB,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAiBO,MAAM,gBAAA,GAAmB,kBAAkB,iBAAiB;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.65.0","sideEffects":false}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { channelIntegrations, detectOrchestrionSetup, ioredisChannelIntegration } from '@sentry/server-utils/orchestrion';
|
|
1
|
+
import { channelIntegrations, detectOrchestrionSetup, ioredisChannelIntegration, redisChannelIntegration } from '@sentry/server-utils/orchestrion';
|
|
2
2
|
import { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';
|
|
3
3
|
import { cacheResponseHook } from '../integrations/tracing/redis/cache.js';
|
|
4
4
|
import { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection.js';
|
|
@@ -11,12 +11,14 @@ function experimentalUseDiagnosticsChannelInjection() {
|
|
|
11
11
|
const integrations = Object.values(channelIntegrations).map((createIntegration) => createIntegration());
|
|
12
12
|
const replacedOtelIntegrationNames = integrations.map((i) => i.name);
|
|
13
13
|
return {
|
|
14
|
-
// ioredis
|
|
15
|
-
//
|
|
16
|
-
// `
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
// ioredis and redis are wired separately (not in `channelIntegrations`): they need the node
|
|
15
|
+
// redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,
|
|
16
|
+
// so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).
|
|
17
|
+
integrations: [
|
|
18
|
+
...integrations,
|
|
19
|
+
ioredisChannelIntegration({ responseHook: cacheResponseHook }),
|
|
20
|
+
redisChannelIntegration({ responseHook: cacheResponseHook })
|
|
21
|
+
],
|
|
20
22
|
replacedOtelIntegrationNames,
|
|
21
23
|
register: registerDiagnosticsChannelInjection,
|
|
22
24
|
detect: detectOrchestrionSetup
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // The registry integrations 1:1 replace the OTel integration of the same name.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis
|
|
1
|
+
{"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n redisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // The registry integrations 1:1 replace the OTel integration of the same name.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node\n // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,\n // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).\n integrations: [\n ...integrations,\n ioredisChannelIntegration({ responseHook: cacheResponseHook }),\n redisChannelIntegration({ responseHook: cacheResponseHook }),\n ],\n replacedOtelIntegrationNames,\n register: registerDiagnosticsChannelInjection,\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":[],"mappings":";;;;;AAWO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAO,mBAAA;AACT;AAkCO,SAAS,0CAAA,GAAmD;AACjE,EAAA,oCAAA,CAAqC,MAAmC;AAEtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAO,mBAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA,MAIL,YAAA,EAAc;AAAA,QACZ,GAAG,YAAA;AAAA,QACH,yBAAA,CAA0B,EAAE,YAAA,EAAc,iBAAA,EAAmB,CAAA;AAAA,QAC7D,uBAAA,CAAwB,EAAE,YAAA,EAAc,iBAAA,EAAmB;AAAA,OAC7D;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAU,mCAAA;AAAA,MACV,MAAA,EAAQ;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestOptions } from 'node:http';
|
|
2
2
|
import type { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';
|
|
3
|
-
import
|
|
3
|
+
import { instrumentHttpOutgoingRequests } from '@sentry/node-core';
|
|
4
4
|
interface HttpOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Whether breadcrumbs should be recorded for outgoing requests.
|
|
@@ -117,7 +117,7 @@ interface HttpOptions {
|
|
|
117
117
|
applyCustomAttributesOnSpan?: (span: Span, request: HttpIncomingMessage | HttpClientRequest, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
export declare const instrumentSentryHttp:
|
|
120
|
+
export declare const instrumentSentryHttp: typeof instrumentHttpOutgoingRequests & {
|
|
121
121
|
id: string;
|
|
122
122
|
};
|
|
123
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,IAAI,EA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AAO,CAAC;IAE9E;;;;;;;;;;;;;OAaG;IACH,0BAA0B,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEpE;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE;QAChB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,mBAAmB,GAAG,iBAAiB,KAAK,IAAI,CAAC;QACjF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,GAAG,kBAAkB,KAAK,IAAI,CAAC;QACxF,2BAA2B,CAAC,EAAE,CAC5B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,GAAG,iBAAiB,EAChD,QAAQ,EAAE,mBAAmB,GAAG,kBAAkB,KAC/C,IAAI,CAAC;KACX,CAAC;CACH;AAED,eAAO,MAAM,oBAAoB;;CAE/B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;;CAuE1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,UAAU,cAAc;IACtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAID,eAAO,MAAM,iBAAiB;;CAI7B,CAAC;AAiBF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB;;CAAyC,CAAC"}
|
|
@@ -1,136 +1,2 @@
|
|
|
1
|
-
export type PromiseOrValue
|
|
2
|
-
export type Maybe<T> = null | undefined | T;
|
|
3
|
-
export interface Location {
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
startToken: Token;
|
|
7
|
-
source: Source;
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export interface Token {
|
|
11
|
-
kind: string;
|
|
12
|
-
start: number;
|
|
13
|
-
end: number;
|
|
14
|
-
line: number;
|
|
15
|
-
column: number;
|
|
16
|
-
value: string;
|
|
17
|
-
prev: Token | null;
|
|
18
|
-
next: Token | null;
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
export interface Source {
|
|
22
|
-
body: string;
|
|
23
|
-
name: string;
|
|
24
|
-
locationOffset: Location;
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}
|
|
27
|
-
export interface DocumentNode {
|
|
28
|
-
kind: string;
|
|
29
|
-
definitions: ReadonlyArray<DefinitionNode>;
|
|
30
|
-
loc?: Location;
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}
|
|
33
|
-
export interface DefinitionNode {
|
|
34
|
-
kind: string;
|
|
35
|
-
loc?: Location;
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}
|
|
38
|
-
export interface OperationDefinitionNode extends DefinitionNode {
|
|
39
|
-
operation: string;
|
|
40
|
-
name?: {
|
|
41
|
-
kind: string;
|
|
42
|
-
value: string;
|
|
43
|
-
loc?: Location;
|
|
44
|
-
};
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}
|
|
47
|
-
export interface ParseOptions {
|
|
48
|
-
noLocation?: boolean;
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}
|
|
51
|
-
export interface ExecutionArgs {
|
|
52
|
-
schema: GraphQLSchema;
|
|
53
|
-
document: DocumentNode;
|
|
54
|
-
rootValue?: any;
|
|
55
|
-
contextValue?: any;
|
|
56
|
-
variableValues?: Maybe<{
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}>;
|
|
59
|
-
operationName?: Maybe<string>;
|
|
60
|
-
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
|
61
|
-
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
}
|
|
64
|
-
export interface ExecutionResult {
|
|
65
|
-
errors?: ReadonlyArray<GraphQLError>;
|
|
66
|
-
data?: Record<string, any> | null;
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
}
|
|
69
|
-
export interface GraphQLError {
|
|
70
|
-
message: string;
|
|
71
|
-
locations?: ReadonlyArray<{
|
|
72
|
-
line: number;
|
|
73
|
-
column: number;
|
|
74
|
-
}>;
|
|
75
|
-
path?: ReadonlyArray<string | number>;
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
}
|
|
78
|
-
export interface GraphQLSchema {
|
|
79
|
-
getQueryType(): GraphQLObjectType | undefined | null;
|
|
80
|
-
getMutationType(): GraphQLObjectType | undefined | null;
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
|
-
export interface GraphQLObjectType {
|
|
84
|
-
name: string;
|
|
85
|
-
getFields(): {
|
|
86
|
-
[key: string]: GraphQLField;
|
|
87
|
-
};
|
|
88
|
-
[key: string]: any;
|
|
89
|
-
}
|
|
90
|
-
export interface GraphQLField {
|
|
91
|
-
name: string;
|
|
92
|
-
type: GraphQLOutputType;
|
|
93
|
-
resolve?: GraphQLFieldResolver<any, any>;
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}
|
|
96
|
-
export type GraphQLOutputType = GraphQLNamedOutputType | GraphQLWrappingType;
|
|
97
|
-
interface GraphQLNamedOutputType {
|
|
98
|
-
name: string;
|
|
99
|
-
[key: string]: any;
|
|
100
|
-
}
|
|
101
|
-
interface GraphQLWrappingType {
|
|
102
|
-
ofType: GraphQLOutputType;
|
|
103
|
-
[key: string]: any;
|
|
104
|
-
}
|
|
105
|
-
export interface GraphQLUnionType {
|
|
106
|
-
name: string;
|
|
107
|
-
getTypes(): ReadonlyArray<GraphQLObjectType>;
|
|
108
|
-
[key: string]: any;
|
|
109
|
-
}
|
|
110
|
-
export type GraphQLType = GraphQLOutputType | GraphQLUnionType;
|
|
111
|
-
export type GraphQLFieldResolver<TSource, TContext, TArgs = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => any;
|
|
112
|
-
export type GraphQLTypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: any) => any;
|
|
113
|
-
export interface GraphQLResolveInfo {
|
|
114
|
-
fieldName: string;
|
|
115
|
-
fieldNodes: ReadonlyArray<{
|
|
116
|
-
kind: string;
|
|
117
|
-
loc?: Location;
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
}>;
|
|
120
|
-
returnType: {
|
|
121
|
-
toString(): string;
|
|
122
|
-
[key: string]: any;
|
|
123
|
-
};
|
|
124
|
-
parentType: {
|
|
125
|
-
name: string;
|
|
126
|
-
[key: string]: any;
|
|
127
|
-
};
|
|
128
|
-
path: any;
|
|
129
|
-
[key: string]: any;
|
|
130
|
-
}
|
|
131
|
-
export type ValidationRule = any;
|
|
132
|
-
export interface TypeInfo {
|
|
133
|
-
[key: string]: any;
|
|
134
|
-
}
|
|
135
|
-
export {};
|
|
1
|
+
export type { DefinitionNode, DocumentNode, ExecutionArgs, ExecutionResult, GraphQLError, GraphQLFieldResolver, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, Location, Maybe, OperationDefinitionNode, ParseOptions, PromiseOrValue, Source, Token, TypeInfo, ValidationRule, } from '@sentry/server-utils/orchestrion';
|
|
136
2
|
//# sourceMappingURL=graphql-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/graphql/vendored/graphql-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/graphql/vendored/graphql-types.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,GACf,MAAM,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/graphql/vendored/utils.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EAKjB,QAAQ,EACR,KAAK,EAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAKzD,OAAO,KAAK,EAA6B,qBAAqB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAKlE,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,OAAO,CAAC,OAAO,CAE9D,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/graphql/vendored/utils.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EAKjB,QAAQ,EACR,KAAK,EAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE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BAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,qBAAqB,EAAE,KAAK,CAAC,GAAG,WAAW,CAqEtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAmBzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA4CtD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,CAchF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,EAClB,EAAE,EAAE,gBAAgB,EACpB,OAAO,CAAC,EAAE,GAAG,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc,CAmBhB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,CAAC,EAAE,oBAAoB,EAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC7B,cAAc,CAwBhB;AA8CD,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAO/D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,aAAa,EAAE,QAAQ,GAAG,QAAQ,CAkBlF;AAID,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAQnE,eAAO,MAAM,gBAAgB;;CAA8E,CAAC;AAa5G;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB;;CAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AA2BrH,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,qBAAqB,CAAC;gBAChE,MAAM,GAAE,qBAA0B;IAIrD,SAAS,CAAC,IAAI,IAAI,mCAAmC,EAAE;IA2DvD,OAAO,CAAC,WAAW;IAmEnB,OAAO,CAAC,mBAAmB;CAQ5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAqB,KAAK,YAAY,EAAmB,MAAM,SAAS,CAAC;AAOhF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgB3D;;;GAGG;AACH,eAAO,MAAM,eAAe,SACtB,IAAI;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAqB,KAAK,YAAY,EAAmB,MAAM,SAAS,CAAC;AAOhF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgB3D;;;GAGG;AACH,eAAO,MAAM,eAAe,SACtB,IAAI;;CAcT,CAAC;AAgBF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;;CAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,kCAAkC,CAAC;AAM1C,wBAAgB,uCAAuC,IAAI,OAAO,mBAAmB,CAEpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0CAA0C,IAAI,IAAI,CAoBjE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RequestOptions } from 'node:http';
|
|
2
2
|
import { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';
|
|
3
|
-
import {
|
|
3
|
+
import { instrumentHttpOutgoingRequests } from '@sentry/node-core';
|
|
4
4
|
interface HttpOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Whether breadcrumbs should be recorded for outgoing requests.
|
|
@@ -120,7 +120,7 @@ interface HttpOptions {
|
|
|
120
120
|
applyCustomAttributesOnSpan?: (span: Span, request: HttpIncomingMessage | HttpClientRequest, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
export declare const instrumentSentryHttp:
|
|
123
|
+
export declare const instrumentSentryHttp: typeof instrumentHttpOutgoingRequests & {
|
|
124
124
|
id: string;
|
|
125
125
|
};
|
|
126
126
|
/**
|
|
@@ -1,136 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type Maybe<T> = null | undefined | T;
|
|
3
|
-
export interface Location {
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
startToken: Token;
|
|
7
|
-
source: Source;
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export interface Token {
|
|
11
|
-
kind: string;
|
|
12
|
-
start: number;
|
|
13
|
-
end: number;
|
|
14
|
-
line: number;
|
|
15
|
-
column: number;
|
|
16
|
-
value: string;
|
|
17
|
-
prev: Token | null;
|
|
18
|
-
next: Token | null;
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
export interface Source {
|
|
22
|
-
body: string;
|
|
23
|
-
name: string;
|
|
24
|
-
locationOffset: Location;
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}
|
|
27
|
-
export interface DocumentNode {
|
|
28
|
-
kind: string;
|
|
29
|
-
definitions: ReadonlyArray<DefinitionNode>;
|
|
30
|
-
loc?: Location;
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}
|
|
33
|
-
export interface DefinitionNode {
|
|
34
|
-
kind: string;
|
|
35
|
-
loc?: Location;
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}
|
|
38
|
-
export interface OperationDefinitionNode extends DefinitionNode {
|
|
39
|
-
operation: string;
|
|
40
|
-
name?: {
|
|
41
|
-
kind: string;
|
|
42
|
-
value: string;
|
|
43
|
-
loc?: Location;
|
|
44
|
-
};
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}
|
|
47
|
-
export interface ParseOptions {
|
|
48
|
-
noLocation?: boolean;
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}
|
|
51
|
-
export interface ExecutionArgs {
|
|
52
|
-
schema: GraphQLSchema;
|
|
53
|
-
document: DocumentNode;
|
|
54
|
-
rootValue?: any;
|
|
55
|
-
contextValue?: any;
|
|
56
|
-
variableValues?: Maybe<{
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}>;
|
|
59
|
-
operationName?: Maybe<string>;
|
|
60
|
-
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
|
61
|
-
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
}
|
|
64
|
-
export interface ExecutionResult {
|
|
65
|
-
errors?: ReadonlyArray<GraphQLError>;
|
|
66
|
-
data?: Record<string, any> | null;
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
}
|
|
69
|
-
export interface GraphQLError {
|
|
70
|
-
message: string;
|
|
71
|
-
locations?: ReadonlyArray<{
|
|
72
|
-
line: number;
|
|
73
|
-
column: number;
|
|
74
|
-
}>;
|
|
75
|
-
path?: ReadonlyArray<string | number>;
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
}
|
|
78
|
-
export interface GraphQLSchema {
|
|
79
|
-
getQueryType(): GraphQLObjectType | undefined | null;
|
|
80
|
-
getMutationType(): GraphQLObjectType | undefined | null;
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
|
-
export interface GraphQLObjectType {
|
|
84
|
-
name: string;
|
|
85
|
-
getFields(): {
|
|
86
|
-
[key: string]: GraphQLField;
|
|
87
|
-
};
|
|
88
|
-
[key: string]: any;
|
|
89
|
-
}
|
|
90
|
-
export interface GraphQLField {
|
|
91
|
-
name: string;
|
|
92
|
-
type: GraphQLOutputType;
|
|
93
|
-
resolve?: GraphQLFieldResolver<any, any>;
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}
|
|
96
|
-
export type GraphQLOutputType = GraphQLNamedOutputType | GraphQLWrappingType;
|
|
97
|
-
interface GraphQLNamedOutputType {
|
|
98
|
-
name: string;
|
|
99
|
-
[key: string]: any;
|
|
100
|
-
}
|
|
101
|
-
interface GraphQLWrappingType {
|
|
102
|
-
ofType: GraphQLOutputType;
|
|
103
|
-
[key: string]: any;
|
|
104
|
-
}
|
|
105
|
-
export interface GraphQLUnionType {
|
|
106
|
-
name: string;
|
|
107
|
-
getTypes(): ReadonlyArray<GraphQLObjectType>;
|
|
108
|
-
[key: string]: any;
|
|
109
|
-
}
|
|
110
|
-
export type GraphQLType = GraphQLOutputType | GraphQLUnionType;
|
|
111
|
-
export type GraphQLFieldResolver<TSource, TContext, TArgs = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => any;
|
|
112
|
-
export type GraphQLTypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: any) => any;
|
|
113
|
-
export interface GraphQLResolveInfo {
|
|
114
|
-
fieldName: string;
|
|
115
|
-
fieldNodes: ReadonlyArray<{
|
|
116
|
-
kind: string;
|
|
117
|
-
loc?: Location;
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
}>;
|
|
120
|
-
returnType: {
|
|
121
|
-
toString(): string;
|
|
122
|
-
[key: string]: any;
|
|
123
|
-
};
|
|
124
|
-
parentType: {
|
|
125
|
-
name: string;
|
|
126
|
-
[key: string]: any;
|
|
127
|
-
};
|
|
128
|
-
path: any;
|
|
129
|
-
[key: string]: any;
|
|
130
|
-
}
|
|
131
|
-
export type ValidationRule = any;
|
|
132
|
-
export interface TypeInfo {
|
|
133
|
-
[key: string]: any;
|
|
134
|
-
}
|
|
135
|
-
export {};
|
|
1
|
+
export { DefinitionNode, DocumentNode, ExecutionArgs, ExecutionResult, GraphQLError, GraphQLFieldResolver, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, Location, Maybe, OperationDefinitionNode, ParseOptions, PromiseOrValue, Source, Token, TypeInfo, ValidationRule, } from '@sentry/server-utils/orchestrion';
|
|
136
2
|
//# sourceMappingURL=graphql-types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.65.0",
|
|
4
4
|
"description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"@opentelemetry/instrumentation": "^0.220.0",
|
|
70
70
|
"@opentelemetry/sdk-trace-base": "^2.9.0",
|
|
71
71
|
"@sentry/conventions": "^0.15.1",
|
|
72
|
-
"@sentry/core": "10.
|
|
73
|
-
"@sentry/node-core": "10.
|
|
74
|
-
"@sentry/opentelemetry": "10.
|
|
75
|
-
"@sentry/server-utils": "10.
|
|
72
|
+
"@sentry/core": "10.65.0",
|
|
73
|
+
"@sentry/node-core": "10.65.0",
|
|
74
|
+
"@sentry/opentelemetry": "10.65.0",
|
|
75
|
+
"@sentry/server-utils": "10.65.0",
|
|
76
76
|
"import-in-the-middle": "^3.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|