@sentry-internal/tracing
Advanced tools
Comparing version 7.45.0 to 7.46.0
@@ -202,5 +202,15 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const { idleTimeout, finalTimeout, heartbeatInterval } = this.options; | ||
const op = 'ui.action.click'; | ||
const op = 'ui.action.click'; | ||
const currentTransaction = core.getActiveTransaction(); | ||
if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) { | ||
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && | ||
utils.logger.warn( | ||
`[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`, | ||
); | ||
return undefined; | ||
} | ||
if (inflightInteractionTransaction) { | ||
inflightInteractionTransaction.setFinishReason('interactionInterrupted'); | ||
inflightInteractionTransaction.finish(); | ||
@@ -207,0 +217,0 @@ inflightInteractionTransaction = undefined; |
@@ -25,2 +25,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
name: types.WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin | ||
startTimestamp: utils.browserPerformanceTimeOrigin, | ||
op: 'pageload', | ||
@@ -27,0 +29,0 @@ metadata: { source: 'url' }, |
@@ -33,2 +33,13 @@ var { | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
if (this._useNest) { | ||
this._module = this._module || utils.loadModule('@nestjs/graphql'); | ||
} else { | ||
this._module = this._module || utils.loadModule('apollo-server-core'); | ||
} | ||
return this._module; | ||
} | ||
/** | ||
@@ -44,6 +55,4 @@ * @inheritDoc | ||
if (this._useNest) { | ||
const pkg = utils.loadModule | ||
const pkg = this.loadDependency(); | ||
('@nestjs/graphql'); | ||
if (!pkg) { | ||
@@ -80,6 +89,4 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.'); | ||
} else { | ||
const pkg = utils.loadModule | ||
const pkg = this.loadDependency(); | ||
('apollo-server-core'); | ||
if (!pkg) { | ||
@@ -86,0 +93,0 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Apollo Integration was unable to require apollo-server-core package.'); |
@@ -22,2 +22,7 @@ var { | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || utils.loadModule('graphql/execution/execute.js')); | ||
} | ||
/** | ||
@@ -32,6 +37,4 @@ * @inheritDoc | ||
const pkg = utils.loadModule | ||
const pkg = this.loadDependency(); | ||
('graphql/execution/execute.js'); | ||
if (!pkg) { | ||
@@ -38,0 +41,0 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('GraphQL Integration was unable to require graphql/execution package.'); |
@@ -106,2 +106,8 @@ var { | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
return (this._module = this._module || utils.loadModule(moduleName)); | ||
} | ||
/** | ||
@@ -116,6 +122,6 @@ * @inheritDoc | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
const pkg = utils.loadModule(moduleName); | ||
const pkg = this.loadDependency(); | ||
if (!pkg) { | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(`Mongo Integration was unable to require \`${moduleName}\` package.`); | ||
@@ -122,0 +128,0 @@ return; |
@@ -22,2 +22,7 @@ var { | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || utils.loadModule('mysql/lib/Connection.js')); | ||
} | ||
/** | ||
@@ -32,3 +37,3 @@ * @inheritDoc | ||
const pkg = utils.loadModule('mysql/lib/Connection.js'); | ||
const pkg = this.loadDependency(); | ||
@@ -35,0 +40,0 @@ if (!pkg) { |
@@ -26,2 +26,7 @@ var { | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || utils.loadModule('pg')); | ||
} | ||
/** | ||
@@ -36,3 +41,3 @@ * @inheritDoc | ||
const pkg = utils.loadModule('pg'); | ||
const pkg = this.loadDependency(); | ||
@@ -39,0 +44,0 @@ if (!pkg) { |
@@ -1,2 +0,2 @@ | ||
import { TRACING_DEFAULTS, addTracingExtensions, extractTraceparentData, startIdleTransaction } from '@sentry/core'; | ||
import { TRACING_DEFAULTS, addTracingExtensions, extractTraceparentData, startIdleTransaction, getActiveTransaction } from '@sentry/core'; | ||
import { logger, baggageHeaderToDynamicSamplingContext, getDomElement } from '@sentry/utils'; | ||
@@ -200,5 +200,15 @@ import { registerBackgroundTabDetection } from './backgroundtab.js'; | ||
const { idleTimeout, finalTimeout, heartbeatInterval } = this.options; | ||
const op = 'ui.action.click'; | ||
const op = 'ui.action.click'; | ||
const currentTransaction = getActiveTransaction(); | ||
if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) { | ||
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && | ||
logger.warn( | ||
`[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`, | ||
); | ||
return undefined; | ||
} | ||
if (inflightInteractionTransaction) { | ||
inflightInteractionTransaction.setFinishReason('interactionInterrupted'); | ||
inflightInteractionTransaction.finish(); | ||
@@ -205,0 +215,0 @@ inflightInteractionTransaction = undefined; |
@@ -1,2 +0,2 @@ | ||
import { logger, addInstrumentationHandler } from '@sentry/utils'; | ||
import { logger, browserPerformanceTimeOrigin, addInstrumentationHandler } from '@sentry/utils'; | ||
import { WINDOW } from './types.js'; | ||
@@ -23,2 +23,4 @@ | ||
name: WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin | ||
startTimestamp: browserPerformanceTimeOrigin, | ||
op: 'pageload', | ||
@@ -25,0 +27,0 @@ metadata: { source: 'url' }, |
import { _optionalChain } from '@sentry/utils/esm/buildPolyfills'; | ||
import { logger, loadModule, fill, arrayify, isThenable } from '@sentry/utils'; | ||
import { loadModule, logger, fill, arrayify, isThenable } from '@sentry/utils'; | ||
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js'; | ||
@@ -28,2 +28,13 @@ | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
if (this._useNest) { | ||
this._module = this._module || loadModule('@nestjs/graphql'); | ||
} else { | ||
this._module = this._module || loadModule('apollo-server-core'); | ||
} | ||
return this._module; | ||
} | ||
/** | ||
@@ -39,6 +50,4 @@ * @inheritDoc | ||
if (this._useNest) { | ||
const pkg = loadModule | ||
const pkg = this.loadDependency(); | ||
('@nestjs/graphql'); | ||
if (!pkg) { | ||
@@ -75,6 +84,4 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.'); | ||
} else { | ||
const pkg = loadModule | ||
const pkg = this.loadDependency(); | ||
('apollo-server-core'); | ||
if (!pkg) { | ||
@@ -81,0 +88,0 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Apollo Integration was unable to require apollo-server-core package.'); |
import { _optionalChain } from '@sentry/utils/esm/buildPolyfills'; | ||
import { logger, loadModule, fill, isThenable } from '@sentry/utils'; | ||
import { loadModule, logger, fill, isThenable } from '@sentry/utils'; | ||
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js'; | ||
@@ -17,2 +17,7 @@ | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || loadModule('graphql/execution/execute.js')); | ||
} | ||
/** | ||
@@ -27,6 +32,4 @@ * @inheritDoc | ||
const pkg = loadModule | ||
const pkg = this.loadDependency(); | ||
('graphql/execution/execute.js'); | ||
if (!pkg) { | ||
@@ -33,0 +36,0 @@ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('GraphQL Integration was unable to require graphql/execution package.'); |
import { _optionalChain } from '@sentry/utils/esm/buildPolyfills'; | ||
import { logger, loadModule, fill, isThenable } from '@sentry/utils'; | ||
import { loadModule, logger, fill, isThenable } from '@sentry/utils'; | ||
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js'; | ||
@@ -101,2 +101,8 @@ | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
return (this._module = this._module || loadModule(moduleName)); | ||
} | ||
/** | ||
@@ -111,6 +117,6 @@ * @inheritDoc | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
const pkg = loadModule(moduleName); | ||
const pkg = this.loadDependency(); | ||
if (!pkg) { | ||
const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; | ||
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Mongo Integration was unable to require \`${moduleName}\` package.`); | ||
@@ -117,0 +123,0 @@ return; |
import { _optionalChain } from '@sentry/utils/esm/buildPolyfills'; | ||
import { logger, loadModule, fill } from '@sentry/utils'; | ||
import { loadModule, logger, fill } from '@sentry/utils'; | ||
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js'; | ||
@@ -17,2 +17,7 @@ | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || loadModule('mysql/lib/Connection.js')); | ||
} | ||
/** | ||
@@ -27,3 +32,3 @@ * @inheritDoc | ||
const pkg = loadModule('mysql/lib/Connection.js'); | ||
const pkg = this.loadDependency(); | ||
@@ -30,0 +35,0 @@ if (!pkg) { |
import { _optionalChain } from '@sentry/utils/esm/buildPolyfills'; | ||
import { logger, loadModule, fill, isThenable } from '@sentry/utils'; | ||
import { loadModule, logger, fill, isThenable } from '@sentry/utils'; | ||
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js'; | ||
@@ -21,2 +21,7 @@ | ||
/** @inheritdoc */ | ||
loadDependency() { | ||
return (this._module = this._module || loadModule('pg')); | ||
} | ||
/** | ||
@@ -31,3 +36,3 @@ * @inheritDoc | ||
const pkg = loadModule('pg'); | ||
const pkg = this.loadDependency(); | ||
@@ -34,0 +39,0 @@ if (!pkg) { |
{ | ||
"name": "@sentry-internal/tracing", | ||
"version": "7.45.0", | ||
"version": "7.46.0", | ||
"description": "Sentry Internal Tracing Package", | ||
@@ -19,11 +19,10 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "7.45.0", | ||
"@sentry/types": "7.45.0", | ||
"@sentry/utils": "7.45.0", | ||
"@sentry/core": "7.46.0", | ||
"@sentry/types": "7.46.0", | ||
"@sentry/utils": "7.46.0", | ||
"tslib": "^1.9.3" | ||
}, | ||
"devDependencies": { | ||
"@sentry/browser": "7.45.0", | ||
"@types/express": "^4.17.14" | ||
} | ||
} |
export * from './exports'; | ||
export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma, lazyLoadedNodePerformanceMonitoringIntegrations, } from './node'; | ||
export type { LazyLoadedIntegration } from './node'; | ||
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, } from './browser'; | ||
@@ -4,0 +5,0 @@ export type { RequestInstrumentationOptions } from './browser'; |
import type { Hub } from '@sentry/core'; | ||
import type { EventProcessor, Integration } from '@sentry/types'; | ||
import type { EventProcessor } from '@sentry/types'; | ||
import type { LazyLoadedIntegration } from './lazy'; | ||
interface ApolloOptions { | ||
useNestjs?: boolean; | ||
} | ||
declare type ApolloResolverGroup = { | ||
[key: string]: () => unknown; | ||
}; | ||
declare type ApolloModelResolvers = { | ||
[key: string]: ApolloResolverGroup; | ||
}; | ||
declare type GraphQLModule = { | ||
GraphQLFactory: { | ||
prototype: { | ||
create: (resolvers: ApolloModelResolvers[]) => unknown; | ||
}; | ||
}; | ||
}; | ||
declare type ApolloModule = { | ||
ApolloServerBase: { | ||
prototype: { | ||
constructSchema: (config: unknown) => unknown; | ||
}; | ||
}; | ||
}; | ||
/** Tracing integration for Apollo */ | ||
export declare class Apollo implements Integration { | ||
export declare class Apollo implements LazyLoadedIntegration<GraphQLModule & ApolloModule> { | ||
/** | ||
@@ -17,2 +38,3 @@ * @inheritDoc | ||
private readonly _useNest; | ||
private _module?; | ||
/** | ||
@@ -22,2 +44,4 @@ * @inheritDoc | ||
constructor(options?: ApolloOptions); | ||
/** @inheritdoc */ | ||
loadDependency(): (GraphQLModule & ApolloModule) | undefined; | ||
/** | ||
@@ -24,0 +48,0 @@ * @inheritDoc |
import type { Hub } from '@sentry/core'; | ||
import type { EventProcessor, Integration } from '@sentry/types'; | ||
import type { EventProcessor } from '@sentry/types'; | ||
import type { LazyLoadedIntegration } from './lazy'; | ||
declare type GraphQLModule = { | ||
[method: string]: (...args: unknown[]) => unknown; | ||
}; | ||
/** Tracing integration for graphql package */ | ||
export declare class GraphQL implements Integration { | ||
export declare class GraphQL implements LazyLoadedIntegration<GraphQLModule> { | ||
/** | ||
@@ -13,2 +17,5 @@ * @inheritDoc | ||
name: string; | ||
private _module?; | ||
/** @inheritdoc */ | ||
loadDependency(): GraphQLModule | undefined; | ||
/** | ||
@@ -19,2 +26,3 @@ * @inheritDoc | ||
} | ||
export {}; | ||
//# sourceMappingURL=graphql.d.ts.map |
import type { Integration } from '@sentry/types'; | ||
export declare const lazyLoadedNodePerformanceMonitoringIntegrations: (() => Integration)[]; | ||
export interface LazyLoadedIntegration<T = object> extends Integration { | ||
/** | ||
* Loads the integration's dependency and caches it so it doesn't have to be loaded again. | ||
* | ||
* If this returns undefined, the dependency could not be loaded. | ||
*/ | ||
loadDependency(): T | undefined; | ||
} | ||
export declare const lazyLoadedNodePerformanceMonitoringIntegrations: (() => LazyLoadedIntegration)[]; | ||
//# sourceMappingURL=lazy.d.ts.map |
import type { Hub } from '@sentry/core'; | ||
import type { EventProcessor, Integration } from '@sentry/types'; | ||
import type { EventProcessor } from '@sentry/types'; | ||
import type { LazyLoadedIntegration } from './lazy'; | ||
declare type Operation = typeof OPERATIONS[number]; | ||
declare const OPERATIONS: readonly ["aggregate", "bulkWrite", "countDocuments", "createIndex", "createIndexes", "deleteMany", "deleteOne", "distinct", "drop", "dropIndex", "dropIndexes", "estimatedDocumentCount", "find", "findOne", "findOneAndDelete", "findOneAndReplace", "findOneAndUpdate", "indexes", "indexExists", "indexInformation", "initializeOrderedBulkOp", "insertMany", "insertOne", "isCapped", "mapReduce", "options", "parallelCollectionScan", "rename", "replaceOne", "stats", "updateMany", "updateOne"]; | ||
interface MongoCollection { | ||
collectionName: string; | ||
dbName: string; | ||
namespace: string; | ||
prototype: { | ||
[operation in Operation]: (...args: unknown[]) => unknown; | ||
}; | ||
} | ||
interface MongoOptions { | ||
@@ -10,4 +19,7 @@ operations?: Operation[]; | ||
} | ||
declare type MongoModule = { | ||
Collection: MongoCollection; | ||
}; | ||
/** Tracing integration for mongo package */ | ||
export declare class Mongo implements Integration { | ||
export declare class Mongo implements LazyLoadedIntegration<MongoModule> { | ||
/** | ||
@@ -24,2 +36,3 @@ * @inheritDoc | ||
private _useMongoose; | ||
private _module?; | ||
/** | ||
@@ -29,2 +42,4 @@ * @inheritDoc | ||
constructor(options?: MongoOptions); | ||
/** @inheritdoc */ | ||
loadDependency(): MongoModule | undefined; | ||
/** | ||
@@ -31,0 +46,0 @@ * @inheritDoc |
import type { Hub } from '@sentry/core'; | ||
import type { EventProcessor, Integration } from '@sentry/types'; | ||
import type { EventProcessor } from '@sentry/types'; | ||
import type { LazyLoadedIntegration } from './lazy'; | ||
interface MysqlConnection { | ||
createQuery: () => void; | ||
} | ||
/** Tracing integration for node-mysql package */ | ||
export declare class Mysql implements Integration { | ||
export declare class Mysql implements LazyLoadedIntegration<MysqlConnection> { | ||
/** | ||
@@ -13,2 +17,5 @@ * @inheritDoc | ||
name: string; | ||
private _module?; | ||
/** @inheritdoc */ | ||
loadDependency(): MysqlConnection | undefined; | ||
/** | ||
@@ -19,2 +26,3 @@ * @inheritDoc | ||
} | ||
export {}; | ||
//# sourceMappingURL=mysql.d.ts.map |
import type { Hub } from '@sentry/core'; | ||
import type { EventProcessor, Integration } from '@sentry/types'; | ||
import type { EventProcessor } from '@sentry/types'; | ||
import type { LazyLoadedIntegration } from './lazy'; | ||
interface PgClient { | ||
prototype: { | ||
query: () => void | Promise<unknown>; | ||
}; | ||
} | ||
interface PgOptions { | ||
usePgNative?: boolean; | ||
} | ||
declare type PGModule = { | ||
Client: PgClient; | ||
native: { | ||
Client: PgClient; | ||
}; | ||
}; | ||
/** Tracing integration for node-postgres package */ | ||
export declare class Postgres implements Integration { | ||
export declare class Postgres implements LazyLoadedIntegration<PGModule> { | ||
/** | ||
@@ -17,3 +29,6 @@ * @inheritDoc | ||
private _usePgNative; | ||
private _module?; | ||
constructor(options?: PgOptions); | ||
/** @inheritdoc */ | ||
loadDependency(): PGModule | undefined; | ||
/** | ||
@@ -20,0 +35,0 @@ * @inheritDoc |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
843195
1
6161
1
61
+ Added@sentry/core@7.46.0(transitive)
+ Added@sentry/types@7.46.0(transitive)
+ Added@sentry/utils@7.46.0(transitive)
- Removed@sentry/core@7.45.0(transitive)
- Removed@sentry/types@7.45.0(transitive)
- Removed@sentry/utils@7.45.0(transitive)
Updated@sentry/core@7.46.0
Updated@sentry/types@7.46.0
Updated@sentry/utils@7.46.0