
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
@prisma/instrumentation
Advanced tools
OTEL - OpenTelemetry compliant instrumentation for Prisma Client.
⚠️ Warning: This package is provided as part of the tracing Preview Feature
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
$ npm install @prisma/instrumentation
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { PrismaInstrumentation } from '@prisma/instrumentation'
registerInstrumentations({
instrumentations: [new PrismaInstrumentation()],
})
Don't forget to set previewFeatures:
generator client {
provider = "prisma-client-js"
}
Exporting traces to Jaeger Tracing.
import { context, trace } from '@opentelemetry/api'
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { resourceFromAttributes } from '@opentelemetry/resources'
import { BasicTracerProvider, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions'
import { PrismaInstrumentation } from '@prisma/instrumentation'
import { PrismaClient } from '.prisma/client'
const contextManager = new AsyncLocalStorageContextManager().enable()
context.setGlobalContextManager(contextManager)
const otlpTraceExporter = new OTLPTraceExporter()
const provider = new BasicTracerProvider({
resource: resourceFromAttributes({
[ATTR_SERVICE_NAME]: 'test-tracing-service',
[ATTR_SERVICE_VERSION]: '1.0.0',
}),
spanProcessors: [new SimpleSpanProcessor(otlpTraceExporter)],
})
trace.setGlobalTracerProvider(provider)
registerInstrumentations({
instrumentations: [new PrismaInstrumentation()],
})
async function main() {
const prisma = new PrismaClient()
const email = `user.${Date.now()}@prisma.io`
await prisma.user.create({
data: {
email: email,
},
})
}
main()
FAQs
OpenTelemetry compliant instrumentation for Prisma Client
The npm package @prisma/instrumentation receives a total of 4,294,908 weekly downloads. As such, @prisma/instrumentation popularity was classified as popular.
We found that @prisma/instrumentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.