File tree Expand file tree Collapse file tree
packages/node/src/integrations/tracing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,11 +58,15 @@ interface PrismaOptions {
5858 * @deprecated This is no longer used, v5 works out of the box.
5959 */
6060 prismaInstrumentation ?: Instrumentation ;
61+ /**
62+ * Configuration passed through to the {@link PrismaInstrumentation} constructor.
63+ */
64+ instrumentationConfig ?: ConstructorParameters < typeof PrismaInstrumentation > [ 0 ] ;
6165}
6266
6367class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
64- public constructor ( ) {
65- super ( ) ;
68+ public constructor ( options ?: PrismaOptions ) {
69+ super ( options ?. instrumentationConfig ) ;
6670 }
6771
6872 public enable ( ) : void {
@@ -165,8 +169,8 @@ function engineSpanKindToOTELSpanKind(engineSpanKind: V5EngineSpanKind): SpanKin
165169 }
166170}
167171
168- export const instrumentPrisma = generateInstrumentOnce < PrismaOptions > ( INTEGRATION_NAME , _options => {
169- return new SentryPrismaInteropInstrumentation ( ) ;
172+ export const instrumentPrisma = generateInstrumentOnce < PrismaOptions > ( INTEGRATION_NAME , options => {
173+ return new SentryPrismaInteropInstrumentation ( options ) ;
170174} ) ;
171175
172176/**
@@ -201,11 +205,11 @@ export const instrumentPrisma = generateInstrumentOnce<PrismaOptions>(INTEGRATIO
201205 * }
202206 * ```
203207 */
204- export const prismaIntegration = defineIntegration ( ( _options ?: PrismaOptions ) => {
208+ export const prismaIntegration = defineIntegration ( ( options ?: PrismaOptions ) => {
205209 return {
206210 name : INTEGRATION_NAME ,
207211 setupOnce ( ) {
208- instrumentPrisma ( ) ;
212+ instrumentPrisma ( options ) ;
209213 } ,
210214 setup ( client ) {
211215 // If no tracing helper exists, we skip any work here
You can’t perform that action at this time.
0 commit comments