1 Reply
Skipping coffee for instant knowledge! Let's brew that AI answer now.
To use the tracing preview feature in Prisma, follow these step-by-step instructions:
1. Install the required dependencies:
2. Enable the tracing feature in your
schema.prisma
file:
3. Regenerate Prisma Client:
4. Set up tracing in your application. Here's an example configuration using @opentelemetry/sdk-trace-node
:
5. Make sure to initialize tracing before importing PrismaClient in your application.
6. Use Prisma Client as usual in your application. Tracing will now be automatically enabled for your Prisma queries.
7. To visualize your traces, you can use a tool like Jaeger. Run Jaeger locally us
ing Docker:
8. Access the Jaeger dashboard at <http://localhost:16686/
> to view your traces.
Remember that tracing can have a performance impact on your application, especially when sending a large number of spans. Consider using techniques like batching or sampling to reduce this impact if necessary.
For more detailed information and advanced configurations, refer to the OpenTelemetry tracing documentation.
Prisma Support for Tracing and Metrics Is Now in Preview
Monitor Your Server with Tracing Using OpenTelemetry & Prisma
✅ Great, thanks for letting us know that this solved your question!