apps/blog/content/blog/tracing-launch-announcement-pmk4rlpc0ll/index.mdx
We are excited to launch two new featracing-launch-announcement-pmk4rlpc0lltures in Preview: Tracing and Metrics. These two features will allow you to monitor and troubleshoot various performance issues effectively. Try them out and share your feedback!
Developers want to be able to answer the question, "Why is my application slow?" Modern software systems are distributed and complex, making it increasingly difficult to diagnose issues that impact customer experience.
We designed the new tracing and metrics features with these concerns in mind. These features make Prisma more observable as well as easier to monitor and debug.
The tracing feature in Prisma provides a detailed view of every query the Prisma Client carries out, including the time taken to execute each query. This is useful for debugging performance issues, identifying bottlenecks and understanding the behavior of your database operations.
Using a tracing tool such as Jaeger or Honeycomb, traces can be visualized as waterfall diagrams like this:
Tracing is a powerful tool that can help you track requests as they flow through your application. This is especially useful for debugging distributed systems, where each request can span multiple services. To levarage the full power of tracing, it should be implemented end-to-end throughout your application.
The tracing feature in Prisma is fully compliant with OpenTelemetry, so you can integrate it seamlessly into your end-to-end application tracing setup. This also means that you can export your trace data to any OpenTelemetry-compatible tracing system, such as Jaeger, Zipkin, Honeycomb, Datadog, etc.
To get started with tracing, check out the tracing docs.
Metrics is a new feature that allows you to monitor how Prisma interacts with your database. Metrics expose a set of counters, gauges, and histograms that provide information about the state of Prisma and the database connection. The metrics we expose include:
prisma_client_queries_total)prisma_datasource_queries_total)prisma_pool_connections_open)prisma_client_queries_duration_histogram_ms_bucket)Note: A full list of the exposed metrics is available in the metrics docs.
Prisma can often feel like a black box that magically interacts with the database on your behalf. This lack of transparency into Prisma's inner workings can be a problem when things go wrong. With metrics, we aim to give you better visibility into what Prisma is doing under the hood, so that you can diagnose and troubleshoot issues much more easily.
Metrics can be analyzed directly by your application and can also be sent to external monitoring systems and time series databases, like Prometheus or StatsD. Integration with these external systems can significantly improve your monitoring ability by providing the following features out of the box:
For example, you can create detailed dashboards and graphs by integrating Grafana, a popular visualization tool, into your metrics pipeline:
In summary, metrics can help you analyze and monitor the health of your application. It also helps identify performance issues and misconfigurations, so you can quickly take necessary action.
To get started with metrics, check out the metrics docs.
Tracing is helpful for getting fine-grained information about the lifecycle of each operation. Tracing is especially valuable in distributed environments, where a single request can pass through multiple services.
If you want aggregated numerical data for monitoring the health and performance of your application, then consider using metrics.
It's also important to note that tracing and metrics are complementary features. They can be used together to improve the observability of your system.
To get started with tracing and metrics:
We are eager to hear from you! Try out these features and let us know what you think.
📊 Share your feedback on tracing.
📈 Share your feedback on metrics.
🚀 If you plan to use these features for mission critical applications, please contact us to discuss your use case.